| OLD | NEW |
| 1 # 2007 November 23 | 1 # 2007 November 23 |
| 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 16 matching lines...) Expand all Loading... |
| 27 # statement includes such an opcode if a temp-table is used | 27 # statement includes such an opcode if a temp-table is used |
| 28 # to store intermediate results. | 28 # to store intermediate results. |
| 29 # | 29 # |
| 30 proc uses_temp_table {sql} { | 30 proc uses_temp_table {sql} { |
| 31 return [expr {[lsearch [execsql "EXPLAIN $sql"] OpenEphemeral]>=0}] | 31 return [expr {[lsearch [execsql "EXPLAIN $sql"] OpenEphemeral]>=0}] |
| 32 } | 32 } |
| 33 | 33 |
| 34 # Construct the sample database. | 34 # Construct the sample database. |
| 35 # | 35 # |
| 36 do_test insert5-1.0 { | 36 do_test insert5-1.0 { |
| 37 file delete -force test2.db test2.db-journal | 37 forcedelete test2.db test2.db-journal |
| 38 execsql { | 38 execsql { |
| 39 CREATE TABLE MAIN(Id INTEGER, Id1 INTEGER); | 39 CREATE TABLE MAIN(Id INTEGER, Id1 INTEGER); |
| 40 CREATE TABLE B(Id INTEGER, Id1 INTEGER); | 40 CREATE TABLE B(Id INTEGER, Id1 INTEGER); |
| 41 CREATE VIEW v1 AS SELECT * FROM B; | 41 CREATE VIEW v1 AS SELECT * FROM B; |
| 42 CREATE VIEW v2 AS SELECT * FROM MAIN; | 42 CREATE VIEW v2 AS SELECT * FROM MAIN; |
| 43 INSERT INTO MAIN(Id,Id1) VALUES(2,3); | 43 INSERT INTO MAIN(Id,Id1) VALUES(2,3); |
| 44 INSERT INTO B(Id,Id1) VALUES(2,3); | 44 INSERT INTO B(Id,Id1) VALUES(2,3); |
| 45 } | 45 } |
| 46 } {} | 46 } {} |
| 47 | 47 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 # } {} | 108 # } {} |
| 109 do_test insert5-2.9 { | 109 do_test insert5-2.9 { |
| 110 catchsql { | 110 catchsql { |
| 111 INSERT INTO b | 111 INSERT INTO b |
| 112 SELECT * FROM main | 112 SELECT * FROM main |
| 113 WHERE id > 10 AND (SELECT count(*) FROM v2 GROUP BY main.id) | 113 WHERE id > 10 AND (SELECT count(*) FROM v2 GROUP BY main.id) |
| 114 } | 114 } |
| 115 } {1 {no such column: main.id}} | 115 } {1 {no such column: main.id}} |
| 116 | 116 |
| 117 finish_test | 117 finish_test |
| OLD | NEW |