mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/dlenev/src/mysql-5.0-bg11896 mysql-test/t/sp-error.test: Auto merged mysql-test/t/trigger.test: Auto merged sql/sql_base.cc: Auto merged mysql-test/r/trigger.result: Manual merge. sql/share/errmsg.txt: Manual merge.
This commit is contained in:
@ -409,6 +409,35 @@ lock tables mysql.proc write|
|
||||
unlock tables|
|
||||
|
||||
|
||||
#
|
||||
# Check that in functions we don't allow to update tables which
|
||||
# are used by statements which invoke these functions.
|
||||
#
|
||||
--disable_warnings
|
||||
drop function if exists f1|
|
||||
--enable_warnings
|
||||
create function f1(i int) returns int
|
||||
begin
|
||||
insert into t1 (val) values (i);
|
||||
return 0;
|
||||
end|
|
||||
--error ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG
|
||||
select val, f1(val) from t1|
|
||||
# Table alias should not matter
|
||||
--error ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG
|
||||
select val, f1(val) from t1 as tab|
|
||||
select * from t1|
|
||||
--error ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG
|
||||
update t1 set val= f1(val)|
|
||||
select * from t1|
|
||||
# But this should be OK
|
||||
select f1(17)|
|
||||
select * from t1|
|
||||
# Cleanup
|
||||
delete from t1 where val= 17|
|
||||
drop function f1|
|
||||
|
||||
|
||||
#
|
||||
# BUG#1965
|
||||
#
|
||||
|
Reference in New Issue
Block a user