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
This commit is contained in:
Vasu Nori
2010-05-25 15:21:18 -07:00
parent fea6f6dcb7
commit d72ec5f29d

View File

@@ -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));
}