From 993b173e5551f08e84473fab8fe6afdee6454bea Mon Sep 17 00:00:00 2001 From: danielk1977 Date: Tue, 28 May 2002 06:55:27 +0000 Subject: [PATCH] Update trigger2.test to match checkin 591. Also fix ticket #51 (by documenting problem) (CVS 595) FossilOrigin-Name: 5e74d0964b8fd99eda798e3737217aa499cc1726 --- manifest | 16 ++++++++-------- manifest.uuid | 2 +- test/trigger2.test | 18 ++++++++++-------- www/lang.tcl | 23 ++++++++++++++++------- 4 files changed, 35 insertions(+), 24 deletions(-) diff --git a/manifest b/manifest index 973330a863..eb49ad9a36 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C A\sSELECT\sstatement\sinside\sthe\sbody\sof\sa\sTRIGGER\suses\sthe\sSRT_Discard\starget\nto\sdiscard\sthe\squery\sresults.\s\sSuch\sselects\sare\sintended\sto\sbe\sused\sto\scall\nuser-defined\sfunctions\sfor\stheir\sside-effects.\s\sThey\sdo\snot\sreturn\sresults.\s(CVS\s594) -D 2002-05-27T12:24:48 +C Update\strigger2.test\sto\smatch\scheckin\s591.\sAlso\sfix\sticket\s#51\s(by\sdocumenting\sproblem)\s(CVS\s595) +D 2002-05-28T06:55:27 F Makefile.in 6291a33b87d2a395aafd7646ee1ed562c6f2c28c F Makefile.template 4e11752e0b5c7a043ca50af4296ec562857ba495 F README a4c0ba11354ef6ba0776b400d057c59da47a4cc0 @@ -101,7 +101,7 @@ F test/temptable.test daa83489eea2e9aaeeece09675c28be84c72cb67 F test/tester.tcl dc1b56bd628b487e4d75bfd1e7480b5ed8810ac6 F test/trans.test ae0b9a82d5d34122c3a3108781eb8d078091ccee F test/trigger1.test bb63749fa8a395a60541100607d86381604b7194 -F test/trigger2.test 7f2b0a9b20004449c78b834c2f22494db3b2e63a +F test/trigger2.test c12759a0d7ba6488d9d24c96a1352ddee995c1ab F test/unique.test 572aa791327c1e8d797932263e9d67f176cfdb44 F test/update.test a0aa0bf83e6fad8407d0e4ad25ebb09b513f5bf4 F test/vacuum.test 059871b312eb910bbe49dafde1d01490cc2c6bbe @@ -128,14 +128,14 @@ F www/dynload.tcl 02eb8273aa78cfa9070dd4501dca937fb22b466c F www/faq.tcl 45bdb18b75ac3aa1befec42985fb892413aac0bb F www/formatchng.tcl 2ce21ff30663fad6618198fe747ce675df577590 F www/index.tcl d0c52fbf031d0a3ee6d9d77aa669d5a4b24b6130 -F www/lang.tcl e87aa6b305d92977a6bd84bfcddd18fa76dff60a +F www/lang.tcl bbff2febcccbe34de75e4eebfea3799483d224ce F www/mingw.tcl f1c7c0a7f53387dd9bb4f8c7e8571b7561510ebc F www/opcode.tcl bdec8ef9f100dbd87bbef8976c54b88e43fd8ccc F www/speed.tcl da8afcc1d3ccc5696cfb388a68982bc3d9f7f00f F www/sqlite.tcl 8b5884354cb615049aed83039f8dfe1552a44279 F www/tclsqlite.tcl 1db15abeb446aad0caf0b95b8b9579720e4ea331 F www/vdbe.tcl 2013852c27a02a091d39a766bc87cff329f21218 -P f562d542304c0c1b18b0cee78b1ecc353327a02e -R 4bed1abb134d55e95bd53603b51baff9 -U drh -Z 69f73daa36e6cf51d72c20768fddcd68 +P f8041f3d4d3350b4086cd6ba3e9006bdde8546a9 +R dcf69cfc889213b158f1eb6566b040bc +U danielk1977 +Z 836623c82517c3cf20d6687f62fbc098 diff --git a/manifest.uuid b/manifest.uuid index 9bc3b5b77d..1c3ce10b84 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -f8041f3d4d3350b4086cd6ba3e9006bdde8546a9 \ No newline at end of file +5e74d0964b8fd99eda798e3737217aa499cc1726 \ No newline at end of file diff --git a/test/trigger2.test b/test/trigger2.test index ae103ea85b..233a9252fe 100644 --- a/test/trigger2.test +++ b/test/trigger2.test @@ -554,29 +554,29 @@ do_test trig-7.1 { CREATE VIEW abcd AS SELECT a, b, c, d FROM ab, cd; - CREATE TRIGGER before_update BEFORE UPDATE ON abcd BEGIN + CREATE TRIGGER before_update INSTEAD OF UPDATE ON abcd BEGIN INSERT INTO tlog VALUES(NULL, old.a, old.b, old.c, old.d, new.a, new.b, new.c, new.d); END; - CREATE TRIGGER after_update AFTER UPDATE ON abcd BEGIN + CREATE TRIGGER after_update INSTEAD OF UPDATE ON abcd BEGIN INSERT INTO tlog VALUES(NULL, old.a, old.b, old.c, old.d, new.a, new.b, new.c, new.d); END; - CREATE TRIGGER before_delete BEFORE DELETE ON abcd BEGIN + CREATE TRIGGER before_delete INSTEAD OF DELETE ON abcd BEGIN INSERT INTO tlog VALUES(NULL, old.a, old.b, old.c, old.d, 0, 0, 0, 0); END; - CREATE TRIGGER after_delete AFTER DELETE ON abcd BEGIN + CREATE TRIGGER after_delete INSTEAD OF DELETE ON abcd BEGIN INSERT INTO tlog VALUES(NULL, old.a, old.b, old.c, old.d, 0, 0, 0, 0); END; - CREATE TRIGGER before_insert BEFORE INSERT ON abcd BEGIN + CREATE TRIGGER before_insert INSTEAD OF INSERT ON abcd BEGIN INSERT INTO tlog VALUES(NULL, 0, 0, 0, 0, new.a, new.b, new.c, new.d); END; - CREATE TRIGGER after_insert AFTER INSERT ON abcd BEGIN + CREATE TRIGGER after_insert INSTEAD OF INSERT ON abcd BEGIN INSERT INTO tlog VALUES(NULL, 0, 0, 0, 0, new.a, new.b, new.c, new.d); END; @@ -592,7 +592,9 @@ do_test trig-7.2 { } } [ list 1 1 2 3 4 100 25 3 4 \ 2 1 2 3 4 100 25 3 4 \ - 3 1 2 3 4 0 0 0 0 4 1 2 3 4 0 0 0 0 \ - 5 0 0 0 0 10 20 30 40 6 0 0 0 0 10 20 30 40 ] + 3 1 2 3 4 0 0 0 0 \ + 4 1 2 3 4 0 0 0 0 \ + 5 0 0 0 0 10 20 30 40 \ + 6 0 0 0 0 10 20 30 40 ] finish_test diff --git a/www/lang.tcl b/www/lang.tcl index e12fa55aa9..7bc21b0f21 100644 --- a/www/lang.tcl +++ b/www/lang.tcl @@ -1,7 +1,7 @@ # # Run this Tcl script to generate the sqlite.html file. # -set rcsid {$Id: lang.tcl,v 1.36 2002/05/26 23:24:41 danielk1977 Exp $} +set rcsid {$Id: lang.tcl,v 1.37 2002/05/28 06:55:27 danielk1977 Exp $} puts { @@ -455,6 +455,15 @@ CREATE TRIGGER update_customer_address UPDATE OF address ON customers puts {

