summaryrefslogtreecommitdiff
path: root/mysql-test/t/mysql_comments.sql
diff options
context:
space:
mode:
authorkaa@polly.(none) <>2007-11-02 16:40:08 +0300
committerkaa@polly.(none) <>2007-11-02 16:40:08 +0300
commit794274ab10c1ac08e3596d6551f26f545dc8cbc6 (patch)
tree7b9685803c96afda5463e4a89aec2920daa2896d /mysql-test/t/mysql_comments.sql
parent4b12f94394834256f118d4d463bd2d8ae5b5912d (diff)
downloadmariadb-git-794274ab10c1ac08e3596d6551f26f545dc8cbc6.tar.gz
5.1-specific changes for bug #26215 after merging the patch from 5.0:
- Added trigger tests back. - Fixed test cases to match the extended output format of SHOW CREATE ... - Replaced 'gptr' with 'uchar *'.
Diffstat (limited to 'mysql-test/t/mysql_comments.sql')
-rw-r--r--mysql-test/t/mysql_comments.sql45
1 files changed, 43 insertions, 2 deletions
diff --git a/mysql-test/t/mysql_comments.sql b/mysql-test/t/mysql_comments.sql
index 60b223a240f..2497c35e465 100644
--- a/mysql-test/t/mysql_comments.sql
+++ b/mysql-test/t/mysql_comments.sql
@@ -167,8 +167,49 @@ delimiter ;
show create procedure nicesp;
drop procedure nicesp;
-# Triggers can be tested only in 5.1, since 5.0 does not have
-# SHOW CREATE TRIGGER
+##============================================================================
+## Comments inside triggers
+##============================================================================
+
+drop trigger if exists t1_empty;
+
+create trigger t1_empty after delete on t1
+for each row
+begin
+end;
+
+show create trigger t1_empty;
+
+drop trigger if exists t1_bi;
+
+delimiter |
+
+create trigger t1_bi before insert on t1
+for each row
+begin
+# comment 1a
+-- comment 1b
+/*
+ comment 1c
+*/
+ -- declare some variables here
+ declare b int;
+ declare c float;
+
+ -- do more stuff here
+ -- commented nicely and so on
+
+ -- famous last words ...
+ set NEW.data := 12;
+end|
+
+delimiter ;
+
+show create trigger t1_bi;
+
+# also make sure the trigger still works
+insert into t1(id) value ("trig");
+select * from t1;
##============================================================================
## Cleanup