OLD | NEW |
1 # 2008 February 12 | 1 # 2008 February 12 |
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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 db eval { | 70 db eval { |
71 CREATE VIEW v4 AS | 71 CREATE VIEW v4 AS |
72 SELECT CAST(x AS TEXT) AS c1 FROM t1 | 72 SELECT CAST(x AS TEXT) AS c1 FROM t1 |
73 UNION SELECT y FROM t1 WHERE x BETWEEN 3 and 5; | 73 UNION SELECT y FROM t1 WHERE x BETWEEN 3 and 5; |
74 SELECT * FROM v4 ORDER BY 1; | 74 SELECT * FROM v4 ORDER BY 1; |
75 } | 75 } |
76 } {1 10 2 3 4 5 6 7 8 9 five four three} | 76 } {1 10 2 3 4 5 6 7 8 9 five four three} |
77 do_test triggerA-1.6 { | 77 do_test triggerA-1.6 { |
78 db eval { | 78 db eval { |
79 CREATE VIEW v5 AS SELECT x, b FROM t1, t2 WHERE y=c; | 79 CREATE VIEW v5 AS SELECT x, b FROM t1, t2 WHERE y=c; |
80 SELECT * FROM v5; | 80 SELECT * FROM v5 ORDER BY x DESC; |
81 } | 81 } |
82 } {10 1003 9 904 8 805 7 705 6 603 5 504 4 404 3 305 2 203 1 103} | 82 } {10 1003 9 904 8 805 7 705 6 603 5 504 4 404 3 305 2 203 1 103} |
83 | 83 |
84 # Create INSTEAD OF triggers on the views. Run UPDATE and DELETE statements | 84 # Create INSTEAD OF triggers on the views. Run UPDATE and DELETE statements |
85 # using those triggers. Verify correct operation. | 85 # using those triggers. Verify correct operation. |
86 # | 86 # |
87 do_test triggerA-2.1 { | 87 do_test triggerA-2.1 { |
88 db eval { | 88 db eval { |
89 CREATE TABLE result2(a,b); | 89 CREATE TABLE result2(a,b); |
90 CREATE TRIGGER r1d INSTEAD OF DELETE ON v1 BEGIN | 90 CREATE TRIGGER r1d INSTEAD OF DELETE ON v1 BEGIN |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 } -sqlbody { | 221 } -sqlbody { |
222 DELETE FROM v5 WHERE x=5; | 222 DELETE FROM v5 WHERE x=5; |
223 UPDATE v5 SET b=b+9900000 WHERE x BETWEEN 3 AND 5; | 223 UPDATE v5 SET b=b+9900000 WHERE x BETWEEN 3 AND 5; |
224 } | 224 } |
225 | 225 |
226 # Clean up the saved database copy. | 226 # Clean up the saved database copy. |
227 # | 227 # |
228 file delete -force test.db-triggerA | 228 file delete -force test.db-triggerA |
229 | 229 |
230 finish_test | 230 finish_test |
OLD | NEW |