mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-08 18:54:21 +01:00
Add update tcl tests for LIMIT clauses on update queries
This commit is contained in:
@@ -52,6 +52,27 @@ do_execsql_test_on_specific_db {:memory:} update-all-many {
|
||||
select COUNT(*) from temp where a = 1234234234234234;
|
||||
} {8}
|
||||
|
||||
do_execsql_test_on_specific_db {:memory:} update-limit {
|
||||
create table temp (a,b,c);
|
||||
insert into temp values (1,22,33),(1,22,33),(1,22,33),(1,22,33),(1,22,33),(1,22,33),(1,22,33),(1,22,33);
|
||||
update temp set a = 44 LIMIT 3;
|
||||
select COUNT(*) from temp where a = 44;
|
||||
} {3}
|
||||
|
||||
do_execsql_test_on_specific_db {:memory:} update-limit-zero {
|
||||
create table temp (a,b,c);
|
||||
insert into temp values (1,22,33),(1,22,33),(1,22,33),(1,22,33),(1,22,33),(1,22,33),(1,22,33),(1,22,33);
|
||||
update temp set a = 44 LIMIT 0;
|
||||
select COUNT(*) from temp where a = 44;
|
||||
} {0}
|
||||
|
||||
do_execsql_test_on_specific_db {:memory:} update-limit-negative {
|
||||
create table temp (a,b,c);
|
||||
insert into temp values (1,22,33),(1,22,33),(1,22,33),(1,22,33),(1,22,33),(1,22,33),(1,22,33),(1,22,33);
|
||||
update temp set a = 44 LIMIT -1;
|
||||
select COUNT(*) from temp where a = 44;
|
||||
} {8}
|
||||
|
||||
do_execsql_test_on_specific_db {:memory:} update-large-small {
|
||||
create table temp (a,b,c);
|
||||
insert into temp values (randomblob(1024), 1, 2);
|
||||
|
||||
Reference in New Issue
Block a user