Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d72ec5f2 authored by Vasu Nori's avatar Vasu Nori
Browse files

when sqlite returns SQLITE_OK on SQLITEStatement.execute(), ignore it

if it is not ignored AND if SQLITEStatement.execute() is called with a SELECT
or a pragma or some sql statement that returns data, caller gets an exception
with a weird error: "error code 100: unknown error"
to avoid confusion generated by this exception, just write a warning
and ignore the returned data.
Change-Id: I8f0225ceff8f92e32a58f323551e5ada6df63593
parent fea6f6dc
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -58,7 +58,9 @@ static void native_execute(JNIEnv* env, jobject object)
    err = sqlite3_step(statement);

    // Throw an exception if an error occured
    if (err != SQLITE_DONE) {
    if (err == SQLITE_ROW) {
        LOGV("Queries cannot be performed using execute(). use SQLiteDatabase.query() instead.");
    } else if (err != SQLITE_DONE) {
        throw_sqlite3_exception_errcode(env, err, sqlite3_errmsg(handle));
    }