OLD | NEW |
1 # 2003 June 21 | 1 # 2003 June 21 |
2 # | 2 # |
3 # The author disclaims copyright to this source code. In place of | 3 # The author disclaims copyright to this source code. In place of |
4 # a legal notice, here is a blessing: | 4 # a legal notice, here is a blessing: |
5 # | 5 # |
6 # May you do good and not evil. | 6 # May you do good and not evil. |
7 # May you find forgiveness for yourself and forgive others. | 7 # May you find forgiveness for yourself and forgive others. |
8 # May you share freely, never taking more than you give. | 8 # May you share freely, never taking more than you give. |
9 # | 9 # |
10 #*********************************************************************** | 10 #*********************************************************************** |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 # Make sure we get an error message (not a segfault) on an attempt to | 158 # Make sure we get an error message (not a segfault) on an attempt to |
159 # update a table from within the callback of a select on that same | 159 # update a table from within the callback of a select on that same |
160 # table. | 160 # table. |
161 # | 161 # |
162 # 2006-08-16: This has changed. It is now permitted to update | 162 # 2006-08-16: This has changed. It is now permitted to update |
163 # the table being SELECTed from within the callback of the query. | 163 # the table being SELECTed from within the callback of the query. |
164 # | 164 # |
165 ifcapable tclvar { | 165 ifcapable tclvar { |
166 do_test misc2-7.1 { | 166 do_test misc2-7.1 { |
167 db close | 167 db close |
168 file delete -force test.db | 168 forcedelete test.db |
169 sqlite3 db test.db | 169 sqlite3 db test.db |
170 execsql { | 170 execsql { |
171 CREATE TABLE t1(x); | 171 CREATE TABLE t1(x); |
172 INSERT INTO t1 VALUES(1); | 172 INSERT INTO t1 VALUES(1); |
173 INSERT INTO t1 VALUES(2); | 173 INSERT INTO t1 VALUES(2); |
174 INSERT INTO t1 VALUES(3); | 174 INSERT INTO t1 VALUES(3); |
175 SELECT * FROM t1; | 175 SELECT * FROM t1; |
176 } | 176 } |
177 } {1 2 3} | 177 } {1 2 3} |
178 do_test misc2-7.2 { | 178 do_test misc2-7.2 { |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 } | 258 } |
259 execsql {SELECT * FROM t1} | 259 execsql {SELECT * FROM t1} |
260 } {1 2 3 4 5 6 7 8 9 10} | 260 } {1 2 3 4 5 6 7 8 9 10} |
261 | 261 |
262 # Repeat the tests 7.1 through 7.8 about but this time do the SELECTs | 262 # Repeat the tests 7.1 through 7.8 about but this time do the SELECTs |
263 # in reverse order so that we exercise the sqlite3BtreePrev() routine | 263 # in reverse order so that we exercise the sqlite3BtreePrev() routine |
264 # instead of sqlite3BtreeNext() | 264 # instead of sqlite3BtreeNext() |
265 # | 265 # |
266 do_test misc2-7.11 { | 266 do_test misc2-7.11 { |
267 db close | 267 db close |
268 file delete -force test.db | 268 forcedelete test.db |
269 sqlite3 db test.db | 269 sqlite3 db test.db |
270 execsql { | 270 execsql { |
271 CREATE TABLE t1(x); | 271 CREATE TABLE t1(x); |
272 INSERT INTO t1 VALUES(1); | 272 INSERT INTO t1 VALUES(1); |
273 INSERT INTO t1 VALUES(2); | 273 INSERT INTO t1 VALUES(2); |
274 INSERT INTO t1 VALUES(3); | 274 INSERT INTO t1 VALUES(3); |
275 SELECT * FROM t1; | 275 SELECT * FROM t1; |
276 } | 276 } |
277 } {1 2 3} | 277 } {1 2 3} |
278 do_test misc2-7.12 { | 278 do_test misc2-7.12 { |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 db eval {SELECT rowid, x FROM t1 ORDER BY rowid DESC} { | 354 db eval {SELECT rowid, x FROM t1 ORDER BY rowid DESC} { |
355 if {$x>1} { | 355 if {$x>1} { |
356 db eval {INSERT INTO t1(rowid,x) VALUES($x-1,$x-1)} | 356 db eval {INSERT INTO t1(rowid,x) VALUES($x-1,$x-1)} |
357 } | 357 } |
358 } | 358 } |
359 execsql {SELECT * FROM t1} | 359 execsql {SELECT * FROM t1} |
360 } {1 2 3 4 5 6 7 8 9 10} | 360 } {1 2 3 4 5 6 7 8 9 10} |
361 } | 361 } |
362 | 362 |
363 db close | 363 db close |
364 file delete -force test.db | 364 forcedelete test.db |
365 sqlite3 db test.db | 365 sqlite3 db test.db |
366 catchsql { pragma recursive_triggers = off } | 366 catchsql { pragma recursive_triggers = off } |
367 | 367 |
368 # Ticket #453. If the SQL ended with "-", the tokenizer was calling that | 368 # Ticket #453. If the SQL ended with "-", the tokenizer was calling that |
369 # an incomplete token, which caused problem. The solution was to just call | 369 # an incomplete token, which caused problem. The solution was to just call |
370 # it a minus sign. | 370 # it a minus sign. |
371 # | 371 # |
372 do_test misc2-8.1 { | 372 do_test misc2-8.1 { |
373 catchsql {-} | 373 catchsql {-} |
374 } {1 {near "-": syntax error}} | 374 } {1 {near "-": syntax error}} |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 CREATE TABLE t1229(x); | 432 CREATE TABLE t1229(x); |
433 CREATE TRIGGER r1229 BEFORE INSERT ON t1229 BEGIN | 433 CREATE TRIGGER r1229 BEFORE INSERT ON t1229 BEGIN |
434 INSERT INTO t1229 SELECT y FROM (SELECT new.x y); | 434 INSERT INTO t1229 SELECT y FROM (SELECT new.x y); |
435 END; | 435 END; |
436 INSERT INTO t1229 VALUES(1); | 436 INSERT INTO t1229 VALUES(1); |
437 } | 437 } |
438 } {} | 438 } {} |
439 } | 439 } |
440 | 440 |
441 finish_test | 441 finish_test |
OLD | NEW |