1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Ensure fts4aux can handle a table name in single or double quotes as a constructor argument.

FossilOrigin-Name: 929d62e496bb36a3ee0e19ec4609329d79aaeddc
This commit is contained in:
dan
2011-02-05 15:47:12 +00:00
parent bb7e77c758
commit 2fe88b7ca4
4 changed files with 31 additions and 9 deletions

View File

@ -97,6 +97,7 @@ static int fts3auxConnectMethod(
memcpy((char *)p->pFts3Tab->zDb, zDb, nDb); memcpy((char *)p->pFts3Tab->zDb, zDb, nDb);
memcpy((char *)p->pFts3Tab->zName, zFts3, nFts3); memcpy((char *)p->pFts3Tab->zName, zFts3, nFts3);
sqlite3Fts3Dequote((char *)p->pFts3Tab->zName);
*ppVtab = (sqlite3_vtab *)p; *ppVtab = (sqlite3_vtab *)p;
return SQLITE_OK; return SQLITE_OK;

View File

@ -1,5 +1,5 @@
C Add\stest\scases\sfor\sfts4aux.\sFix\sa\sbug\saffecting\sfts3\stables\swith\smultiple\scolumns. C Ensure\sfts4aux\scan\shandle\sa\stable\sname\sin\ssingle\sor\sdouble\squotes\sas\sa\sconstructor\sargument.
D 2011-02-05T14:37:57.437 D 2011-02-05T15:47:12.471
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in de6498556d536ae60bb8bb10e8c1ba011448658c F Makefile.in de6498556d536ae60bb8bb10e8c1ba011448658c
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 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.c 5653c5654ac9b65bf3646af7e1d695c7e9b991a0
F ext/fts3/fts3.h 3a10a0af180d502cecc50df77b1b22df142817fe F ext/fts3/fts3.h 3a10a0af180d502cecc50df77b1b22df142817fe
F ext/fts3/fts3Int.h 945926ea4b6a686c3e9834640a252d9870b7191e 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_expr.c 5f49e0deaf723724b08100bb3ff40aab02ad0c93
F ext/fts3/fts3_hash.c 3c8f6387a4a7f5305588b203fa7c887d753e1f1c F ext/fts3/fts3_hash.c 3c8f6387a4a7f5305588b203fa7c887d753e1f1c
F ext/fts3/fts3_hash.h 8331fb2206c609f9fc4c4735b9ab5ad6137c88ec F ext/fts3/fts3_hash.h 8331fb2206c609f9fc4c4735b9ab5ad6137c88ec
@ -440,7 +440,7 @@ F test/fts3am.test 218aa6ba0dfc50c7c16b2022aac5c6be593d08d8
F test/fts3an.test a49ccadc07a2f7d646ec1b81bc09da2d85a85b18 F test/fts3an.test a49ccadc07a2f7d646ec1b81bc09da2d85a85b18
F test/fts3ao.test b83f99f70e9eec85f27d75801a974b3f820e01f9 F test/fts3ao.test b83f99f70e9eec85f27d75801a974b3f820e01f9
F test/fts3atoken.test 25c2070e1e8755d414bf9c8200427b277a9f99fa F test/fts3atoken.test 25c2070e1e8755d414bf9c8200427b277a9f99fa
F test/fts3aux1.test 0ec0280f21987e8772948986cd631a1b47a14dd8 F test/fts3aux1.test 719c35cbbcc04dde8e5a54a6f69851a0af9ed1f2
F test/fts3b.test e93bbb653e52afde110ad53bbd793f14fe7a8984 F test/fts3b.test e93bbb653e52afde110ad53bbd793f14fe7a8984
F test/fts3c.test fc723a9cf10b397fdfc2b32e73c53c8b1ec02958 F test/fts3c.test fc723a9cf10b397fdfc2b32e73c53c8b1ec02958
F test/fts3comp1.test a0f5b16a2df44dd0b15751787130af2183167c0c F test/fts3comp1.test a0f5b16a2df44dd0b15751787130af2183167c0c
@ -906,7 +906,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
P 3996f92a9aca9ac2628be003eca83c8f954c71de P dc511e60a65232a7087e12ff40b63506cf37a634
R d067548b9dfe7aa0061b3708612345ea R 8b6bef7500d37a03d9cad23f74319954
U dan U dan
Z d56728d64f4b8d9b1b136fd158651c94 Z 659706e533fac6825c1f6da67c2f77f1

View File

@ -1 +1 @@
dc511e60a65232a7087e12ff40b63506cf37a634 929d62e496bb36a3ee0e19ec4609329d79aaeddc

View 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 db close
forcedelete test.db 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] uplevel do_execsql_test $tn [list "EXPLAIN QUERY PLAN $sql ; $sql"] [list $r]
} }
do_plansql_test 4.2 { do_plansql_test 4.2 {
SELECT y FROM x2, terms WHERE y = term AND col = '*' SELECT y FROM x2, terms WHERE y = term AND col = '*'
} { } {
@ -437,5 +439,24 @@ do_plansql_test 4.5 {
a k l 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 finish_test