mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-15 11:41:13 +03:00
Merge trunk changes into experimental branch.
FossilOrigin-Name: fd1e5cade04961c2f5438a1dfcc2e15eafb4503f
This commit is contained in:
@@ -677,5 +677,14 @@ do_test incrblob-8.7 {
|
||||
execsql {SELECT b FROM t1 WHERE a = 314159}
|
||||
} {etilqs}
|
||||
|
||||
# The following test case exposes an instance in the blob code where
|
||||
# an error message was set using a call similar to sqlite3_mprintf(zErr),
|
||||
# where zErr is an arbitrary string. This is no good if the string contains
|
||||
# characters that can be mistaken for printf() formatting directives.
|
||||
#
|
||||
do_test incrblob-9.1 {
|
||||
list [catch { db incrblob t1 "A tricky column name %s%s" 1 } msg] $msg
|
||||
} {1 {no such column: "A tricky column name %s%s"}}
|
||||
|
||||
|
||||
finish_test
|
||||
|
||||
@@ -1163,5 +1163,20 @@ ifcapable altertable {
|
||||
incr tn
|
||||
}
|
||||
|
||||
# The following test case exposes an instance in sqlite3_declare_vtab()
|
||||
# an error message was set using a call similar to sqlite3_mprintf(zErr),
|
||||
# where zErr is an arbitrary string. This is no good if the string contains
|
||||
# characters that can be mistaken for printf() formatting directives.
|
||||
#
|
||||
do_test vtab1-17.1 {
|
||||
execsql {
|
||||
PRAGMA writable_schema = 1;
|
||||
INSERT INTO sqlite_master VALUES(
|
||||
'table', 't3', 't3', 0, 'INSERT INTO "%s%s" VALUES(1)'
|
||||
);
|
||||
}
|
||||
catchsql { CREATE VIRTUAL TABLE t4 USING echo(t3); }
|
||||
} {1 {vtable constructor failed: t4}}
|
||||
|
||||
unset -nocomplain echo_module_begin_fail
|
||||
finish_test
|
||||
|
||||
@@ -23299,6 +23299,49 @@ do_test where7-2.1001.2 {
|
||||
OR a=91
|
||||
}
|
||||
} {2 22 23 28 54 80 91 scan 0 sort 0}
|
||||
finish_test
|
||||
|
||||
# test case for the performance regression fixed by
|
||||
# check-in 28ba6255282b on 2010-10-21 02:05:06
|
||||
#
|
||||
# The test case that follows is code from an actual
|
||||
# application with identifiers change and unused columns
|
||||
# remove.
|
||||
#
|
||||
do_test where7-3.1 {
|
||||
db eval {
|
||||
CREATE TABLE t301 (
|
||||
c8 INTEGER PRIMARY KEY,
|
||||
c6 INTEGER,
|
||||
c4 INTEGER,
|
||||
c7 INTEGER,
|
||||
FOREIGN KEY (c4) REFERENCES series(c4)
|
||||
);
|
||||
CREATE INDEX t301_c6 on t301(c6);
|
||||
CREATE INDEX t301_c4 on t301(c4);
|
||||
CREATE INDEX t301_c7 on t301(c7);
|
||||
|
||||
CREATE TABLE t302 (
|
||||
c1 INTEGER PRIMARY KEY,
|
||||
c8 INTEGER,
|
||||
c5 INTEGER,
|
||||
c3 INTEGER,
|
||||
c2 INTEGER,
|
||||
c4 INTEGER,
|
||||
FOREIGN KEY (c8) REFERENCES t301(c8)
|
||||
);
|
||||
CREATE INDEX t302_c3 on t302(c3);
|
||||
CREATE INDEX t302_c8_c3 on t302(c8, c3);
|
||||
CREATE INDEX t302_c5 on t302(c5);
|
||||
|
||||
EXPLAIN QUERY PLAN
|
||||
SELECT t302.c1
|
||||
FROM t302 JOIN t301 ON t302.c8 = t301.c8
|
||||
WHERE t302.c2 = 19571
|
||||
AND t302.c3 > 1287603136
|
||||
AND (t301.c4 = 1407449685622784
|
||||
OR t301.c8 = 1407424651264000)
|
||||
ORDER BY t302.c5 LIMIT 200;
|
||||
}
|
||||
} {0 1 {TABLE t301 VIA MULTI-INDEX UNION} 1 0 {TABLE t302 WITH INDEX t302_c8_c3} 0 0 {TABLE t301 WITH INDEX t301_c4} 0 0 {TABLE t301 USING PRIMARY KEY}}
|
||||
|
||||
finish_test
|
||||
|
||||
Reference in New Issue
Block a user