diff options
| author | The Android Open Source Project <initial-contribution@android.com> | 2009-03-02 22:54:33 -0800 |
|---|---|---|
| committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-02 22:54:33 -0800 |
| commit | 3dec7d563a2f3e1eb967ce2054a00b6620e3558c (patch) | |
| tree | aa3b0365c47cb3c1607c0dc76c8d32b4046fc287 /core/java/android/database | |
| parent | 15ab3eae2ec3d73b3e8aa60b33ae41445bf83f4b (diff) | |
| download | frameworks_base-3dec7d563a2f3e1eb967ce2054a00b6620e3558c.zip frameworks_base-3dec7d563a2f3e1eb967ce2054a00b6620e3558c.tar.gz frameworks_base-3dec7d563a2f3e1eb967ce2054a00b6620e3558c.tar.bz2 | |
auto import from //depot/cupcake/@137055
Diffstat (limited to 'core/java/android/database')
| -rw-r--r-- | core/java/android/database/sqlite/SQLiteDatabase.java | 4 | ||||
| -rw-r--r-- | core/java/android/database/sqlite/SQLiteStatement.java | 22 |
2 files changed, 24 insertions, 2 deletions
diff --git a/core/java/android/database/sqlite/SQLiteDatabase.java b/core/java/android/database/sqlite/SQLiteDatabase.java index 87bb277..2af080a 100644 --- a/core/java/android/database/sqlite/SQLiteDatabase.java +++ b/core/java/android/database/sqlite/SQLiteDatabase.java @@ -778,9 +778,9 @@ public class SQLiteDatabase extends SQLiteClosable { } /** - * Returns the maximum size the database may grow to. + * Returns the current database page size, in bytes. * - * @return the new maximum database size + * @return the database page size, in bytes */ public long getPageSize() { SQLiteStatement prog = null; diff --git a/core/java/android/database/sqlite/SQLiteStatement.java b/core/java/android/database/sqlite/SQLiteStatement.java index d169259..5889ad9 100644 --- a/core/java/android/database/sqlite/SQLiteStatement.java +++ b/core/java/android/database/sqlite/SQLiteStatement.java @@ -17,6 +17,7 @@ package android.database.sqlite; import android.os.SystemClock; +import android.util.Log; /** * A pre-compiled statement against a {@link SQLiteDatabase} that can be reused. @@ -26,6 +27,10 @@ import android.os.SystemClock; */ public class SQLiteStatement extends SQLiteProgram { + private static final String TAG = "SQLiteStatement"; + + private final String mSql; + /** * Don't use SQLiteStatement constructor directly, please use * {@link SQLiteDatabase#compileStatement(String)} @@ -34,6 +39,11 @@ public class SQLiteStatement extends SQLiteProgram */ /* package */ SQLiteStatement(SQLiteDatabase db, String sql) { super(db, sql); + if (SQLiteDebug.DEBUG_SQL_STATEMENTS) { + mSql = sql; + } else { + mSql = null; + } } /** @@ -50,6 +60,9 @@ public class SQLiteStatement extends SQLiteProgram acquireReference(); try { + if (SQLiteDebug.DEBUG_SQL_STATEMENTS) { + Log.v(TAG, "execute() for [" + mSql + "]"); + } native_execute(); if (logStats) { mDatabase.logTimeStat(false /* write */, startTime, SystemClock.elapsedRealtime()); @@ -77,6 +90,9 @@ public class SQLiteStatement extends SQLiteProgram acquireReference(); try { + if (SQLiteDebug.DEBUG_SQL_STATEMENTS) { + Log.v(TAG, "executeInsert() for [" + mSql + "]"); + } native_execute(); if (logStats) { mDatabase.logTimeStat(false /* write */, startTime, SystemClock.elapsedRealtime()); @@ -103,6 +119,9 @@ public class SQLiteStatement extends SQLiteProgram acquireReference(); try { + if (SQLiteDebug.DEBUG_SQL_STATEMENTS) { + Log.v(TAG, "simpleQueryForLong() for [" + mSql + "]"); + } long retValue = native_1x1_long(); if (logStats) { mDatabase.logTimeStat(false /* write */, startTime, SystemClock.elapsedRealtime()); @@ -129,6 +148,9 @@ public class SQLiteStatement extends SQLiteProgram acquireReference(); try { + if (SQLiteDebug.DEBUG_SQL_STATEMENTS) { + Log.v(TAG, "simpleQueryForString() for [" + mSql + "]"); + } String retValue = native_1x1_string(); if (logStats) { mDatabase.logTimeStat(false /* write */, startTime, SystemClock.elapsedRealtime()); |
