Commit 9eca5889 authored by unknown's avatar unknown

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

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


sql/sp_head.cc:
  Auto merged
mysql-test/r/mysqldump.result:
  Merge
mysql-test/t/mysqldump.test:
  Merge
parents c9d8cb49 1f12107f
......@@ -2657,3 +2657,39 @@ a
789
drop table t1;
drop view v1, v2, v3, v4, v5;
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;
......@@ -1066,3 +1066,50 @@ select * from v3 order by a;
drop table t1;
drop view v1, v2, v3, v4, v5;
#
# 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;
......@@ -1603,6 +1603,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