]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Ensure fts4aux can handle a table name in single or double quotes as a constructor...
authordan <dan@noemail.net>
Sat, 5 Feb 2011 15:47:12 +0000 (15:47 +0000)
committerdan <dan@noemail.net>
Sat, 5 Feb 2011 15:47:12 +0000 (15:47 +0000)
FossilOrigin-Name: 929d62e496bb36a3ee0e19ec4609329d79aaeddc

ext/fts3/fts3_aux.c
manifest
manifest.uuid
test/fts3aux1.test

index eef8e8ae255c1761112370018ad54805c61475b6..90190df2c550f94cad4f0855c38848ea3c65511d 100644 (file)
@@ -97,6 +97,7 @@ static int fts3auxConnectMethod(
 
   memcpy((char *)p->pFts3Tab->zDb, zDb, nDb);
   memcpy((char *)p->pFts3Tab->zName, zFts3, nFts3);
+  sqlite3Fts3Dequote((char *)p->pFts3Tab->zName);
 
   *ppVtab = (sqlite3_vtab *)p;
   return SQLITE_OK;
index 029fb75c71e3055cfac8d3431031be5323898070..89e3b7b07a1e5400126e95f61420515005dd1bc2 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Add\stest\scases\sfor\sfts4aux.\sFix\sa\sbug\saffecting\sfts3\stables\swith\smultiple\scolumns.
-D 2011-02-05T14:37:57.437
+C Ensure\sfts4aux\scan\shandle\sa\stable\sname\sin\ssingle\sor\sdouble\squotes\sas\sa\sconstructor\sargument.
+D 2011-02-05T15:47:12.471
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in de6498556d536ae60bb8bb10e8c1ba011448658c
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -64,7 +64,7 @@ F ext/fts3/README.txt 8c18f41574404623b76917b9da66fcb0ab38328d
 F ext/fts3/fts3.c 5653c5654ac9b65bf3646af7e1d695c7e9b991a0
 F ext/fts3/fts3.h 3a10a0af180d502cecc50df77b1b22df142817fe
 F ext/fts3/fts3Int.h 945926ea4b6a686c3e9834640a252d9870b7191e
-F ext/fts3/fts3_aux.c bd415ad320f9174ea2de776877953116480ff9ff
+F ext/fts3/fts3_aux.c 1b663dd269ea4c5e816633d9a3378ed30b004879
 F ext/fts3/fts3_expr.c 5f49e0deaf723724b08100bb3ff40aab02ad0c93
 F ext/fts3/fts3_hash.c 3c8f6387a4a7f5305588b203fa7c887d753e1f1c
 F ext/fts3/fts3_hash.h 8331fb2206c609f9fc4c4735b9ab5ad6137c88ec
@@ -440,7 +440,7 @@ F test/fts3am.test 218aa6ba0dfc50c7c16b2022aac5c6be593d08d8
 F test/fts3an.test a49ccadc07a2f7d646ec1b81bc09da2d85a85b18
 F test/fts3ao.test b83f99f70e9eec85f27d75801a974b3f820e01f9
 F test/fts3atoken.test 25c2070e1e8755d414bf9c8200427b277a9f99fa
-F test/fts3aux1.test 0ec0280f21987e8772948986cd631a1b47a14dd8
+F test/fts3aux1.test 719c35cbbcc04dde8e5a54a6f69851a0af9ed1f2
 F test/fts3b.test e93bbb653e52afde110ad53bbd793f14fe7a8984
 F test/fts3c.test fc723a9cf10b397fdfc2b32e73c53c8b1ec02958
 F test/fts3comp1.test a0f5b16a2df44dd0b15751787130af2183167c0c
@@ -906,7 +906,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
-P 3996f92a9aca9ac2628be003eca83c8f954c71de
-R d067548b9dfe7aa0061b3708612345ea
+P dc511e60a65232a7087e12ff40b63506cf37a634
+R 8b6bef7500d37a03d9cad23f74319954
 U dan
-Z d56728d64f4b8d9b1b136fd158651c94
+Z 659706e533fac6825c1f6da67c2f77f1
index a83e1ff40b5b39526eb306de34a180b21fe0fce3..fa38ef0c73d398ee0b39d469062e6fd4d65e0df5 100644 (file)
@@ -1 +1 @@
-dc511e60a65232a7087e12ff40b63506cf37a634
\ No newline at end of file
+929d62e496bb36a3ee0e19ec4609329d79aaeddc
\ No newline at end of file
index d021e9d19dfdfa590e2ae1ae29dd7b166731e033..5359521ab7aa56d4e7fa63161c428401ebcea418 100644 (file)
@@ -381,6 +381,9 @@ do_catchsql_test 3.3.3 {
 
 
 #-------------------------------------------------------------------------
+# The following tests - fts4aux-4.* - test that joins work with fts4aux
+# tables. And that fts4aux provides reasonably sane cost information via
+# xBestIndex to the query planner.
 #
 db close
 forcedelete test.db
@@ -404,7 +407,6 @@ proc do_plansql_test {tn sql r} {
   uplevel do_execsql_test $tn [list "EXPLAIN QUERY PLAN $sql ; $sql"] [list $r]
 }
 
-
 do_plansql_test 4.2 {
   SELECT y FROM x2, terms WHERE y = term AND col = '*'
 } {
@@ -437,5 +439,24 @@ do_plansql_test 4.5 {
   a k l
 }
 
+#-------------------------------------------------------------------------
+# The following tests check that fts4aux can handle an fts table with an
+# odd name (one that requires quoting for use in SQL statements). And that
+# the argument to the fts4aux constructor is properly dequoted before use.
+#
+#
+do_execsql_test 5.1 {
+  CREATE VIRTUAL TABLE "abc '!' def" USING fts4(x, y);
+  INSERT INTO "abc '!' def" VALUES('XX', 'YY');
+
+  CREATE VIRTUAL TABLE terms3 USING fts4aux("abc '!' def");
+  SELECT * FROM terms3;
+} {xx * 1 1 xx 0 1 1 yy * 1 1 yy 1 1 1}
+
+do_execsql_test 5.2 {
+  CREATE VIRTUAL TABLE "%%^^%%" USING fts4aux('abc ''!'' def');
+  SELECT * FROM "%%^^%%";
+} {xx * 1 1 xx 0 1 1 yy * 1 1 yy 1 1 1}
+
 
 finish_test