diff options
author | dlenev@mysql.com <> | 2005-08-23 09:15:05 +0400 |
---|---|---|
committer | dlenev@mysql.com <> | 2005-08-23 09:15:05 +0400 |
commit | 603dddfdb4b63653626d96fe2674f817fe862db7 (patch) | |
tree | 467166d0a2ca0bce473af30660ebeb4b83dc6792 /mysql-test/t/sp-error.test | |
parent | d74a148172ef875e0463f034554e4916bfd30814 (diff) | |
parent | 6c39364f85b6707caee8d7eaefe8fa62af298054 (diff) | |
download | mariadb-git-603dddfdb4b63653626d96fe2674f817fe862db7.tar.gz |
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/dlenev/src/mysql-5.0-bg11896
Diffstat (limited to 'mysql-test/t/sp-error.test')
-rw-r--r-- | mysql-test/t/sp-error.test | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test index 85b81f72f40..f68ea1b31a3 100644 --- a/mysql-test/t/sp-error.test +++ b/mysql-test/t/sp-error.test @@ -410,6 +410,35 @@ 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 # create procedure bug1965() |