Why is SQLiteDatabase.rawQuery(4 arguments) trying to cast a CrossProcessCursorWrapper to a SQLiteCursor ? (ClassCastException)

88 views
Skip to first unread message

NelsoN Melina

unread,
Nov 6, 2014, 6:45:25 AM11/6/14
to sqlc...@googlegroups.com
Here is a link to my question on Stackoverflow : http://stackoverflow.com/questions/26778663/why-is-sqlitedatabase-rawquery4-arguments-trying-to-cast-a-crossprocesscursorw


i am trying to log and fetch those logs in unit test in Android but i get a ClassCastException inside

public Cursor rawQuery(String sql, String[] selectionArgs,
                       int initialRead, int maxRead) {
    SQLiteCursor c = (SQLiteCursor)rawQueryWithFactory(
                                                       null, sql, selectionArgs, null);
    c.setLoadStyle(initialRead, maxRead);

    return c;
}

Which is logical because rawQueryWithFactory, as the others rawquery methods, returns a CrossProcessCursorWrapper (implementing the Cursor interface).

This code is from net.sqlcipher.database.SQLiteDatabase ( Commit: c2aa13e490499482ab38075994cad327d2561749 [c2aa13e] ).


NelsoN Melina

unread,
Nov 6, 2014, 7:27:45 AM11/6/14
to sqlc...@googlegroups.com
As a precision, it's in SQLCipher for Android.

Nick Parker

unread,
Nov 6, 2014, 11:42:06 AM11/6/14
to sqlc...@googlegroups.com
Hi Nelson,

Thanks for reporting the error you are seeing. I've fixed this up in
master [1].

[1]
https://github.com/sqlcipher/android-database-sqlcipher/commit/d15b05edc773a0a7c3016bb6a91deec88f1fa7e7
> --
>
> ---
> You received this message because you are subscribed to the Google
> Groups "SQLCipher Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to sqlcipher+...@googlegroups.com
> <mailto:sqlcipher+...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

--
Nick Parker

signature.asc
Reply all
Reply to author
Forward
0 new messages