From: dan Date: Fri, 23 Mar 2012 15:38:43 +0000 (+0000) Subject: Add a test to verify that sqlite3_total_changes() works with incr-merge operations. X-Git-Tag: mountain-lion~3^2~9^2~23 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ba512b0b3d10e4b5b080f81fce2796662a41c207;p=thirdparty%2Fsqlite.git Add a test to verify that sqlite3_total_changes() works with incr-merge operations. FossilOrigin-Name: 1c72cecc6bf5be2a5c04ad6214a6bac22a29f860 --- diff --git a/manifest b/manifest index 23ef80f398..aa8e07fecd 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Remove\san\sincorrect\sassert()\sstatement.\sFix\sa\sconst-related\swarning. -D 2012-03-23T14:38:49.144 +C Add\sa\stest\sto\sverify\sthat\ssqlite3_total_changes()\sworks\swith\sincr-merge\soperations. +D 2012-03-23T15:38:43.298 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 2f37e468503dbe79d35c9f6dffcf3fae1ae9ec20 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -498,7 +498,7 @@ F test/fts3sort.test 95be0b19d7e41c44b29014f13ea8bddd495fd659 F test/fts4aa.test 6e7f90420b837b2c685f3bcbe84c868492d40a68 F test/fts4content.test 17b2360f7d1a9a7e5aa8022783f5c5731b6dfd4f F test/fts4langid.test 24a6e41063b416bbdf371ff6b4476fa41c194aa7 -F test/fts4merge.test 7cea27240f68596bc1b02117409d34a3f7e8c3ec +F test/fts4merge.test 120e0baf17a01f0cb696d6f6f9b6506e1587ef90 F test/fts4merge2.test 5faa558d1b672f82b847d2a337465fa745e46891 F test/fts4merge3.test e0e21332f592fc003fcab112928ea891407d83cb F test/func.test 6c5ce11e3a0021ca3c0649234e2d4454c89110ca @@ -997,7 +997,7 @@ F tool/tostr.awk e75472c2f98dd76e06b8c9c1367f4ab07e122d06 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f F tool/warnings-clang.sh 9f406d66e750e8ac031c63a9ef3248aaa347ef2a F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381 -P 02a8e4236cf2c1c74b3c6537be1b5f197175a32e -R 83c8ccbccee5d73d8055d59ab542cc92 +P 96ed47493b3d46344fd2105642f31690aee06674 +R f6fdda04671e81d1436014dc3e6ce1ef U dan -Z 9064fda8da51ce4c65bcaaf3383b8b6d +Z ca34b2031de3681fa84c177cb5bd2b1e diff --git a/manifest.uuid b/manifest.uuid index e3a12a140a..2ffc66650d 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -96ed47493b3d46344fd2105642f31690aee06674 \ No newline at end of file +1c72cecc6bf5be2a5c04ad6214a6bac22a29f860 \ No newline at end of file diff --git a/test/fts4merge.test b/test/fts4merge.test index 887888f899..422d585cbe 100644 --- a/test/fts4merge.test +++ b/test/fts4merge.test @@ -287,4 +287,44 @@ do_test 6.1 { } } {} +#------------------------------------------------------------------------- +# Test cases 7.* +# +# Test that the value returned by sqlite3_total_changes() increases by +# 1 following a no-op "merge=A,B", or by more than 1 if actual work is +# performed. +# +do_test 7.0 { + reset_db + fts3_build_db_1 1000 +} {} + +do_execsql_test 7.1 { + SELECT level, group_concat(idx, ' ') FROM t1_segdir GROUP BY level +} { + 0 {0 1 2 3 4 5 6 7} + 1 {0 1 2 3 4 5 6 7 8 9 10 11 12 13} + 2 {0 1 2} +} +do_test 7.2 { + set x [db total_changes] + execsql { INSERT INTO t1(t1) VALUES('merge=2,10') } + expr { ([db total_changes] - $x)>1 } +} {1} +do_test 7.3 { + set x [db total_changes] + execsql { INSERT INTO t1(t1) VALUES('merge=200,10') } + expr { ([db total_changes] - $x)>1 } +} {1} +do_test 7.4 { + set x [db total_changes] + execsql { INSERT INTO t1(t1) VALUES('merge=200,10') } + expr { ([db total_changes] - $x)>1 } +} {0} +do_test 7.5 { + set x [db total_changes] + execsql { INSERT INTO t1(t1) VALUES('merge=200,10') } + expr { ([db total_changes] - $x)>1 } +} {0} + finish_test