OLD | NEW |
1 # 2010 November 30 | 1 # 2010 November 30 |
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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 # searched first, followed by the main database, followed all attached | 58 # searched first, followed by the main database, followed all attached |
59 # databases in the order that they were attached. The reference resolves | 59 # databases in the order that they were attached. The reference resolves |
60 # to the first match found. | 60 # to the first match found. |
61 # | 61 # |
62 resolve_reopen_db | 62 resolve_reopen_db |
63 do_execsql_test 1.1 { SELECT * FROM n1 } {temp n1} | 63 do_execsql_test 1.1 { SELECT * FROM n1 } {temp n1} |
64 do_execsql_test 1.2 { SELECT * FROM n2 } {main n2} | 64 do_execsql_test 1.2 { SELECT * FROM n2 } {main n2} |
65 do_execsql_test 1.3 { SELECT * FROM n3 } {at1 n3} | 65 do_execsql_test 1.3 { SELECT * FROM n3 } {at1 n3} |
66 do_execsql_test 1.4 { SELECT * FROM n4 } {at2 n4} | 66 do_execsql_test 1.4 { SELECT * FROM n4 } {at2 n4} |
67 | 67 |
68 # EVIDENCE-OF: R-54577-28142 If a database name is specified as part of | 68 # EVIDENCE-OF: R-00634-08585 If a schema name is specified as part of an |
69 # an object reference, it must be either "main", or "temp" or the name | 69 # object reference, it must be either "main", or "temp" or the |
70 # of an attached database. | 70 # schema-name of an attached database. |
71 # | 71 # |
72 # Or else it is a "no such table: xxx" error. | 72 # Or else it is a "no such table: xxx" error. |
73 # | 73 # |
74 resolve_reopen_db | 74 resolve_reopen_db |
75 do_execsql_test 2.1.1 { SELECT * FROM main.n1 } {main n1} | 75 do_execsql_test 2.1.1 { SELECT * FROM main.n1 } {main n1} |
76 do_execsql_test 2.1.2 { SELECT * FROM temp.n1 } {temp n1} | 76 do_execsql_test 2.1.2 { SELECT * FROM temp.n1 } {temp n1} |
77 do_execsql_test 2.1.3 { SELECT * FROM at1.n1 } {at1 n1} | 77 do_execsql_test 2.1.3 { SELECT * FROM at1.n1 } {at1 n1} |
78 do_execsql_test 2.1.4 { SELECT * FROM at2.n1 } {at2 n1} | 78 do_execsql_test 2.1.4 { SELECT * FROM at2.n1 } {at2 n1} |
79 | 79 |
80 do_catchsql_test 2.2 { SELECT * FROM xxx.n1 } {1 {no such table: xxx.n1}} | 80 do_catchsql_test 2.2 { SELECT * FROM xxx.n1 } {1 {no such table: xxx.n1}} |
81 | 81 |
82 # EVIDENCE-OF: R-26223-47623 Like other SQL identifiers, database names | 82 # EVIDENCE-OF: R-17446-42210 Like other SQL identifiers, schema names |
83 # are case-insensitive. | 83 # are case-insensitive. |
84 # | 84 # |
85 resolve_reopen_db | 85 resolve_reopen_db |
86 do_execsql_test 3.1 { SELECT * FROM MAIN.n1 } {main n1} | 86 do_execsql_test 3.1 { SELECT * FROM MAIN.n1 } {main n1} |
87 do_execsql_test 3.2 { SELECT * FROM tEmP.n1 } {temp n1} | 87 do_execsql_test 3.2 { SELECT * FROM tEmP.n1 } {temp n1} |
88 do_execsql_test 3.3 { SELECT * FROM aT1.n1 } {at1 n1} | 88 do_execsql_test 3.3 { SELECT * FROM aT1.n1 } {at1 n1} |
89 do_execsql_test 3.4 { SELECT * FROM At2.n1 } {at2 n1} | 89 do_execsql_test 3.4 { SELECT * FROM At2.n1 } {at2 n1} |
90 | 90 |
91 # EVIDENCE-OF: R-15639-28392 If a database name is specified, then only | 91 # EVIDENCE-OF: R-14755-58619 If a schema name is specified, then only |
92 # the named database is searched for the named object. | 92 # that one schema is searched for the named object. |
93 # | 93 # |
94 do_catchsql_test 4.1 { SELECT * FROM temp.n2 } {1 {no such table: temp.n2}} | 94 do_catchsql_test 4.1 { SELECT * FROM temp.n2 } {1 {no such table: temp.n2}} |
95 do_catchsql_test 4.2 { SELECT * FROM main.n2 } {0 {main n2}} | 95 do_catchsql_test 4.2 { SELECT * FROM main.n2 } {0 {main n2}} |
96 do_catchsql_test 4.3 { SELECT * FROM at1.n2 } {0 {at1 n2}} | 96 do_catchsql_test 4.3 { SELECT * FROM at1.n2 } {0 {at1 n2}} |
97 do_catchsql_test 4.4 { SELECT * FROM at2.n2 } {0 {at2 n2}} | 97 do_catchsql_test 4.4 { SELECT * FROM at2.n2 } {0 {at2 n2}} |
98 | 98 |
99 # EVIDENCE-OF: R-08951-19801 When searching database schemas for a named | 99 # EVIDENCE-OF: R-08951-19801 When searching database schemas for a named |
100 # object, objects of types that cannot be used in the context of the | 100 # object, objects of types that cannot be used in the context of the |
101 # reference are always ignored. | 101 # reference are always ignored. |
102 # | 102 # |
(...skipping 23 matching lines...) Expand all Loading... |
126 do_catchsql_test 6.2.3 { SELECT * FROM aux.t1 } {0 {}} | 126 do_catchsql_test 6.2.3 { SELECT * FROM aux.t1 } {0 {}} |
127 | 127 |
128 do_execsql_test 6.3.0 { DROP TABLE t1 } | 128 do_execsql_test 6.3.0 { DROP TABLE t1 } |
129 do_catchsql_test 6.3.1 { SELECT * FROM main.t1 } {1 {no such table: main.t1}} | 129 do_catchsql_test 6.3.1 { SELECT * FROM main.t1 } {1 {no such table: main.t1}} |
130 do_catchsql_test 6.3.3 { SELECT * FROM aux.t1 } {0 {}} | 130 do_catchsql_test 6.3.3 { SELECT * FROM aux.t1 } {0 {}} |
131 | 131 |
132 do_execsql_test 6.4.0 { DROP TABLE t1 } | 132 do_execsql_test 6.4.0 { DROP TABLE t1 } |
133 do_catchsql_test 6.4.1 { SELECT * FROM aux.t1 } {1 {no such table: aux.t1}} | 133 do_catchsql_test 6.4.1 { SELECT * FROM aux.t1 } {1 {no such table: aux.t1}} |
134 | 134 |
135 finish_test | 135 finish_test |
OLD | NEW |