Loading core/jni/android_database_SQLiteConnection.cpp +3 −5 Original line number Diff line number Diff line Loading @@ -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; } Loading core/tests/coretests/src/android/database/sqlite/SQLiteDatabaseTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -375,6 +375,8 @@ public class SQLiteDatabaseTest { assertEquals(3, s.getColumnInt(0)); } mDatabase.execSQL("DROP TABLE t1"); } catch (SQLiteException e) { allowed = false; } finally { Loading Loading
core/jni/android_database_SQLiteConnection.cpp +3 −5 Original line number Diff line number Diff line Loading @@ -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; } Loading
core/tests/coretests/src/android/database/sqlite/SQLiteDatabaseTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -375,6 +375,8 @@ public class SQLiteDatabaseTest { assertEquals(3, s.getColumnInt(0)); } mDatabase.execSQL("DROP TABLE t1"); } catch (SQLiteException e) { allowed = false; } finally { Loading