3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
6 # May you do good and not evil.
7 # May you find forgiveness for yourself and forgive others.
8 # May you share freely, never taking more than you give.
10 #*************************************************************************
13 set testdir [file dirname $argv0]
14 source $testdir/tester.tcl
15 set testprefix altertab3
17 # If SQLITE_OMIT_ALTERTABLE is defined, omit this file.
18 ifcapable !altertable {
23 ifcapable windowfunc {
25 CREATE TABLE t1(a, b);
26 CREATE TRIGGER tr1 AFTER INSERT ON t1 BEGIN
27 SELECT sum(b) OVER w FROM t1 WINDOW w AS (ORDER BY a);
32 ALTER TABLE t1 RENAME a TO aaa;
36 SELECT sql FROM sqlite_master WHERE name='tr1'
37 } {{CREATE TRIGGER tr1 AFTER INSERT ON t1 BEGIN
38 SELECT sum(b) OVER w FROM t1 WINDOW w AS (ORDER BY aaa);
42 INSERT INTO t1 VALUES(1, 2);
46 #-------------------------------------------------------------------------
49 CREATE TABLE t1(a,b,c);
50 CREATE TABLE t2(a,b,c);
51 CREATE TRIGGER r1 AFTER INSERT ON t1 WHEN new.a NOT NULL BEGIN
52 SELECT a,b, a name FROM t1
54 SELECT a,b,c FROM t1 WHERE b>='d' ORDER BY name;
60 ALTER TABLE t1 RENAME TO t1x;
61 SELECT sql FROM sqlite_master WHERE name = 'r1';
62 } {{CREATE TRIGGER r1 AFTER INSERT ON "t1x" WHEN new.a NOT NULL BEGIN
63 SELECT a,b, a name FROM "t1x"
65 SELECT a,b,c FROM "t1x" WHERE b>='d' ORDER BY name;
69 #-------------------------------------------------------------------------
72 CREATE TABLE t1(a, b, c, d);
73 CREATE VIEW v1 AS SELECT * FROM t1 WHERE a=1 OR (b IN ());
77 ALTER TABLE t1 RENAME b TO bbb;
81 SELECT sql FROM sqlite_master WHERE name = 'v1'
82 } {{CREATE VIEW v1 AS SELECT * FROM t1 WHERE a=1 OR (b IN ())}}
84 #-------------------------------------------------------------------------
87 CREATE TABLE t1(a, b);
88 CREATE TABLE t3(e, f);
89 CREATE TRIGGER tr1 AFTER INSERT ON t1 BEGIN
90 INSERT INTO t2 VALUES(new.a, new.b);
94 do_catchsql_test 4.1.2 {
96 ALTER TABLE t3 RENAME TO t4;
97 } {1 {error in trigger tr1: no such table: main.t2}}
98 do_execsql_test 4.1.2 {
101 do_execsql_test 4.1.3 {
102 SELECT type, name, tbl_name, sql
103 FROM sqlite_master WHERE type='table' AND name!='t1';
104 } {table t3 t3 {CREATE TABLE t3(e, f)}}
107 do_catchsql_test 4.2.1 {
109 ALTER TABLE t3 RENAME e TO eee;
110 } {1 {error in trigger tr1: no such table: main.t2}}
111 do_execsql_test 4.2.2 {
114 do_execsql_test 4.2.3 {
115 SELECT type, name, tbl_name, sql
116 FROM sqlite_master WHERE type='table' AND name!='t1';
117 } {table t3 t3 {CREATE TABLE t3(e, f)}}
119 #-------------------------------------------------------------------------
121 do_execsql_test 5.0 {
123 c1 integer, c2, PRIMARY KEY(c1 collate rtrim),
127 do_execsql_test 5.1 {
128 ALTER TABLE t1 RENAME c1 TO c3;
131 #-------------------------------------------------------------------------
133 do_execsql_test 6.0 {
134 CREATE TEMPORARY TABLE Table0 (
136 PRIMARY KEY(Col0 COLLATE RTRIM),
137 FOREIGN KEY (Col0) REFERENCES Table0
141 do_execsql_test 6.1 {
142 ALTER TABLE Table0 RENAME Col0 TO Col0;
145 #-------------------------------------------------------------------------
147 do_execsql_test 7.1.0 {
148 CREATE TABLE t1(a,b,c);
149 CREATE TRIGGER AFTER INSERT ON t1 BEGIN
150 SELECT a, rank() OVER w1 FROM t1
151 WINDOW w1 AS (PARTITION BY b, percent_rank() OVER w1);
155 do_execsql_test 7.1.2 {
156 ALTER TABLE t1 RENAME TO t1x;
157 SELECT sql FROM sqlite_master;
159 {CREATE TABLE "t1x"(a,b,c)}
160 {CREATE TRIGGER AFTER INSERT ON "t1x" BEGIN
161 SELECT a, rank() OVER w1 FROM "t1x"
162 WINDOW w1 AS (PARTITION BY b, percent_rank() OVER w1);
166 do_execsql_test 7.2.1 {
168 CREATE TRIGGER AFTER INSERT ON t1x BEGIN
169 SELECT a, rank() OVER w1 FROM t1x
170 WINDOW w1 AS (PARTITION BY b, percent_rank() OVER w1 ORDER BY d);
174 do_catchsql_test 7.2.2 {
175 ALTER TABLE t1x RENAME TO t1;
176 } {1 {error in trigger AFTER: no such column: d}}
178 #-------------------------------------------------------------------------
180 do_execsql_test 8.0 {
182 CREATE INDEX i0 ON t0('1' IN ());
184 do_execsql_test 8.1 {
185 ALTER TABLE t0 RENAME TO t1;
186 SELECT sql FROM sqlite_master;
188 {CREATE TABLE "t1"(c0)}
189 {CREATE INDEX i0 ON "t1"('1' IN ())}
191 do_execsql_test 8.2.1 {
192 CREATE TABLE t2 (c0);
193 CREATE INDEX i2 ON t2((LIKELIHOOD(c0, 100) IN ()));
194 ALTER TABLE t2 RENAME COLUMN c0 TO c1;
196 do_execsql_test 8.2.2 {
197 SELECT sql FROM sqlite_master WHERE tbl_name = 't2';
199 {CREATE TABLE t2 (c1)}
200 {CREATE INDEX i2 ON t2((LIKELIHOOD(c0, 100) IN ()))}
204 db2 eval { INSERT INTO t2 VALUES (1), (2), (3) }
209 #-------------------------------------------------------------------------
211 do_execsql_test 9.1 {
212 CREATE TABLE t1(a,b,c);
213 CREATE TRIGGER AFTER INSERT ON t1 WHEN new.a NOT NULL BEGIN
214 SELECT true WHERE (SELECT a, b FROM (t1)) IN ();
217 do_execsql_test 9.2 {
218 ALTER TABLE t1 RENAME TO t1x;
221 #-------------------------------------------------------------------------
223 do_execsql_test 10.1 {
224 CREATE TABLE t1(a, b, c);
225 CREATE TABLE t2(a, b, c);
226 CREATE VIEW v1 AS SELECT * FROM t1 WHERE (
227 SELECT t1.a FROM t1, t2
231 do_execsql_test 10.2 {
232 ALTER TABLE t2 RENAME TO t3;
233 SELECT sql FROM sqlite_master WHERE name='v1';
235 {CREATE VIEW v1 AS SELECT * FROM t1 WHERE (
236 SELECT t1.a FROM t1, t2
240 #-------------------------------------------------------------------------
242 do_execsql_test 11.1 {
244 a,b,c,d,e,f,g,h,j,jj,jjb,k,aa,bb,cc,dd,ee DEFAULT 3.14,
245 ff DEFAULT('hiccup'),Wg NOD NULL DEFAULT(false)
248 CREATE TRIGGER b AFTER INSERT ON t1 WHEN new.a BEGIN
249 SELECT a, sum() w3 FROM t1
250 WINDOW b AS (ORDER BY NOT EXISTS(SELECT 1 FROM abc));
254 do_catchsql_test 11.2 {
255 ALTER TABLE t1 RENAME TO t1x;
256 } {1 {error in trigger b: no such table: main.abc}}
258 do_execsql_test 11.3 {
260 CREATE TRIGGER b AFTER INSERT ON t1 WHEN new.a BEGIN
261 SELECT a, sum() w3 FROM t1
262 WINDOW b AS (ORDER BY NOT EXISTS(SELECT 1 FROM t1));
266 do_execsql_test 11.4 {
267 ALTER TABLE t1 RENAME TO t1x;
268 SELECT sql FROM sqlite_master WHERE name = 'b';
270 {CREATE TRIGGER b AFTER INSERT ON "t1x" WHEN new.a BEGIN
271 SELECT a, sum() w3 FROM "t1x"
272 WINDOW b AS (ORDER BY NOT EXISTS(SELECT 1 FROM "t1x"));
276 #-------------------------------------------------------------------------
278 do_execsql_test 12.1 {
279 CREATE TABLE t1(a,b,c,d,e,f,g,h,j,jj,Zjj,k,aQ,bb,cc,dd,ee DEFAULT 3.14,
280 ff DEFAULT('hiccup'),gg NOD NULL DEFAULT(false));
281 CREATE TRIGGER AFTER INSERT ON t1 WHEN new.a NOT NULL BEGIN
283 SELECT b () OVER , dense_rank() OVER d, d () OVER w1
288 ROWS BETWEEN 2 NOT IN(SELECT a, sum(d) w2,max(d)OVER FROM t1
292 ROWS BETWEEN '' PRECEDING AND false FOLLOWING),
294 (PARTITION BY b ORDER BY d
295 ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)
296 ) PRECEDING AND 1 FOLLOWING),
298 (PARTITION BY b ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW),
300 (PARTITION BY b ORDER BY d
301 ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING)
303 SELECT a, sum(d) w2,max(d)OVER FROM t1
307 ROWS BETWEEN '' PRECEDING AND false FOLLOWING),
309 (PARTITION BY b ORDER BY d
310 ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)
316 do_execsql_test 12.2 {
317 ALTER TABLE t1 RENAME TO t1x;
320 #-------------------------------------------------------------------------
322 do_execsql_test 13.1 {
324 CREATE TRIGGER r1 INSERT ON t1 BEGIN
325 SELECT a(*) OVER (ORDER BY (SELECT 1)) FROM t1;
329 do_execsql_test 13.2 {
330 ALTER TABLE t1 RENAME TO t1x;
333 #-------------------------------------------------------------------------
335 do_execsql_test 14.1 {
338 CREATE TRIGGER AFTER INSERT ON t1 BEGIN
339 SELECT sum() FILTER (WHERE (SELECT sum() FILTER (WHERE 0)) AND a);
343 do_catchsql_test 14.2 {
344 ALTER TABLE t1 RENAME TO t1x;
345 } {1 {error in trigger AFTER: no such column: a}}
347 #-------------------------------------------------------------------------
350 do_execsql_test 16.1 {
352 CREATE TRIGGER AFTER INSERT ON t1 BEGIN
353 SELECT (WITH t2 AS (WITH t3 AS (SELECT true)
354 SELECT * FROM t3 ORDER BY true COLLATE nocase)
357 WITH t4 AS (SELECT * FROM t1) SELECT 33;
360 do_execsql_test 16.2 {
361 ALTER TABLE t1 RENAME TO t1x;
364 #-------------------------------------------------------------------------
366 do_execsql_test 17.1 {
367 CREATE TABLE t1(a,b,c);
368 CREATE TRIGGER AFTER INSERT ON t1 WHEN new.a NOT NULL BEGIN
369 SELECT a () FILTER (WHERE a>0) FROM t1;
373 do_execsql_test 17.2 {
374 ALTER TABLE t1 RENAME TO t1x;
375 ALTER TABLE t1x RENAME a TO aaa;
376 SELECT sql FROM sqlite_master WHERE type='trigger';
378 {CREATE TRIGGER AFTER INSERT ON "t1x" WHEN new.aaa NOT NULL BEGIN
379 SELECT a () FILTER (WHERE aaa>0) FROM "t1x";
383 #-------------------------------------------------------------------------
385 do_execsql_test 18.1 {
386 CREATE TABLE t1(a,b);
387 CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
389 INTERSECT SELECT b,a FROM t1
391 SELECT a UNION SELECT b
393 ORDER BY b COLLATE nocase
399 do_catchsql_test 18.2 {
404 SELECT a UNION SELECT b
406 ORDER BY b COLLATE nocase
408 } {1 {1st ORDER BY term does not match any column in the result set}}
410 do_catchsql_test 18.3 {
411 ALTER TABLE t1 RENAME TO t1x;
412 } {1 {error in trigger r1: 1st ORDER BY term does not match any column in the result set}}
414 #-------------------------------------------------------------------------
416 do_execsql_test 19.0 {
417 CREATE TABLE a(a,h CONSTRAINT a UNIQUE ON CONFLICT FAIL,CONSTRAINT a);
422 CREATE VIEW q AS SELECT 123
425 RANGE BETWEEN UNBOUNDED PRECEDING AND INDEXED() OVER(
426 PARTITION BY ( WITH x AS(VALUES(col1)) VALUES(453) )
430 } {1 {error in view q: no such column: col1}}
433 CREATE VIEW q AS SELECT
434 CAST(CAST(CAST(CAST(CAST(CAST(CAST(CAST(CAST(CAST(CAST(RIGHT
435 AS)AS)AS)AS)AS)AS)AS)AS)AS)AS)AS)WINDOW x AS(RANGE BETWEEN UNBOUNDED
436 PRECEDING AND INDEXED(*)OVER(PARTITION BY
437 CROSS,CROSS,NATURAL,sqlite_master(*)OVER a,(WITH a AS(VALUES(LEFT)UNION
438 VALUES(LEFT)UNION VALUES(LEFT)UNION VALUES(LEFT)UNION VALUES(LEFT)UNION
439 VALUES(LEFT)UNION VALUES(LEFT))VALUES(LEFT))IN
440 STORED,LEFT,LEFT,LEFT,LEFT,LEFT,LEFT)*LEFT FOLLOWING)ORDER BY
441 LEFT,LEFT,LEFT,LEFT,LEFT,LEFT,LEFT,LEFT,LEFT,LEFT,LEFT LIMIT
442 LEFT,INDEXED(*)OVER(PARTITION BY
443 CROSS,CROSS,CROSS,LEFT,INDEXED(*)OVER(PARTITION BY
444 CROSS,CROSS,CROSS),INDEXED(*)OVER(PARTITION BY
445 LEFT,LEFT,LEFT,LEFT,LEFT,LEFT,LEFT,LEFT,LEFT,LEFT,LEFT),
446 LEFT,LEFT,INNER,CROSS,CROSS,CROSS,INNER,NATURAL ORDER BY
447 OUTER,NATURAL,NATURAL,NATURAL,NATURAL,NATURAL,NATURAL,NATURAL,INNER,
448 INNER,INNER NULLS LAST GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED
450 } {1 {error in view q: no such column: LEFT}}
453 CREATE VIEW q AS SELECT 99 WINDOW x AS (RANGE BETWEEN UNBOUNDED PRECEDING
454 AND count(*)OVER(PARTITION BY (WITH a AS(VALUES(2),(x3))VALUES(0)))
455 FOLLOWING)ORDER BY x2,sum(1)OVER(PARTITION BY avg(5)OVER(PARTITION BY x1));
456 } {1 {error in view q: no such column: x3}}
458 do_execsql_test 19.$tn.1 "
459 DROP VIEW IF EXISTS q;
463 do_catchsql_test 19.$tn.2 {
464 ALTER TABLE a RENAME TO g;
468 # Verify that the "if( pParse->nErr ) return WRC_Abort" at the top of the
469 # renameUnmapSelectCb() routine in alter.c (2019-12-04) is really required.
472 do_catchsql_test 20.10 {
473 CREATE TABLE s(a, b, c);
474 CREATE INDEX k ON s( (WITH s AS( SELECT * ) VALUES(2) ) IN () );
475 ALTER TABLE s RENAME a TO a2;
476 } {1 {error in index k: no tables specified}}
478 #------------------------------------------------------------------------
481 do_execsql_test 21.1 {
483 CREATE VIEW v AS SELECT (
484 WITH x(a) AS(SELECT * FROM s) VALUES(RIGHT)
487 ALTER TABLE a RENAME a TO b;
490 #------------------------------------------------------------------------
493 do_execsql_test 22.1 {
495 CREATE VIEW v2(b) AS SELECT * FROM v2;
498 do_catchsql_test 22.2 {
499 ALTER TABLE t1 RENAME TO t4;
500 } {1 {error in view v2: view v2 is circularly defined}}
502 do_execsql_test 22.3 {
504 CREATE VIEW v2(b) AS WITH t3 AS (SELECT b FROM v2) SELECT * FROM t3;
507 do_catchsql_test 22.4 {
508 ALTER TABLE t1 RENAME TO t4;
509 } {1 {error in view v2: view v2 is circularly defined}}
511 do_execsql_test 22.5 {
513 CREATE VIEW v2(b) AS WITH t3 AS (SELECT b FROM v2) VALUES(1);
516 do_catchsql_test 22.6 {
517 ALTER TABLE t1 RENAME TO t4;
520 #------------------------------------------------------------------------
523 do_execsql_test 23.1 {
525 CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
526 UPDATE t1 SET (c,d)=((SELECT 1 FROM t1 JOIN t2 ON b=x),1);
530 do_catchsql_test 23.2 {
531 ALTER TABLE t1 RENAME TO t1x;
532 } {1 {error in trigger r1: no such table: main.t2}}
534 #------------------------------------------------------------------------
537 do_execsql_test 23.1 {
539 CREATE VIEW v2 (v3) AS
540 WITH x1 AS (SELECT * FROM v2)
541 SELECT v3 AS x, v3 AS y FROM v2;
544 do_catchsql_test 23.2 {
546 } {1 {view v2 is circularly defined}}
551 do_catchsql_test 23.3 {
552 ALTER TABLE v0 RENAME TO t3 ;
553 } {1 {error in view v2: view v2 is circularly defined}}
555 #------------------------------------------------------------------------
558 do_execsql_test 24.1 {
559 CREATE TABLE v0 (v1);
560 CREATE TABLE v2 (v3 INTEGER UNIQUE ON CONFLICT ABORT);
561 CREATE TRIGGER x AFTER INSERT ON v2 WHEN (
562 ( SELECT v1 AS PROMO_REVENUE FROM v2 JOIN v0 USING ( VALUE ) ) AND 0 )
567 do_catchsql_test 24.2 {
568 ALTER TABLE v0 RENAME TO x ;
569 } {1 {error in trigger x: cannot join using column VALUE - column not present in both tables}}
571 do_execsql_test 24.3 {
573 CREATE TRIGGER x AFTER INSERT ON v2 WHEN (
574 0 AND (SELECT rowid FROM v0)
580 do_execsql_test 24.4 {
581 ALTER TABLE v0 RENAME TO xyz;
582 SELECT sql FROM sqlite_master WHERE type='trigger'
583 } {{CREATE TRIGGER x AFTER INSERT ON v2 WHEN (
584 0 AND (SELECT rowid FROM "xyz")
589 #------------------------------------------------------------------------
592 do_execsql_test 25.1 {
593 CREATE TABLE t1(a, b, c);
594 CREATE TABLE t2(a, b, c);
595 CREATE TRIGGER ttt AFTER INSERT ON t1 BEGIN
596 UPDATE t1 SET a=t2.a FROM t2 WHERE t1.a=t2.a;
599 #do_execsql_test 25.2 {
600 # ALTER TABLE t2 RENAME COLUMN a TO aaa;
603 #------------------------------------------------------------------------
606 do_execsql_test 26.1 {
612 CREATE TRIGGER tr1 INSERT ON t3 BEGIN
613 UPDATE t3 SET y=z FROM (SELECT z FROM t4);
616 CREATE TRIGGER tr2 INSERT ON t3 BEGIN
617 UPDATE t3 SET y=abc FROM (SELECT x AS abc FROM t1);
621 do_execsql_test 26.2 {
622 ALTER TABLE t1 RENAME TO t2;
625 do_execsql_test 26.3 {
626 ALTER TABLE t2 RENAME x TO xx;
629 do_execsql_test 26.4 {
630 SELECT sql FROM sqlite_schema WHERE name='tr2'
632 {CREATE TRIGGER tr2 INSERT ON t3 BEGIN
633 UPDATE t3 SET y=abc FROM (SELECT xx AS abc FROM "t2");
640 do_execsql_test 26.5 {
642 CREATE TRIGGER xx INSERT ON t1 BEGIN
643 UPDATE t1 SET xx=xx FROM(SELECT xx);
646 do_catchsql_test 26.6 {
647 ALTER TABLE t1 RENAME TO t2;
648 } {1 {error in trigger xx: no such column: xx}}
651 #-------------------------------------------------------------------------
654 do_execsql_test 27.1 {
655 CREATE TABLE t1(a, b AS ((WITH w1 (xyz) AS ( SELECT t1.b FROM t1 ) SELECT 123) IN ()), c);
658 do_execsql_test 27.2 {
659 ALTER TABLE t1 DROP COLUMN c;
660 SELECT sql FROM sqlite_schema WHERE name = 't1';
662 {CREATE TABLE t1(a, b AS ((WITH w1 (xyz) AS ( SELECT t1.b FROM t1 ) SELECT 123) IN ()))}
665 do_execsql_test 27.3 {
666 CREATE TABLE t0(c0 , c1 AS (CASE TRUE NOT IN () WHEN NULL THEN CASE + 0xa ISNULL WHEN NOT + 0x9 THEN t0.c1 ELSE CURRENT_TIME LIKE CAST (t0.c1 REGEXP '-([1-9]\d*.\d*|0\.\d*[1-9]\d*)'ESCAPE (c1) COLLATE BINARY BETWEEN c1 AND c1 NOT IN (WITH t4 (c0) AS (WITH t3 (c0) AS NOT MATERIALIZED (WITH RECURSIVE t2 (c0) AS (WITH RECURSIVE t1 AS (VALUES (x'717171ff71717171' ) ) SELECT DISTINCT t0.c0 FROM t0 NOT INDEXED WHERE t0.c0 =t0.c0 GROUP BY 0x9 ) SELECT DISTINCT t0.c0 FROM t0 NOT INDEXED WHERE t0.c0 =t0.c1 ) SELECT DISTINCT t0.c0 FROM t0 NOT INDEXED WHERE t0.c0 =t0.c0 GROUP BY typeof(0x9 ) ) SELECT DISTINCT t0.c0 FROM t0 NOT INDEXED WHERE t0.c0 =t0.c0 GROUP BY typeof(typeof(0x9 ) ) ) IN t0 BETWEEN typeof(typeof(typeof(hex(*) FILTER (WHERE + x'5ccd1e68' ) ) ) ) AND 1 >0xa AS BLOB (+4.4E4 , -0xe ) ) END <> c1 IN () END ) VIRTUAL , c35 PRIMARY KEY , c60 , c64 NUMERIC (-6.8 , -0xE ) ) WITHOUT ROWID ;
669 do_execsql_test 27.4 {
670 ALTER TABLE t0 DROP COLUMN c60;
673 #-------------------------------------------------------------------------
675 do_execsql_test 28.1 {
676 CREATE TABLE t1(a,b,c,d);
677 CREATE TRIGGER AFTER INSERT ON t1 BEGIN
678 UPDATE t1 SET (c,d)=(a,b);
680 ALTER TABLE t1 RENAME TO t2;
683 do_execsql_test 28.2 {
684 SELECT sql FROM sqlite_schema WHERE type='trigger'
685 } {{CREATE TRIGGER AFTER INSERT ON "t2" BEGIN
686 UPDATE "t2" SET (c,d)=(a,b);
690 #-------------------------------------------------------------------------
692 do_execsql_test 29.1 {
693 CREATE TABLE t1(x, y);
694 CREATE TRIGGER Trigger1 DELETE ON t1
696 SELECT t1.*, t1.x FROM t1 ORDER BY t1.x;
701 do_execsql_test 29.2 {
702 ALTER TABLE t1 RENAME x TO z;
705 do_execsql_test 29.3 {
706 ALTER TABLE t1 RENAME TO t2;
709 do_execsql_test 29.4 {
710 CREATE TRIGGER tr2 AFTER DELETE ON t2 BEGIN
717 do_execsql_test 29.5 {
721 do_execsql_test 29.6 {
722 ALTER TABLE t2 RENAME TO t3;
725 do_execsql_test 29.7 {
726 SELECT sql FROM sqlite_schema WHERE type='trigger'
728 {CREATE TRIGGER Trigger1 DELETE ON "t3"
730 SELECT "t3".*, "t3".z FROM "t3" ORDER BY "t3".z;
732 {CREATE TRIGGER tr2 AFTER DELETE ON "t3" BEGIN
734 SELECT "t3".* FROM "t3"