]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Test cases for sqlite3_analyzer and sqldiff. Fix a problem with
authordrh <drh@noemail.net>
Mon, 11 May 2015 17:46:14 +0000 (17:46 +0000)
committerdrh <drh@noemail.net>
Mon, 11 May 2015 17:46:14 +0000 (17:46 +0000)
sqlite3_analyzer related to the renaming of the initialization routine.

FossilOrigin-Name: 85a4a46c3bb9fd8124969c9e975086c795113b7e

manifest
manifest.uuid
test/analyzer1.test [new file with mode: 0644]
test/sqldiff1.test [new file with mode: 0644]
tool/spaceanal.tcl

index fbbd1c1ab5a8fc12886d65e3374fc3f8412e5fec..984c3ea4b564b7288cad402514c1ea4493e83c6b 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\sminor\sMakefile\stypos.\s\sImprove\sconsistency\sof\sMSVC\smakefile.\s\sAdd\snew\stargets\sto\sclean.
-D 2015-05-11T16:27:33.778
+C Test\scases\sfor\ssqlite3_analyzer\sand\ssqldiff.\s\sFix\sa\sproblem\swith\s\nsqlite3_analyzer\srelated\sto\sthe\srenaming\sof\sthe\sinitialization\sroutine.
+D 2015-05-11T17:46:14.438
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in edfc69769e613a6359c42c06ea1d42c3bece1736
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -334,6 +334,7 @@ F test/analyzeC.test 555a6cc388b9818b6eda6df816f01ce0a75d3a93
 F test/analyzeD.test 08f9d0bee4e118a66fff3a32d02dbe0ee0a2b594
 F test/analyzeE.test 8684e8ac5722fb97c251887ad97e5d496a98af1d
 F test/analyzeF.test 7ccd7a04f7d3061bde1a8a4dacc4792edccf6bf2
+F test/analyzer1.test 0f803d7d466d7c3e027dfe18bc412b634999995b
 F test/async.test 1d0e056ba1bb9729283a0f22718d3a25e82c277b
 F test/async2.test c0a9bd20816d7d6a2ceca7b8c03d3d69c28ffb8b
 F test/async3.test d73a062002376d7edc1fe3edff493edbec1fc2f7
@@ -901,6 +902,7 @@ F test/speed4p.explain 6b5f104ebeb34a038b2f714150f51d01143e59aa
 F test/speed4p.test 0e51908951677de5a969b723e03a27a1c45db38b
 F test/speedtest1.c 2b416dca3a155fcaa849540b2e7fc1df12896c23
 F test/spellfix.test 24f676831acddd2f4056a598fd731a72c6311f49
+F test/sqldiff1.test 4b6a8cb8619b970ac4869d3a9ec221cd314d6cae
 F test/sqllimits1.test e05786eaed7950ff6a2d00031d001d8a26131e68
 F test/stat.test 8de91498c99f5298b303f70f1d1f3b9557af91bf
 F test/statfault.test f525a7bf633e50afd027700e9a486090684b1ac1
@@ -1238,7 +1240,7 @@ F tool/showstat4.c 9515faa8ec176599d4a8288293ba8ec61f7b728a
 F tool/showwal.c 85cb36d4fe3e93e2fbd63e786e0d1ce42d0c4fad
 F tool/soak1.tcl 8d407956e1a45b485a8e072470a3e629a27037fe
 F tool/space_used.tcl f714c41a59e326b8b9042f415b628b561bafa06b
-F tool/spaceanal.tcl d5a09620c66a6c144576cb9d2bdfa9a6fbe362a5
+F tool/spaceanal.tcl 713c587a057334de42c41ad9566f10e255d3ad27
 F tool/speedtest.tcl 06c76698485ccf597b9e7dbb1ac70706eb873355
 F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
