CoolFace
Modelpublic

AryaWu/sqlite

sourceHugging Faceupdated 9mo agoView on Hugging Face
0likes
tkt-d82e3f3721.test86 linesDownload Raw Back to test
1# 2009 September 22#3# The author disclaims copyright to this source code.  In place of4# a legal notice, here is a blessing:5#6#    May you do good and not evil.7#    May you find forgiveness for yourself and forgive others.8#    May you share freely, never taking more than you give.9#10#***********************************************************************11# This file implements regression tests for SQLite library.12#13# This file implements tests to verify that ticket [d82e3f3721] has been14# fixed.  15#16 17set testdir [file dirname $argv0]18source $testdir/tester.tcl19 20ifcapable !compound {21  finish_test22  return23}24 25do_test tkt-d82e3-1.1 {26  db eval {27    CREATE TABLE t1(a INTEGER PRIMARY KEY AUTOINCREMENT, b);28    INSERT INTO t1 VALUES(null,'abc');29    INSERT INTO t1 VALUES(null,'def');30    DELETE FROM t1;31    INSERT INTO t1 VALUES(null,'ghi');32    SELECT * FROM t1;33  }34} {3 ghi}35do_test tkt-d82e3-1.2 {36  db eval {37    CREATE TEMP TABLE t2(a INTEGER PRIMARY KEY AUTOINCREMENT, b);38    INSERT INTO t2 VALUES(null,'jkl');39    INSERT INTO t2 VALUES(null,'mno');40    DELETE FROM t2;41    INSERT INTO t2 VALUES(null,'pqr');42    SELECT * FROM t2;43  }44} {3 pqr}45do_test tkt-d82e3-1.3 {46  db eval {47    SELECT 'main', * FROM main.sqlite_sequence48    UNION ALL49    SELECT 'temp', * FROM temp.sqlite_sequence50    ORDER BY 251  }52} {main t1 3 temp t2 3}53do_test tkt-d82e3-1.4 {54  db eval {55    VACUUM;56    SELECT 'main', * FROM main.sqlite_sequence57    UNION ALL58    SELECT 'temp', * FROM temp.sqlite_sequence59    ORDER BY 260  }61} {main t1 3 temp t2 3}62 63sqlite3 db2 test.db64do_test tkt-d82e3-2.1 {65  db eval {66    CREATE TEMP TABLE t3(x);67    INSERT INTO t3 VALUES(1);68  }69  db2 eval {70    CREATE TABLE t3(y,z);71    INSERT INTO t3 VALUES(8,9);72  }73  db eval {74    SELECT * FROM temp.t3 JOIN main.t3;75  }76} {1 8 9}77do_test tkt-d82e3-2.2 {78  db eval {79    VACUUM;80    SELECT * FROM temp.t3 JOIN main.t3;81  }82} {1 8 9}83db2 close84 85finish_test86