testing/sqlite3: Disable SELECT tests that require views

This commit is contained in:
Pekka Enberg
2025-07-07 14:38:02 +03:00
parent 38f3d213db
commit 3c968df0b2
7 changed files with 160 additions and 152 deletions

View File

@@ -374,10 +374,11 @@ do_test select9-3.4 {
execsql { CREATE INDEX i2 ON t2(d) }
cksort { SELECT a FROM t1 UNION ALL SELECT d FROM t2 ORDER BY 1 LIMIT 5 }
} {1 1 2 2 3 nosort}
do_test select9-3.5 {
execsql { CREATE VIEW v1 AS SELECT a FROM t1 UNION ALL SELECT d FROM t2 }
cksort { SELECT a FROM v1 ORDER BY 1 LIMIT 5 }
} {1 1 2 2 3 nosort}
# TODO: Views are not supported.
#do_test select9-3.5 {
# execsql { CREATE VIEW v1 AS SELECT a FROM t1 UNION ALL SELECT d FROM t2 }
# cksort { SELECT a FROM v1 ORDER BY 1 LIMIT 5 }
#} {1 1 2 2 3 nosort}
do_test select9-3.X {
execsql {
DROP INDEX i1;
@@ -403,15 +404,15 @@ do_test select9-4.4 {
execsql { CREATE INDEX i2 ON t2(d) }
cksort { SELECT a FROM t1 UNION SELECT d FROM t2 ORDER BY 1 LIMIT 5 }
} {1 2 3 4 5 nosort}
do_test select9-4.5 {
execsql { CREATE VIEW v1 AS SELECT a FROM t1 UNION SELECT d FROM t2 }
cksort { SELECT a FROM v1 ORDER BY 1 LIMIT 5 }
} {1 2 3 4 5 sort}
#do_test select9-4.5 {
# execsql { CREATE VIEW v1 AS SELECT a FROM t1 UNION SELECT d FROM t2 }
# cksort { SELECT a FROM v1 ORDER BY 1 LIMIT 5 }
#} {1 2 3 4 5 sort}
do_test select9-4.X {
execsql {
DROP INDEX i1;
DROP INDEX i2;
DROP VIEW v1;
# DROP VIEW v1;
}
} {}
@@ -423,32 +424,32 @@ do_test select9-4.X {
#
# For additional information.
#
do_test select9-5.1 {
db eval {
CREATE TABLE t51(x, y);
CREATE TABLE t52(x, y);
CREATE VIEW v5 as
SELECT x, y FROM t51
UNION ALL
SELECT x, y FROM t52;
CREATE INDEX t51x ON t51(x);
CREATE INDEX t52x ON t52(x);
EXPLAIN QUERY PLAN
SELECT * FROM v5 WHERE x='12345' ORDER BY y;
}
} {~/SCAN/} ;# Uses indices with "*"
do_test select9-5.2 {
db eval {
EXPLAIN QUERY PLAN
SELECT x, y FROM v5 WHERE x='12345' ORDER BY y;
}
} {~/SCAN/} ;# Uses indices with "x, y"
do_test select9-5.3 {
db eval {
EXPLAIN QUERY PLAN
SELECT x, y FROM v5 WHERE +x='12345' ORDER BY y;
}
} {/SCAN/} ;# Full table scan if the "+x" prevents index usage.
#do_test select9-5.1 {
# db eval {
# CREATE TABLE t51(x, y);
# CREATE TABLE t52(x, y);
# CREATE VIEW v5 as
# SELECT x, y FROM t51
# UNION ALL
# SELECT x, y FROM t52;
# CREATE INDEX t51x ON t51(x);
# CREATE INDEX t52x ON t52(x);
# EXPLAIN QUERY PLAN
# SELECT * FROM v5 WHERE x='12345' ORDER BY y;
# }
#} {~/SCAN/} ;# Uses indices with "*"
#do_test select9-5.2 {
# db eval {
# EXPLAIN QUERY PLAN
# SELECT x, y FROM v5 WHERE x='12345' ORDER BY y;
# }
#} {~/SCAN/} ;# Uses indices with "x, y"
#do_test select9-5.3 {
# db eval {
# EXPLAIN QUERY PLAN
# SELECT x, y FROM v5 WHERE +x='12345' ORDER BY y;
# }
#} {/SCAN/} ;# Full table scan if the "+x" prevents index usage.
# 2013-07-09: Ticket [490a4b7235624298]:
# "WHERE 0" on the first element of a UNION causes an assertion fault