tkt3630.test 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # 2009 February 2
  2. #
  3. # The author disclaims copyright to this source code. In place of
  4. # a legal notice, here is a blessing:
  5. #
  6. # May you do good and not evil.
  7. # May you find forgiveness for yourself and forgive others.
  8. # May you share freely, never taking more than you give.
  9. #
  10. #*************************************************************************
  11. #
  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
  14. # keyword. Ticket #3630.
  15. #
  16. # $Id: tkt3630.test,v 1.1 2009/02/02 18:03:22 drh Exp $
  17. #
  18. set testdir [file dirname $argv0]
  19. source $testdir/tester.tcl
  20. do_test tkt3630-1 {
  21. db eval {
  22. CREATE TEMP TABLE temp1(a,b,c);
  23. SELECT * FROM sqlite_temp_master WHERE sql GLOB '*TEMP*';
  24. }
  25. } {}
  26. do_test tkt3630-2 {
  27. db eval {
  28. CREATE TABLE main1(a,b,c);
  29. CREATE TEMP TABLE temp2 AS SELECT * FROM main1;
  30. SELECT * FROM sqlite_temp_master WHERE sql GLOB '*TEMP*';
  31. }
  32. } {}
  33. ifcapable altertable {
  34. do_test tkt3630-3 {
  35. db eval {
  36. ALTER TABLE temp2 ADD COLUMN d;
  37. ALTER TABLE temp2 RENAME TO temp2rn;
  38. SELECT name FROM sqlite_temp_master WHERE name LIKE 'temp2%';
  39. }
  40. } {temp2rn}
  41. }
  42. finish_test