@@ -1256,7 +1258,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 1b83f2e7ddfdb488e732731f7a184d37edcad5af
-R 9144e728928711a4d1e8e355f9e1d47b
-U mistachkin
-Z 7fbb5f9bc605e2a68894de61a25f2ba0
+P f84fbe98994c602de6c0b242dcbad3ab77298425
+R 07df1d707f9f5d9656bc9195b802cb19
+U drh
+Z cfe7ea3673b7464899013ab57623434c
index 23170d8f68e89d41e70eda39617e5da01a821e3e..37ee30395b4e697145785eb712cdef624c0fb90e 100644 (file)
@@ -1 +1 @@
-f84fbe98994c602de6c0b242dcbad3ab77298425
\ No newline at end of file
+85a4a46c3bb9fd8124969c9e975086c795113b7e
\ No newline at end of file
diff --git a/test/analyzer1.test b/test/analyzer1.test
new file mode 100644 (file)
index 0000000..9eac241
--- /dev/null
@@ -0,0 +1,39 @@
+# 2015-05-11
+#
+# The author disclaims copyright to this source code.  In place of
+# a legal notice, here is a blessing:
+#
+#    May you do good and not evil.
+#    May you find forgiveness for yourself and forgive others.
+#    May you share freely, never taking more than you give.
+#
+#***********************************************************************
+#
+# Quick tests for the sqlite3_analyzer tool
+#
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+if {$tcl_platform(platform)=="windows"} {
+  set PROG "sqlite3_analyzer.exe"
+} else {
+  set PROG "./sqlite3_analyzer"
+}
+db close
+forcedelete test.db test.db-journal test.db-wal
+sqlite3 db test.db
+
+do_test analyzer1-1.0 {
+  db eval {
+    CREATE TABLE t1(a INTEGER PRIMARY KEY, b);
+    CREATE TABLE t2(a INT PRIMARY KEY, b) WITHOUT ROWID;
+    WITH RECURSIVE c(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM c WHERE x<250)
+    INSERT INTO t1(a,b) SELECT x, randomblob(200) FROM c;
+    INSERT INTO t2(a,b) SELECT a, b FROM t1;
+  }
+  set line "exec $PROG test.db"
+  unset -nocomplain ::MSG
+  catch {eval $line} ::MSG
+} {0}
+do_test analyzer1-1.1 {
+  regexp {^/\*\* Disk-Space Utilization.*COMMIT;\W*$} $::MSG
+} {1}
diff --git a/test/sqldiff1.test b/test/sqldiff1.test
new file mode 100644 (file)
index 0000000..4f4cd70
--- /dev/null
@@ -0,0 +1,57 @@
+# 2015-05-11
+#
+# The author disclaims copyright to this source code.  In place of
+# a legal notice, here is a blessing:
+#
+#    May you do good and not evil.
+#    May you find forgiveness for yourself and forgive others.
+#    May you share freely, never taking more than you give.
+#
+#***********************************************************************
+#
+# Quick tests for the sqldiff tool
+#
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+if {$tcl_platform(platform)=="windows"} {
+  set PROG "sqldiff.exe"
+} else {
+  set PROG "./sqldiff"
+}
+db close
+forcedelete test.db test2.db
+sqlite3 db test.db
+
+do_test sqldiff-1.0 {
+  db eval {
+    CREATE TABLE t1(a INTEGER PRIMARY KEY, b);
+    CREATE TABLE t2(a INT PRIMARY KEY, b) WITHOUT ROWID;
+    WITH RECURSIVE c(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM c WHERE x<100)
+    INSERT INTO t1(a,b) SELECT x, printf('abc-%d-xyz',x) FROM c;
+    INSERT INTO t2(a,b) SELECT a, b FROM t1;
+  }
+  db backup test2.db
+  db eval {
+    ATTACH 'test2.db' AS x2;
+    DELETE FROM x2.t1 WHERE a=49;
+    DELETE FROM x2.t2 WHERE a=48;
+    INSERT INTO x2.t1(a,b) VALUES(1234,'hello');
+    INSERT INTO x2.t2(a,b) VALUES(50.5,'xyzzy');
+    CREATE TABLE x2.t3(a,b,c);
+    INSERT INTO x2.t3 VALUES(111,222,333);
+    CREATE TABLE main.t4(x,y,z);
+    INSERT INTO t4 SELECT * FROM t3;
+  }
+  set line "exec $PROG test.db test2.db"
+  unset -nocomplain ::MSG
+  catch {eval $line} ::MSG
+} {0}
+do_test sqldiff-1.1 {
+  set ::MSG
+} {DELETE FROM t1 WHERE a=49;
+INSERT INTO t1(a,b) VALUES(1234,'hello');
+DELETE FROM t2 WHERE a=48;
+INSERT INTO t2(a,b) VALUES(50.5,'xyzzy');
+CREATE TABLE t3(a,b,c);
+INSERT INTO t3(rowid,a,b,c) VALUES(1,111,222,333);
+DROP TABLE t4;}
index 516d2824451b4ac73b651105390a574c08d6a10c..cd3785bd7d195973aec52da10b03152d2d1ca68f 100644 (file)
@@ -88,7 +88,6 @@ if {[catch {sqlite3 db $file_to_analyze -uri 1} msg]} {
   puts stderr "error trying to open $file_to_analyze: $msg"
   exit 1
 }
-register_dbstat_vtab db
 
 db eval {SELECT count(*) FROM sqlite_master}
 set pageSize [expr {wide([db one {PRAGMA page_size}])}]