mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/dlenev/src/mysql-5.0-bg12280 sql/sql_parse.cc: Auto merged sql/share/errmsg.txt: Auto merged
This commit is contained in:
@ -247,7 +247,7 @@ end|
|
||||
ERROR 42000: Duplicate cursor: c
|
||||
create procedure u()
|
||||
use sptmp|
|
||||
ERROR 42000: USE is not allowed in a stored procedure
|
||||
ERROR 0A000: USE is not allowed in stored procedures
|
||||
create procedure p()
|
||||
begin
|
||||
declare c cursor for select * from t1;
|
||||
@ -616,7 +616,7 @@ begin
|
||||
flush tables;
|
||||
return 5;
|
||||
end|
|
||||
ERROR 0A000: FLUSH is not allowed in stored procedures
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
create procedure bug9529_90123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123()
|
||||
begin
|
||||
end|
|
||||
|
@ -2,6 +2,7 @@ drop table if exists t1, t2, t3;
|
||||
drop view if exists v1;
|
||||
drop database if exists mysqltest;
|
||||
drop function if exists f1;
|
||||
drop procedure if exists p1;
|
||||
create table t1 (i int);
|
||||
create trigger trg before insert on t1 for each row set @a:=1;
|
||||
set @a:=0;
|
||||
@ -635,3 +636,18 @@ show triggers;
|
||||
Trigger Event Table Statement Timing Created sql_mode
|
||||
t1_bi INSERT t1 set new.a = '2004-01-00' BEFORE #
|
||||
drop table t1;
|
||||
create table t1 (id int);
|
||||
create trigger t1_ai after insert on t1 for each row flush tables;
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
create trigger t1_ai after insert on t1 for each row flush privileges;
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
create procedure p1() flush tables;
|
||||
create trigger t1_ai after insert on t1 for each row call p1();
|
||||
insert into t1 values (0);
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
drop procedure p1;
|
||||
create procedure p1() flush privileges;
|
||||
insert into t1 values (0);
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
drop procedure p1;
|
||||
drop table t1;
|
||||
|
@ -334,7 +334,7 @@ begin
|
||||
end|
|
||||
|
||||
# USE is not allowed
|
||||
--error 1336
|
||||
--error ER_SP_BADSTATEMENT
|
||||
create procedure u()
|
||||
use sptmp|
|
||||
|
||||
@ -885,7 +885,7 @@ create procedure bug10537()
|
||||
--disable_warnings
|
||||
drop function if exists bug8409|
|
||||
--enable_warnings
|
||||
--error ER_SP_BADSTATEMENT
|
||||
--error ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG
|
||||
create function bug8409()
|
||||
returns int
|
||||
begin
|
||||
|
@ -7,6 +7,7 @@ drop table if exists t1, t2, t3;
|
||||
drop view if exists v1;
|
||||
drop database if exists mysqltest;
|
||||
drop function if exists f1;
|
||||
drop procedure if exists p1;
|
||||
--enable_warnings
|
||||
|
||||
create table t1 (i int);
|
||||
@ -642,3 +643,22 @@ show create table t1;
|
||||
--replace_column 6 #
|
||||
show triggers;
|
||||
drop table t1;
|
||||
|
||||
# Test for bug #12280 "Triggers: crash if flush tables"
|
||||
# FLUSH TABLES and FLUSH PRIVILEGES should be disallowed inside
|
||||
# of functions and triggers.
|
||||
create table t1 (id int);
|
||||
--error ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG
|
||||
create trigger t1_ai after insert on t1 for each row flush tables;
|
||||
--error ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG
|
||||
create trigger t1_ai after insert on t1 for each row flush privileges;
|
||||
create procedure p1() flush tables;
|
||||
create trigger t1_ai after insert on t1 for each row call p1();
|
||||
--error ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG
|
||||
insert into t1 values (0);
|
||||
drop procedure p1;
|
||||
create procedure p1() flush privileges;
|
||||
--error ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG
|
||||
insert into t1 values (0);
|
||||
drop procedure p1;
|
||||
drop table t1;
|
||||
|
Reference in New Issue
Block a user