support doubly qualified identifiers

This commit is contained in:
Glauber Costa
2025-07-25 11:10:22 -05:00
parent 76cf3444c6
commit b5927dcfd5
8 changed files with 204 additions and 68 deletions

View File

@@ -78,3 +78,11 @@ passionate_robin
faithful_thomas
vibrant_miroslav
sparkling_gray}
do_execsql_test_on_specific_db {:memory:} doubly-qualified-delete {
create table test(col);
insert into test(col) values (1);
insert into test(col) values (2);
delete from test where main.test.col = 2;
select col from test;
} {1}

View File

@@ -47,6 +47,18 @@ do_execsql_test select-limit-0 {
SELECT id FROM users LIMIT 0;
} {}
do_execsql_test select-doubly-qualified {
SELECT main.users.id FROM users LIMIT 0;
} {}
do_execsql_test_error select-doubly-qualified-wrong-table {
SELECT main.wrong.id FROM users LIMIT 0;
} {.*}
do_execsql_test_error select-doubly-qualified-wrong-column {
SELECT main.users.wrong FROM users LIMIT 0;
} {.*}
# ORDER BY id here because sqlite uses age_idx here and we (yet) don't so force it to evaluate in ID order
do_execsql_test select-limit-true {
SELECT id FROM users ORDER BY id LIMIT true;