summaryrefslogtreecommitdiff
path: root/sql/sp_head.cc
diff options
context:
space:
mode:
authorunknown <msvensson@neptunus.(none)>2006-02-09 11:05:28 +0100
committerunknown <msvensson@neptunus.(none)>2006-02-09 11:05:28 +0100
commit2caa5608c6c3f5eba5974a69b1d29b25d4eda280 (patch)
tree3a010fa892bff73ed77c080ee37a7d3b009cccfd /sql/sp_head.cc
parentf220f892124878c8ef202b847f292f7f05d83d2e (diff)
downloadmariadb-git-2caa5608c6c3f5eba5974a69b1d29b25d4eda280.tar.gz
Bug#16878 dump of trigger
- Pass "in_comment" variable on to new lex in sp_head::reset_lex - Add testcases for dumping and reloading trigger without BEGIN/END mysql-test/r/mysqldump.result: Update test result mysql-test/t/mysqldump.test: Add test for dumping trigger without begin/end, and test that the output from mysqldump can be reloaded. sql/sp_head.cc: If already in a comment before parsing a substatement, set in_comment in the new lex as well. This will handle cases where the comment starts before the substatement, which is common in output from mysqldump to mask away syntax not supported by earlier versions of MySQL. Ex: /*!50003 CREATE TRIGGER `tr1` BEFORE INSERT ON `t1` FOR EACH ROW set new.created=now() */; ^=== sp_head::reset_lex is called when already in comment
Diffstat (limited to 'sql/sp_head.cc')
-rw-r--r--sql/sp_head.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index 96bf2c51b02..df993d304b1 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -1584,6 +1584,8 @@ sp_head::reset_lex(THD *thd)
sublex->trg_table_fields.empty();
sublex->sp_lex_in_use= FALSE;
+ sublex->in_comment= oldlex->in_comment;
+
/* Reset type info. */
sublex->charset= NULL;