Fix the xBestIndex method of the pragma virtual table so that it correctly
gives a higher cost to plans where the schema hidden parameter is unconstrained. Fix for the problem reported by [forum:/forumpost/85b6a8b6705fb77a|forum post 85b6a8b6705fb77a]. FossilOrigin-Name: bc516ff5202ee6e9834266bf755fe26e30ac557dcc7975ca7a06dfe33874fcd2
This commit is contained in:
@@ -264,5 +264,17 @@ do_execsql_test 5.0 {
|
||||
0 a {} 0 'abc' 0 1 b {} 0 -1 0 2 c {} 0 +4.0 0
|
||||
}
|
||||
|
||||
# 2024-03-24 https://sqlite.org/forum/forumpost/85b6a8b6705fb77a
|
||||
#
|
||||
reset_db
|
||||
do_execsql_test 6.0 {
|
||||
CREATE TABLE t1(a INT PRIMARY KEY, b INT);
|
||||
CREATE TABLE t2(c INT PRIMARY KEY, d INT REFERENCES t1);
|
||||
SELECT t.name, f."table", f."from", i.name, i.pk
|
||||
FROM pragma_table_list() AS t
|
||||
JOIN pragma_foreign_key_list(t.name, t.schema) AS f
|
||||
JOIN pragma_table_info(f."table", t.schema) AS i
|
||||
WHERE i.pk;
|
||||
} {t2 t1 d a 1}
|
||||
|
||||
finish_test
|
||||
|
||||
Reference in New Issue
Block a user