| OLD | NEW |
| 1 # 2009 February 2 | 1 # 2009 February 2 |
| 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 #************************************************************************* |
| 11 # | 11 # |
| 12 # This file checks to make sure the "TEMP" or "TEMPORARY" keyword is | 12 # This file checks to make sure the "TEMP" or "TEMPORARY" keyword is |
| 13 # omitted from the schema of a table that is created using that | 13 # omitted from the schema of a table that is created using that |
| 14 # keyword. Ticket #3630. | 14 # keyword. Ticket #3630. |
| 15 # | 15 # |
| 16 # $Id: tkt3630.test,v 1.1 2009/02/02 18:03:22 drh Exp $ | 16 # $Id: tkt3630.test,v 1.1 2009/02/02 18:03:22 drh Exp $ |
| 17 # | 17 # |
| 18 | 18 |
| 19 set testdir [file dirname $argv0] | 19 set testdir [file dirname $argv0] |
| 20 | 20 |
| 21 source $testdir/tester.tcl | 21 source $testdir/tester.tcl |
| 22 | 22 |
| 23 do_test tkt3630-1 { | 23 do_test tkt3630-1 { |
| 24 db eval { | 24 db eval { |
| 25 CREATE TEMP TABLE temp1(a,b,c); | 25 CREATE TEMP TABLE temp1(a,b,c); |
| 26 SELECT * FROM sqlite_temp_master WHERE sql GLOB '*TEMP*'; | 26 SELECT * FROM temp.sqlite_master WHERE sql GLOB '*TEMP*'; |
| 27 } | 27 } |
| 28 } {} | 28 } {} |
| 29 do_test tkt3630-2 { | 29 do_test tkt3630-2 { |
| 30 db eval { | 30 db eval { |
| 31 CREATE TABLE main1(a,b,c); | 31 CREATE TABLE main1(a,b,c); |
| 32 CREATE TEMP TABLE temp2 AS SELECT * FROM main1; | 32 CREATE TEMP TABLE temp2 AS SELECT * FROM main1; |
| 33 SELECT * FROM sqlite_temp_master WHERE sql GLOB '*TEMP*'; | 33 SELECT * FROM sqlite_temp_master WHERE sql GLOB '*TEMP*'; |
| 34 } | 34 } |
| 35 } {} | 35 } {} |
| 36 | 36 |
| 37 ifcapable altertable { | 37 ifcapable altertable { |
| 38 do_test tkt3630-3 { | 38 do_test tkt3630-3 { |
| 39 db eval { | 39 db eval { |
| 40 ALTER TABLE temp2 ADD COLUMN d; | 40 ALTER TABLE temp2 ADD COLUMN d; |
| 41 ALTER TABLE temp2 RENAME TO temp2rn; | 41 ALTER TABLE temp2 RENAME TO temp2rn; |
| 42 SELECT name FROM sqlite_temp_master WHERE name LIKE 'temp2%'; | 42 SELECT name FROM temp.sqlite_master WHERE name LIKE 'temp2%'; |
| 43 } | 43 } |
| 44 } {temp2rn} | 44 } {temp2rn} |
| 45 } | 45 } |
| 46 | 46 |
| 47 finish_test | 47 finish_test |
| OLD | NEW |