OLD | NEW |
1 # 2001 September 15 | 1 # 2001 September 15 |
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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 do_test intpkey-3.7 { | 289 do_test intpkey-3.7 { |
290 execsql {INSERT INTO t1 VALUES(11,'hello','world')} | 290 execsql {INSERT INTO t1 VALUES(11,'hello','world')} |
291 count { | 291 count { |
292 SELECT * FROM t1 WHERE c=='world'; | 292 SELECT * FROM t1 WHERE c=='world'; |
293 } | 293 } |
294 } {5 hello world 11 hello world 5} | 294 } {5 hello world 11 hello world 5} |
295 do_test intpkey-3.8 { | 295 do_test intpkey-3.8 { |
296 count { | 296 count { |
297 SELECT * FROM t1 WHERE c=='world' AND a>7; | 297 SELECT * FROM t1 WHERE c=='world' AND a>7; |
298 } | 298 } |
299 } {11 hello world 4} | 299 } {11 hello world 3} |
300 do_test intpkey-3.9 { | 300 do_test intpkey-3.9 { |
301 count { | 301 count { |
302 SELECT * FROM t1 WHERE 7<a; | 302 SELECT * FROM t1 WHERE 7<a; |
303 } | 303 } |
304 } {11 hello world 1} | 304 } {11 hello world 1} |
305 | 305 |
306 # Test inequality constraints on integer primary keys and rowids | 306 # Test inequality constraints on integer primary keys and rowids |
307 # | 307 # |
308 do_test intpkey-4.1 { | 308 do_test intpkey-4.1 { |
309 count { | 309 count { |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 execsql { | 597 execsql { |
598 SELECT b FROM t1 WHERE a<12345678901; | 598 SELECT b FROM t1 WHERE a<12345678901; |
599 } | 599 } |
600 } {y zero 2 hello second hello b-20 b-22 new 3 big-1 big-2} | 600 } {y zero 2 hello second hello b-20 b-22 new 3 big-1 big-2} |
601 do_test intpkey-15.7 { | 601 do_test intpkey-15.7 { |
602 execsql { | 602 execsql { |
603 SELECT b FROM t1 WHERE a>12345678901; | 603 SELECT b FROM t1 WHERE a>12345678901; |
604 } | 604 } |
605 } {} | 605 } {} |
606 | 606 |
| 607 # 2016-04-18 ticket https://www.sqlite.org/src/tktview/7d7525cb01b68712495d3a |
| 608 # Be sure to escape quoted typenames. |
| 609 # |
| 610 do_execsql_test intpkey-16.0 { |
| 611 CREATE TABLE t16a(id "INTEGER" PRIMARY KEY AUTOINCREMENT, b [TEXT], c `INT`); |
| 612 } {} |
| 613 do_execsql_test intpkey-16.1 { |
| 614 PRAGMA table_info=t16a; |
| 615 } {0 id INTEGER 0 {} 1 1 b TEXT 0 {} 0 2 c INT 0 {} 0} |
| 616 |
| 617 # 2016-05-06 ticket https://www.sqlite.org/src/tktview/16c9801ceba4923939085 |
| 618 # When the schema contains an index on the IPK and no other index |
| 619 # and a WHERE clause on a delete uses an OR where both sides referencing |
| 620 # the IPK, then it is possible that the OP_Delete will fail because there |
| 621 # deferred seek of the OP_Seek is not resolved prior to reaching the OP_Delete. |
| 622 # |
| 623 do_execsql_test intpkey-17.0 { |
| 624 CREATE TABLE t17(x INTEGER PRIMARY KEY, y TEXT); |
| 625 INSERT INTO t17(x,y) VALUES(123,'elephant'),(248,'giraffe'); |
| 626 CREATE INDEX t17x ON t17(x); |
| 627 DELETE FROM t17 WHERE x=99 OR x<130; |
| 628 SELECT * FROM t17; |
| 629 } {248 giraffe} |
| 630 do_execsql_test intpkey-17.1 { |
| 631 DROP INDEX t17x; |
| 632 DELETE FROM t17; |
| 633 INSERT INTO t17(x,y) VALUES(123,'elephant'),(248,'giraffe'); |
| 634 CREATE UNIQUE INDEX t17x ON t17(abs(x)); |
| 635 DELETE FROM t17 WHERE abs(x) IS NULL OR abs(x)<130; |
| 636 SELECT * FROM t17; |
| 637 } {248 giraffe} |
| 638 do_execsql_test intpkey-17.2 { |
| 639 DELETE FROM t17; |
| 640 INSERT INTO t17(x,y) VALUES(123,'elephant'),(248,'giraffe'); |
| 641 UPDATE t17 SET y='ostrich' WHERE abs(x)=248; |
| 642 SELECT * FROM t17 ORDER BY +x; |
| 643 } {123 elephant 248 ostrich} |
607 | 644 |
608 finish_test | 645 finish_test |
OLD | NEW |