summaryrefslogtreecommitdiffstats
path: root/third_party/sqlite/test/tkt2409.test
diff options
context:
space:
mode:
authormdm@chromium.org <mdm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-18 18:27:25 +0000
committermdm@chromium.org <mdm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-18 18:27:25 +0000
commit997e22224e1062a4cd39373057a68879a1d7a3ac (patch)
treea90a9ce4272fc78f2459b1b2c78b52a3f6d4e5d3 /third_party/sqlite/test/tkt2409.test
parent0d683c611a18dc6ea0e99f38c73b4fb96611041f (diff)
downloadchromium_src-997e22224e1062a4cd39373057a68879a1d7a3ac.zip
chromium_src-997e22224e1062a4cd39373057a68879a1d7a3ac.tar.gz
chromium_src-997e22224e1062a4cd39373057a68879a1d7a3ac.tar.bz2
Update sqlite to version 3.6.18, porting our patches.
Hopefully this will help to address some valgrind issues. BUG=none TEST=none git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26596 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/sqlite/test/tkt2409.test')
-rw-r--r--third_party/sqlite/test/tkt2409.test37
1 files changed, 24 insertions, 13 deletions
diff --git a/third_party/sqlite/test/tkt2409.test b/third_party/sqlite/test/tkt2409.test
index 54e8265..9ac6542 100644
--- a/third_party/sqlite/test/tkt2409.test
+++ b/third_party/sqlite/test/tkt2409.test
@@ -16,7 +16,7 @@
# any statement other than a COMMIT, an I/O error is returned instead
# of SQLITE_BUSY.
#
-# $Id: tkt2409.test,v 1.3 2007/09/12 17:01:45 danielk1977 Exp $
+# $Id: tkt2409.test,v 1.6 2008/08/28 17:46:19 drh Exp $
# Test Outline:
#
@@ -25,6 +25,11 @@
# Verify that the transaction is automatically rolled back
# and SQLITE_IOERR_BLOCKED is returned
#
+# UPDATE: As of the pcache modifications, failing to upgrade to
+# an exclusive lock when attempting a cache-spill is no longer an
+# error. The pcache module allocates more space and keeps working
+# in memory if this occurs.
+#
# tkt-2409-2.*: Cause a cache-spill while updating the change-counter
# during a database COMMIT. Verify that the transaction is not
# rolled back and SQLITE_BUSY is returned.
@@ -32,9 +37,14 @@
# tkt-2409-3.*: Similar to 2409-1.*, but using many INSERT statements
# within a transaction instead of just one.
#
+# UPDATE: Again, pcache now just keeps working in main memory.
+#
# tkt-2409-4.*: Similar to 2409-1.*, but rig it so that the
# INSERT statement starts a statement transaction. Verify that
-# SQLOTE_BUSY is returned and the transaction is not rolled back.
+# SQLITE_BUSY is returned and the transaction is not rolled back.
+#
+# UPDATE: This time, SQLITE_BUSY is not returned. pcache just uses
+# more malloc()'d memory.
#
set testdir [file dirname $argv0]
@@ -86,11 +96,11 @@ do_test tkt2409-1.1 {
BEGIN;
INSERT INTO t1 VALUES($::zShort, $::zLong);
}
-} {1 {disk I/O error}}
+} {0 {}}
do_test tkt2409-1.2 {
sqlite3_errcode $::DB
-} {SQLITE_IOERR+11}
+} {SQLITE_OK}
# Check the integrity of the cache.
#
@@ -103,8 +113,7 @@ integrity_check tkt2409-1.3
do_test tkt2409-1.4 {
unread_lock_db
catchsql { ROLLBACK }
-} {1 {cannot rollback - no transaction is active}}
-
+} {0 {}}
set ::zShort [string repeat 0123456789 1]
set ::zLong [string repeat 0123456789 1500]
@@ -139,6 +148,7 @@ do_test tkt2409-2.3 {
}
} {0 {}}
+
do_test tkt2409-3.1 {
db close
set ::DB [sqlite3 db test.db; sqlite3_connection_pointer db]
@@ -154,11 +164,11 @@ do_test tkt2409-3.1 {
BEGIN;
INSERT INTO t1 SELECT $::zShort, $::zLong;
}
-} {1 {database is locked}}
+} {0 {}}
do_test tkt2409-3.2 {
sqlite3_errcode $::DB
-} {SQLITE_BUSY}
+} {SQLITE_OK}
# Check the integrity of the cache.
#
@@ -172,8 +182,9 @@ do_test tkt2409-3.4 {
unread_lock_db
catchsql { ROLLBACK }
} {0 {}}
+integrity_check tkt2409-3.5
-
+expr {srand(1)}
do_test tkt2409-4.1 {
execsql {
PRAGMA cache_size=20;
@@ -197,11 +208,11 @@ do_test tkt2409-4.1 {
read_lock_db
execsql BEGIN
catchsql $sql
-} {1 {disk I/O error}}
+} {0 {}}
do_test tkt2409-4.2 {
sqlite3_errcode $::DB
-} {SQLITE_IOERR+11}
+} {SQLITE_OK}
# Check the integrity of the cache.
#
@@ -209,8 +220,8 @@ integrity_check tkt2409-4.3
do_test tkt2409-4.4 {
catchsql { ROLLBACK }
-} {1 {cannot rollback - no transaction is active}}
-
+} {0 {}}
+integrity_check tkt2409-4.5
unread_lock_db
db2 close