From: drh Date: Mon, 17 Sep 2001 20:48:30 +0000 (+0000) Subject: Enchanced transaction tests (CVS 253) X-Git-Tag: version-3.6.10~5793 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c73d1f5a550b66e13dd8cf0cdff661e8063685b6;p=thirdparty%2Fsqlite.git Enchanced transaction tests (CVS 253) FossilOrigin-Name: b30f2b5e150a219c374f88d13386dbda190ad9ed --- diff --git a/manifest b/manifest index 2a055b3cce..47dc8c4a4c 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sa\snew\scolumn\sin\sthe\sSQLITE_MASTER\stable\sto\srecord\sthe\sroot\spage\nnumber\sof\sprimary\skey\sindices.\s(CVS\s252) -D 2001-09-17T20:25:58 +C Enchanced\stransaction\stests\s(CVS\s253) +D 2001-09-17T20:48:30 F Makefile.in a7053596881af6f2590a816ad4eb8fbbf20724a7 F README 51f6a4e7408b34afa5bc1c0485f61b6a4efb6958 F VERSION 3861a21803fcd9eb92a403027b0da2bb7add4de1 @@ -69,7 +69,7 @@ F test/table.test 52fdca1632580fb638c7b7dd14f4d37ecc09f994 F test/tableapi.test 162840153191a91a7dce6395f2334f9aef713b37 F test/tclsqlite.test a57bb478d7e9f0b2c927f92e161f391e2896631a F test/tester.tcl 4d93d04bb43c5936f33d30df82d2801b519df74e -F test/trans.test 097ef854f8060bba2d53d7c4ac31eadf75342485 +F test/trans.test 997c8dcc15c479bc2cedc42220cf2d265e63d2a8 F test/update.test b320ea22899e80b32b4d21c54591eb7a6ba4d6bd F test/vacuum.test 8acf8669f3b627e54149b25165b034aa06c2432e F test/where.test 43d5ac94da3f3722375307f948884dc79b326a91 @@ -95,7 +95,7 @@ F www/opcode.tcl cb3a1abf8b7b9be9f3a228d097d6bf8b742c2b6f F www/sqlite.tcl cb0d23d8f061a80543928755ec7775da6e4f362f F www/tclsqlite.tcl 06f81c401f79a04f2c5ebfb97e7c176225c0aef2 F www/vdbe.tcl 0c8aaa529dd216ccbf7daaabd80985e413d5f9ad -P c67f6db681784f8511ccf208cde1c29d9ee73742 -R ec078dd1e4ad61f2004b7bba1a6425b5 +P 602ea4f9f641070592c788ce22859b849739b42e +R 9d47f76cff786cc38ee15dd98f00be51 U drh -Z 211dfb1506c70a3bba4b90be9db7543f +Z 49979fa205c7e6b07a58fef67abee514 diff --git a/manifest.uuid b/manifest.uuid index d6ba36ff65..85dad7300b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -602ea4f9f641070592c788ce22859b849739b42e \ No newline at end of file +b30f2b5e150a219c374f88d13386dbda190ad9ed \ No newline at end of file diff --git a/test/trans.test b/test/trans.test index 2947a47b0b..1566b15403 100644 --- a/test/trans.test +++ b/test/trans.test @@ -11,13 +11,12 @@ # This file implements regression tests for SQLite library. The # focus of this script is database locks. # -# $Id: trans.test,v 1.4 2001/09/16 00:13:28 drh Exp $ +# $Id: trans.test,v 1.5 2001/09/17 20:48:30 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl -if {0} { # Create several tables to work with. # @@ -40,7 +39,7 @@ do_test trans-1.1 { } } {I V X} do_test trans-1.9 { - sqlite altdb ${dbprefix}testdb + sqlite altdb test.db execsql {SELECT b FROM one ORDER BY a} altdb } {one two three} do_test trans-1.10 { @@ -95,49 +94,49 @@ do_test trans-3.2 { SELECT a FROM two ORDER BY a; } altdb} msg] lappend v $msg -} {0 {1 5 10}} +} {1 {database in use by another process}} do_test trans-3.3 { set v [catch {execsql { SELECT a FROM one ORDER BY a; } altdb} msg] lappend v $msg -} {1 {table one is locked}} +} {1 {database in use by another process}} do_test trans-3.4 { set v [catch {execsql { INSERT INTO one VALUES(4,'four'); }} msg] lappend v $msg } {0 {}} -do_test trans-3.2 { +do_test trans-3.5 { set v [catch {execsql { SELECT a FROM two ORDER BY a; } altdb} msg] lappend v $msg -} {0 {1 5 10}} -do_test trans-3.3 { +} {1 {database in use by another process}} +do_test trans-3.6 { set v [catch {execsql { SELECT a FROM one ORDER BY a; } altdb} msg] lappend v $msg -} {1 {table one is locked}} -do_test trans-3.5 { +} {1 {database in use by another process}} +do_test trans-3.7 { set v [catch {execsql { INSERT INTO two VALUES(4,'IV'); }} msg] lappend v $msg } {0 {}} -do_test trans-3.6 { +do_test trans-3.8 { set v [catch {execsql { SELECT a FROM two ORDER BY a; } altdb} msg] lappend v $msg -} {1 {table two is locked}} -do_test trans-3.7 { +} {1 {database in use by another process}} +do_test trans-3.9 { set v [catch {execsql { SELECT a FROM one ORDER BY a; } altdb} msg] lappend v $msg -} {1 {table one is locked}} +} {1 {database in use by another process}} do_test trans-3.10 { execsql {END TRANSACTION} } {} @@ -190,13 +189,13 @@ do_test trans-4.4 { SELECT a FROM two ORDER BY a; } altdb} msg] lappend v $msg -} {1 {table two is locked}} +} {1 {database in use by another process}} do_test trans-4.5 { set v [catch {execsql { SELECT a FROM one ORDER BY a; } altdb} msg] lappend v $msg -} {0 {1 2 3 4}} +} {1 {database in use by another process}} do_test trans-4.6 { set v [catch {execsql { BEGIN TRANSACTION; @@ -209,13 +208,13 @@ do_test trans-4.7 { SELECT a FROM two ORDER BY a; } altdb} msg] lappend v $msg -} {1 {table two is locked}} +} {1 {database in use by another process}} do_test trans-4.8 { set v [catch {execsql { SELECT a FROM one ORDER BY a; } altdb} msg] lappend v $msg -} {1 {table one is locked}} +} {1 {database in use by another process}} do_test trans-4.9 { set v [catch {execsql { END TRANSACTION; @@ -235,8 +234,7 @@ do_test trans-4.11 { } altdb} msg] lappend v $msg } {0 {1 2 3 4}} - -do_test trans-99.1 { +do_test trans-4.99 { altdb close execsql { DROP TABLE one; @@ -244,7 +242,35 @@ do_test trans-99.1 { } } {} +# Check out the commit/rollback behavior of the database +# +do_test trans-5.1 { + execsql {SELECT name FROM sqlite_master WHERE type='table' ORDER BY name} +} {} +do_test trans-5.2 { + execsql {BEGIN TRANSACTION} + execsql {SELECT name FROM sqlite_master WHERE type='table' ORDER BY name} +} {} +do_test trans-5.3 { + execsql {CREATE TABLE one(a text, b int)} + execsql {SELECT name FROM sqlite_master WHERE type='table' ORDER BY name} +} {one} +do_test trans-5.4 { + execsql {SELECT a,b FROM one ORDER BY b} +} {} +do_test trans-5.5 { + execsql {INSERT INTO one(a,b) VALUES('hello', 1)} + execsql {SELECT a,b FROM one ORDER BY b} +} {hello 1} +do_test trans-5.6 { + execsql {ROLLBACK} + execsql {SELECT name FROM sqlite_master WHERE type='table' ORDER BY name} +} {} +do_test trans-5.7 { + set v [catch { + execsql {SELECT a,b FROM one ORDER BY b} + } msg] + lappend v $msg +} {1 {no such table: one}} finish_test - -} ;# end if(gdbm and not windows)