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

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

Issue 901033002: Import SQLite 3.8.7.4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Chromium changes to support SQLite 3.8.7.4. Created 5 years, 10 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
OLDNEW
1 # 2008 December 8 1 # 2008 December 8
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 # This file is a verification that the bugs identified in ticket 13 # This file is a verification that the bugs identified in ticket
14 # #3527 have been fixed. 14 # #3527 have been fixed.
15 # 15 #
16 # $Id: tkt3527.test,v 1.1 2008/12/08 13:42:36 drh Exp $ 16 # $Id: tkt3527.test,v 1.1 2008/12/08 13:42:36 drh Exp $
17 17
18 set testdir [file dirname $argv0] 18 set testdir [file dirname $argv0]
19 source $testdir/tester.tcl 19 source $testdir/tester.tcl
20 20
21 ifcapable !compound {
22 finish_test
23 return
24 }
25
21 do_test tkt3527-1.1 { 26 do_test tkt3527-1.1 {
22 db eval { 27 db eval {
23 CREATE TABLE Element ( 28 CREATE TABLE Element (
24 Code INTEGER PRIMARY KEY, 29 Code INTEGER PRIMARY KEY,
25 Name VARCHAR(60) 30 Name VARCHAR(60)
26 ); 31 );
27 32
28 CREATE TABLE ElemOr ( 33 CREATE TABLE ElemOr (
29 CodeOr INTEGER NOT NULL, 34 CodeOr INTEGER NOT NULL,
30 Code INTEGER NOT NULL, 35 Code INTEGER NOT NULL,
31 PRIMARY KEY(CodeOr,Code) 36 PRIMARY KEY(CodeOr,Code)
32 ); 37 );
33 38
34 CREATE TABLE ElemAnd ( 39 CREATE TABLE ElemAnd (
35 CodeAnd INTEGER, 40 CodeAnd INTEGER,
36 Code INTEGER, 41 Code INTEGER,
37 Attr1 INTEGER, 42 Attr1 INTEGER,
38 Attr2 INTEGER, 43 Attr2 INTEGER,
39 Attr3 INTEGER, 44 Attr3 INTEGER,
40 PRIMARY KEY(CodeAnd,Code) 45 PRIMARY KEY(CodeAnd,Code)
41 ); 46 );
42 47
43 INSERT INTO Element VALUES(1,'Elem1'); 48 INSERT INTO Element VALUES(1,'Elem1');
44 INSERT INTO Element VALUES(2,'Elem2'); 49 INSERT INTO Element VALUES(2,'Elem2');
45 INSERT INTO Element VALUES(3,'Elem3'); 50 INSERT INTO Element VALUES(3,'Elem3');
46 INSERT INTO Element VALUES(4,'Elem4'); 51 INSERT INTO Element VALUES(4,'Elem4');
47 INSERT INTO Element VALUES(5,'Elem5'); 52 INSERT INTO Element VALUES(5,'Elem5');
48 INSERT INTO ElemOr Values(3,4); 53 INSERT INTO ElemOr Values(3,4);
49 INSERT INTO ElemOr Values(3,5); 54 INSERT INTO ElemOr Values(3,5);
50 INSERT INTO ElemAnd VALUES(1,3,1,1,1); 55 INSERT INTO ElemAnd VALUES(1,3,'a','b','c');
51 INSERT INTO ElemAnd VALUES(1,2,1,1,1); 56 INSERT INTO ElemAnd VALUES(1,2,'x','y','z');
52 57
53 CREATE VIEW ElemView1 AS 58 CREATE VIEW ElemView1 AS
54 SELECT 59 SELECT
55 CAST(Element.Code AS VARCHAR(50)) AS ElemId, 60 CAST(Element.Code AS VARCHAR(50)) AS ElemId,
56 Element.Code AS ElemCode, 61 Element.Code AS ElemCode,
57 Element.Name AS ElemName, 62 Element.Name AS ElemName,
58 ElemAnd.Code AS InnerCode, 63 ElemAnd.Code AS InnerCode,
59 ElemAnd.Attr1 AS Attr1, 64 ElemAnd.Attr1 AS Attr1,
60 ElemAnd.Attr2 AS Attr2, 65 ElemAnd.Attr2 AS Attr2,
61 ElemAnd.Attr3 AS Attr3, 66 ElemAnd.Attr3 AS Attr3,
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 InnerElem.Attr3, 105 InnerElem.Attr3,
101 InnerElem.Level+1, 106 InnerElem.Level+1,
102 InnerElem.IsOrElem 107 InnerElem.IsOrElem
103 FROM ElemView1 AS Element 108 FROM ElemView1 AS Element
104 JOIN ElemView1 AS InnerElem 109 JOIN ElemView1 AS InnerElem
105 ON Element.Level=0 AND Element.InnerCode=InnerElem.ElemCode 110 ON Element.Level=0 AND Element.InnerCode=InnerElem.ElemCode
106 ORDER BY ElemId, InnerCode; 111 ORDER BY ElemId, InnerCode;
107 112
108 SELECT * FROM ElemView1; 113 SELECT * FROM ElemView1;
109 } 114 }
110 } {1 1 Elem1 2 1 1 1 0 0 1 1 Elem1 3 1 1 1 0 0 3 3 Elem3 4 {} {} {} 0 1 3 3 Elem 3 5 {} {} {} 0 1} 115 } {1 1 Elem1 2 x y z 0 0 1 1 Elem1 3 a b c 0 0 3 3 Elem3 4 {} {} {} 0 1 3 3 Elem 3 5 {} {} {} 0 1}
111 116
112 do_test tkt3527-1.2 { 117 do_test tkt3527-1.2 {
113 db eval { 118 db eval {
114 SELECT * FROM ElemView2; 119 SELECT * FROM ElemView2;
115 } 120 }
116 } {1 1 Elem1 2 1 1 1 0 0 1 1 Elem1 3 1 1 1 0 0 1.3 3 Elem3 4 {} {} {} 1 1 1.3 3 Elem3 5 {} {} {} 1 1 3 3 Elem3 4 {} {} {} 0 1 3 3 Elem3 5 {} {} {} 0 1} 121 } {1 1 Elem1 2 x y z 0 0 1 1 Elem1 3 a b c 0 0 1.3 3 Elem3 4 {} {} {} 1 1 1.3 3 Elem3 5 {} {} {} 1 1 3 3 Elem3 4 {} {} {} 0 1 3 3 Elem3 5 {} {} {} 0 1}
117 122
118 finish_test 123 finish_test
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698