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

Commit f60aa416 authored by Lee Shombert's avatar Lee Shombert Committed by Android (Google) Code Review
Browse files

Merge "Improve temp-table query" into main

parents d1bcf0c7 2c2d397b
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -447,20 +447,18 @@ static jboolean nativeUpdatesTempOnly(JNIEnv* env, jclass,

    // A temporary, to simplify the code.
    sqlite3_stmt* query = connection->tableQuery;
    sqlite3_reset(query);
    sqlite3_clear_bindings(query);
    result = sqlite3_bind_text(query, 1, sqlite3_sql(statement), -1, SQLITE_STATIC);
    if (result != SQLITE_OK) {
        ALOGE("tables bind pointer returns %s", sqlite3_errstr(result));
        return false;
    }
    result = sqlite3_step(query);
    // Make sure the query is no longer bound to the statement SQL string.
    // Make sure the query is no longer bound to the statement SQL string and
    // that is no longer holding any table locks.
    sqlite3_reset(query);
    sqlite3_clear_bindings(query);

    if (result != SQLITE_ROW && result != SQLITE_DONE) {
        ALOGE("tables query error: %d/%s", result, sqlite3_errstr(result));
        return false;
    }
    return result == SQLITE_DONE;
}
+2 −0
Original line number Diff line number Diff line
@@ -375,6 +375,8 @@ public class SQLiteDatabaseTest {
                assertEquals(3, s.getColumnInt(0));
            }

            mDatabase.execSQL("DROP TABLE t1");

        } catch (SQLiteException e) {
            allowed = false;
        } finally {