Commit 897702bd authored by unknown's avatar unknown

Merge neptunus.(none):/home/msvensson/mysql/bug16878/my50-bug16878

into  neptunus.(none):/home/msvensson/mysql/bug16878/my51-bug16878


sql/sp_head.cc:
  Auto merged
mysql-test/r/mysqldump.result:
  Merge
mysql-test/t/mysqldump.test:
  Merge
parents 4f9e66da 1f12107f
......@@ -2650,3 +2650,39 @@ DELIMITER ;
DROP TRIGGER tr1;
DROP TABLE t1;
create table t1 (a int, created datetime);
create table t2 (b int, created datetime);
create trigger tr1 before insert on t1 for each row set
new.created=now();
create trigger tr2 after insert on t1
for each row
begin
insert into t2 set b=new.a and created=new.created;
end|
drop trigger tr1;
drop trigger tr2;
drop table t1, t2;
show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer
tr1 INSERT t1 set
new.created=now() BEFORE # root@localhost
tr2 INSERT t1 begin
insert into t2 set b=new.a and created=new.created;
end AFTER # root@localhost
drop trigger tr1;
drop trigger tr2;
drop table t1, t2;
/*!50003 CREATE FUNCTION `f`() RETURNS bigint(20)
return 42 */|
/*!50003 CREATE PROCEDURE `p`()
select 42 */|
show create function f;
Function sql_mode Create Function
f CREATE FUNCTION `f`() RETURNS bigint(20)
return 42
show create procedure p;
Procedure sql_mode Create Procedure
p CREATE PROCEDURE `p`()
select 42
drop function f;
drop procedure p;
......@@ -1048,3 +1048,51 @@ SET SQL_MODE = @old_sql_mode;
DROP TRIGGER tr1;
DROP TABLE t1;
#
# Bug #16878 dump of trigger
#
create table t1 (a int, created datetime);
create table t2 (b int, created datetime);
create trigger tr1 before insert on t1 for each row set
new.created=now();
delimiter |;
create trigger tr2 after insert on t1
for each row
begin
insert into t2 set b=new.a and created=new.created;
end|
delimiter ;|
# dump table and trigger
--exec $MYSQL_DUMP test > var/tmp/bug16878.sql
drop trigger tr1;
drop trigger tr2;
drop table t1, t2;
# reload dump
--exec $MYSQL test < var/tmp/bug16878.sql
--replace_column 6 #
show triggers;
drop trigger tr1;
drop trigger tr2;
drop table t1, t2;
#
# Bug#14857 Reading dump files with single statement stored routines fails.
# fixed by patch for bug#16878
#
#
DELIMITER |;
/*!50003 CREATE FUNCTION `f`() RETURNS bigint(20)
return 42 */|
/*!50003 CREATE PROCEDURE `p`()
select 42 */|
DELIMITER ;|
show create function f;
show create procedure p;
drop function f;
drop procedure p;
......@@ -1624,6 +1624,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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment