1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-01 06:27:03 +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

@ -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