Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(542)

Side by Side Diff: third_party/sqlite/src/test/vtab2.test

Issue 1610963002: Import SQLite 3.10.2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/sqlite/src/test/vtab1.test ('k') | third_party/sqlite/src/test/vtab4.test » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # 2006 June 10 1 # 2006 June 10
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 # This file implements regression tests for SQLite library. 11 # This file implements regression tests for SQLite library.
12 # 12 #
13 # $Id: vtab2.test,v 1.9 2008/10/13 10:37:50 danielk1977 Exp $
14 13
15 set testdir [file dirname $argv0] 14 set testdir [file dirname $argv0]
16 source $testdir/tester.tcl 15 source $testdir/tester.tcl
16 set testprefix vtab2
17 17
18 ifcapable !vtab||!schema_pragmas { 18 ifcapable !vtab||!schema_pragmas {
19 finish_test 19 finish_test
20 return 20 return
21 } 21 }
22 22
23 register_schema_module [sqlite3_connection_pointer db] 23 register_schema_module [sqlite3_connection_pointer db]
24 do_test vtab2-1.1 { 24 do_test vtab2-1.1 {
25 execsql { 25 execsql {
26 CREATE VIRTUAL TABLE schema USING schema; 26 CREATE VIRTUAL TABLE schema USING schema;
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 SELECT * FROM schema WHERE dflt_value IS NULL LIMIT 1 97 SELECT * FROM schema WHERE dflt_value IS NULL LIMIT 1
98 } 98 }
99 } {main schema 0 database {} 0 {} 0} 99 } {main schema 0 database {} 0 {} 0}
100 do_test vtab2-3.2 { 100 do_test vtab2-3.2 {
101 execsql { 101 execsql {
102 SELECT *, b.rowid 102 SELECT *, b.rowid
103 FROM schema a LEFT JOIN schema b ON a.dflt_value=b.dflt_value 103 FROM schema a LEFT JOIN schema b ON a.dflt_value=b.dflt_value
104 WHERE a.rowid=1 104 WHERE a.rowid=1
105 } 105 }
106 } {main schema 0 database {} 0 {} 0 {} {} {} {} {} {} {} {} {}} 106 } {main schema 0 database {} 0 {} 0 {} {} {} {} {} {} {} {} {}}
107 do_test vtab2-3.3 {
108 execsql {
109 SELECT *, b.rowid
110 FROM schema a LEFT JOIN schema b ON a.dflt_value IS b.dflt_value
111 AND a.dflt_value IS NOT NULL
112 WHERE a.rowid=1
113 }
114 } {main schema 0 database {} 0 {} 0 {} {} {} {} {} {} {} {} {}}
107 115
108 do_test vtab2-4.1 { 116 do_test vtab2-4.1 {
109 execsql { 117 execsql {
110 BEGIN TRANSACTION; 118 BEGIN TRANSACTION;
111 CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c, UNIQUE(b, c)); 119 CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c, UNIQUE(b, c));
112 CREATE TABLE fkey( 120 CREATE TABLE fkey(
113 to_tbl, 121 to_tbl,
114 to_col 122 to_col
115 ); 123 );
116 INSERT INTO "fkey" VALUES('t1',NULL); 124 INSERT INTO "fkey" VALUES('t1',NULL);
117 COMMIT; 125 COMMIT;
118 } 126 }
119 } {} 127 } {}
120 do_test vtab2-4.2 { 128 do_test vtab2-4.2 {
121 execsql { CREATE VIRTUAL TABLE v_col USING schema } 129 execsql { CREATE VIRTUAL TABLE v_col USING schema }
122 } {} 130 } {}
123 do_test vtab2-4.3 { 131 do_test vtab2-4.3 {
124 execsql { SELECT name FROM v_col WHERE tablename = 't1' AND pk } 132 execsql { SELECT name FROM v_col WHERE tablename = 't1' AND pk }
125 } {a} 133 } {a}
126 do_test vtab2-4.4 { 134 do_test vtab2-4.4 {
127 execsql { 135 execsql {
128 UPDATE fkey 136 UPDATE fkey
129 SET to_col = (SELECT name FROM v_col WHERE tablename = 't1' AND pk); 137 SET to_col = (SELECT name FROM v_col WHERE tablename = 't1' AND pk);
130 } 138 }
131 } {} 139 } {}
132 do_test vtab2-4.5 { 140 do_test vtab2-4.5 {
133 execsql { SELECT * FROM fkey } 141 execsql { SELECT * FROM fkey }
134 } {t1 a} 142 } {t1 a}
135 143
144 #-------------------------------------------------------------------------
145 #
146 ifcapable fts3 {
147 reset_db
148 do_execsql_test 5.1 {
149 PRAGMA encoding='UTF16';
150 }
151
152 do_test 5.2 {
153 sqlite3_exec_hex db { CREATE VIRTUAL TABLE %C8 USING fts3 }
154 } {0 {}}
155
156 do_test 5.3 {
157 sqlite3_exec_hex db { CREATE VIRTUAL TABLE %C9 USING s }
158 } {/1 {malformed database schema.* already exists}/}
159 }
160
161
162
136 finish_test 163 finish_test
OLDNEW
« no previous file with comments | « third_party/sqlite/src/test/vtab1.test ('k') | third_party/sqlite/src/test/vtab4.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698