With this trigger installed, executing the statement:

} +puts { +

Note that currently, triggers may behave oddly when created on tables + with INTEGER PRIMARY KEY fields. If a BEFORE trigger program modifies the + INTEGER PRIMARY KEY field of a row that will be subsequently updated by the + statement that causes the trigger to fire, then the update may not occur. + The workaround is to declare the table with a PRIMARY KEY column instead + of an INTEGER PRIMARY KEY column.

+} + Example { UPDATE customers SET address = '1 Main St.' WHERE name = 'Jack Jones'; } @@ -517,6 +526,12 @@ Syntax {sql-command} { DROP TABLE } +puts { +

The DROP TABLE statement consists of the keywords "DROP TABLE" followed +by the name of the table. The table named is completely removed from +the disk. The table can not be recovered. All indices associated with +the table are also deleted.

} + Section {DROP TRIGGER} droptrigger Syntax {sql-statement} { DROP TRIGGER @@ -526,12 +541,6 @@ puts { are automatically dropped when the associated table is dropped.

} -puts { -

The DROP TABLE statement consists of the keywords "DROP TABLE" followed -by the name of the table. The table named is completely removed from -the disk. The table can not be recovered. All indices associated with -the table are also deleted.

} - Section {DROP VIEW} dropview Syntax {sql-command} {