diff options
author | Vasu Nori <vnori@google.com> | 2010-05-25 15:21:18 -0700 |
---|---|---|
committer | Vasu Nori <vnori@google.com> | 2010-05-26 10:14:41 -0700 |
commit | d72ec5f29d49ce1841b65044c6144fef7335bdec (patch) | |
tree | f0f9b0eda2c98bf9fb23b855698a93473d655913 /core/jni/android_database_SQLiteStatement.cpp | |
parent | fea6f6dcb70e3fa7f60cab970ed444b5e5e2a3fa (diff) | |
download | frameworks_base-d72ec5f29d49ce1841b65044c6144fef7335bdec.zip frameworks_base-d72ec5f29d49ce1841b65044c6144fef7335bdec.tar.gz frameworks_base-d72ec5f29d49ce1841b65044c6144fef7335bdec.tar.bz2 |
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
Diffstat (limited to 'core/jni/android_database_SQLiteStatement.cpp')
-rw-r--r-- | core/jni/android_database_SQLiteStatement.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/jni/android_database_SQLiteStatement.cpp b/core/jni/android_database_SQLiteStatement.cpp index ff2ed5d..0341e0b 100644 --- a/core/jni/android_database_SQLiteStatement.cpp +++ b/core/jni/android_database_SQLiteStatement.cpp @@ -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)); } |