| OLD | NEW |
| 1 # 2010 September 25 | 1 # 2010 September 25 |
| 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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 } | 366 } |
| 367 do_createtable_tests 1.1.2 { | 367 do_createtable_tests 1.1.2 { |
| 368 1 "CREATE TABLE sqlit_abc(a, b, c)" {} | 368 1 "CREATE TABLE sqlit_abc(a, b, c)" {} |
| 369 2 "CREATE TABLE temp.sqlitehelloworld(x)" {} | 369 2 "CREATE TABLE temp.sqlitehelloworld(x)" {} |
| 370 3 {CREATE TABLE auxa."sqlite"(x, y)} {} | 370 3 {CREATE TABLE auxa."sqlite"(x, y)} {} |
| 371 4 {CREATE TABLE auxb."sqlite-"(z)} {} | 371 4 {CREATE TABLE auxb."sqlite-"(z)} {} |
| 372 5 {CREATE TABLE "SQLITE-TBL"(z)} {} | 372 5 {CREATE TABLE "SQLITE-TBL"(z)} {} |
| 373 } | 373 } |
| 374 | 374 |
| 375 | 375 |
| 376 # EVIDENCE-OF: R-10195-31023 If a <database-name> is specified, it | 376 # EVIDENCE-OF: R-18448-33677 If a schema-name is specified, it must be |
| 377 # must be either "main", "temp", or the name of an attached database. | 377 # either "main", "temp", or the name of an attached database. |
| 378 # | 378 # |
| 379 # EVIDENCE-OF: R-39822-07822 In this case the new table is created in | 379 # EVIDENCE-OF: R-39822-07822 In this case the new table is created in |
| 380 # the named database. | 380 # the named database. |
| 381 # | 381 # |
| 382 # Test cases 1.2.* test the first of the two requirements above. The | 382 # Test cases 1.2.* test the first of the two requirements above. The |
| 383 # second is verified by cases 1.3.*. | 383 # second is verified by cases 1.3.*. |
| 384 # | 384 # |
| 385 do_createtable_tests 1.2.1 -error { | 385 do_createtable_tests 1.2.1 -error { |
| 386 unknown database %s | 386 unknown database %s |
| 387 } { | 387 } { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 415 drop_all_tables | 415 drop_all_tables |
| 416 do_createtable_tests 1.4 -tclquery { | 416 do_createtable_tests 1.4 -tclquery { |
| 417 unset -nocomplain X | 417 unset -nocomplain X |
| 418 array set X [table_list] | 418 array set X [table_list] |
| 419 list $X(main) $X(temp) $X(auxa) $X(auxb) | 419 list $X(main) $X(temp) $X(auxa) $X(auxb) |
| 420 } { | 420 } { |
| 421 1 "CREATE TEMP TABLE t1(a, b)" {{} t1 {} {}} | 421 1 "CREATE TEMP TABLE t1(a, b)" {{} t1 {} {}} |
| 422 2 "CREATE TEMPORARY TABLE t2(a, b)" {{} {t1 t2} {} {}} | 422 2 "CREATE TEMPORARY TABLE t2(a, b)" {{} {t1 t2} {} {}} |
| 423 } | 423 } |
| 424 | 424 |
| 425 # EVIDENCE-OF: R-49439-47561 It is an error to specify both a | 425 # EVIDENCE-OF: R-23976-43329 It is an error to specify both a |
| 426 # <database-name> and the TEMP or TEMPORARY keyword, unless the | 426 # schema-name and the TEMP or TEMPORARY keyword, unless the schema-name |
| 427 # <database-name> is "temp". | 427 # is "temp". |
| 428 # | 428 # |
| 429 drop_all_tables | 429 drop_all_tables |
| 430 do_createtable_tests 1.5.1 -error { | 430 do_createtable_tests 1.5.1 -error { |
| 431 temporary table name must be unqualified | 431 temporary table name must be unqualified |
| 432 } { | 432 } { |
| 433 1 "CREATE TEMP TABLE main.t1(a, b)" {} | 433 1 "CREATE TEMP TABLE main.t1(a, b)" {} |
| 434 2 "CREATE TEMPORARY TABLE auxa.t2(a, b)" {} | 434 2 "CREATE TEMPORARY TABLE auxa.t2(a, b)" {} |
| 435 3 "CREATE TEMP TABLE auxb.t3(a, b)" {} | 435 3 "CREATE TEMP TABLE auxb.t3(a, b)" {} |
| 436 4 "CREATE TEMPORARY TABLE main.xxx(x)" {} | 436 4 "CREATE TEMPORARY TABLE main.xxx(x)" {} |
| 437 } | 437 } |
| 438 drop_all_tables | 438 drop_all_tables |
| 439 do_createtable_tests 1.5.2 -tclquery { | 439 do_createtable_tests 1.5.2 -tclquery { |
| 440 unset -nocomplain X | 440 unset -nocomplain X |
| 441 array set X [table_list] | 441 array set X [table_list] |
| 442 list $X(main) $X(temp) $X(auxa) $X(auxb) | 442 list $X(main) $X(temp) $X(auxa) $X(auxb) |
| 443 } { | 443 } { |
| 444 1 "CREATE TEMP TABLE temp.t1(a, b)" {{} t1 {} {}} | 444 1 "CREATE TEMP TABLE temp.t1(a, b)" {{} t1 {} {}} |
| 445 2 "CREATE TEMPORARY TABLE temp.t2(a, b)" {{} {t1 t2} {} {}} | 445 2 "CREATE TEMPORARY TABLE temp.t2(a, b)" {{} {t1 t2} {} {}} |
| 446 3 "CREATE TEMP TABLE TEMP.t3(a, b)" {{} {t1 t2 t3} {} {}} | 446 3 "CREATE TEMP TABLE TEMP.t3(a, b)" {{} {t1 t2 t3} {} {}} |
| 447 4 "CREATE TEMPORARY TABLE TEMP.xxx(x)" {{} {t1 t2 t3 xxx} {} {}} | 447 4 "CREATE TEMPORARY TABLE TEMP.xxx(x)" {{} {t1 t2 t3 xxx} {} {}} |
| 448 } | 448 } |
| 449 | 449 |
| 450 # EVIDENCE-OF: R-00917-09393 If no database name is specified and the | 450 # EVIDENCE-OF: R-31997-24564 If no schema name is specified and the TEMP |
| 451 # TEMP keyword is not present then the table is created in the main | 451 # keyword is not present then the table is created in the main database. |
| 452 # database. | |
| 453 # | 452 # |
| 454 drop_all_tables | 453 drop_all_tables |
| 455 do_createtable_tests 1.6 -tclquery { | 454 do_createtable_tests 1.6 -tclquery { |
| 456 unset -nocomplain X | 455 unset -nocomplain X |
| 457 array set X [table_list] | 456 array set X [table_list] |
| 458 list $X(main) $X(temp) $X(auxa) $X(auxb) | 457 list $X(main) $X(temp) $X(auxa) $X(auxb) |
| 459 } { | 458 } { |
| 460 1 "CREATE TABLE t1(a, b)" {t1 {} {} {}} | 459 1 "CREATE TABLE t1(a, b)" {t1 {} {} {}} |
| 461 2 "CREATE TABLE t2(a, b)" {{t1 t2} {} {} {}} | 460 2 "CREATE TABLE t2(a, b)" {{t1 t2} {} {} {}} |
| 462 3 "CREATE TABLE t3(a, b)" {{t1 t2 t3} {} {} {}} | 461 3 "CREATE TABLE t3(a, b)" {{t1 t2 t3} {} {} {}} |
| (...skipping 1481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1944 1 "INSERT INTO t12 DEFAULT VALUES" {integer 1} | 1943 1 "INSERT INTO t12 DEFAULT VALUES" {integer 1} |
| 1945 2 "INSERT INTO t12(y) VALUES(5)" {integer 2} | 1944 2 "INSERT INTO t12(y) VALUES(5)" {integer 2} |
| 1946 3 "INSERT INTO t12(x,y) VALUES(NULL, 10)" {integer 3} | 1945 3 "INSERT INTO t12(x,y) VALUES(NULL, 10)" {integer 3} |
| 1947 4 "INSERT INTO t12(x,y) SELECT NULL, 15 FROM t12" | 1946 4 "INSERT INTO t12(x,y) SELECT NULL, 15 FROM t12" |
| 1948 {integer 4 integer 5 integer 6} | 1947 {integer 4 integer 5 integer 6} |
| 1949 5 "INSERT INTO t12(y) SELECT 20 FROM t12 LIMIT 3" | 1948 5 "INSERT INTO t12(y) SELECT 20 FROM t12 LIMIT 3" |
| 1950 {integer 7 integer 8 integer 9} | 1949 {integer 7 integer 8 integer 9} |
| 1951 } | 1950 } |
| 1952 | 1951 |
| 1953 finish_test | 1952 finish_test |
| OLD | NEW |