From 36f34c1c7edbd9f0f4e40cf616acfad77738d573 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 29 Jun 2005 10:35:49 +0400 Subject: [PATCH] Added test for bug #5893 "Triggers with dropped functions cause crashes" (The bug itself was fixed earlier by the patch that fixed bug #5860 "Multi-table UPDATE does not activate update triggers" and several other bugs). mysql-test/r/trigger.result: Added test for bug #5893 "Triggers with dropped functions cause crashes" mysql-test/t/trigger.test: Added test for bug #5893 "Triggers with dropped functions cause crashes" --- mysql-test/r/trigger.result | 9 +++++++++ mysql-test/t/trigger.test | 14 ++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/mysql-test/r/trigger.result b/mysql-test/r/trigger.result index 996a692d531..0bb1fd1d550 100644 --- a/mysql-test/r/trigger.result +++ b/mysql-test/r/trigger.result @@ -482,3 +482,12 @@ i k ts 1 1 0000-00-00 00:00:00 2 2 0000-00-00 00:00:00 drop table t1, t2; +drop function if exists bug5893; +create table t1 (col1 int, col2 int); +insert into t1 values (1, 2); +create function bug5893 () returns int return 5; +create trigger t1_bu before update on t1 for each row set new.col1= bug5893(); +drop function bug5893; +update t1 set col2 = 4; +ERROR 42000: FUNCTION test.bug5893 does not exist +drop table t1; diff --git a/mysql-test/t/trigger.test b/mysql-test/t/trigger.test index 0c5ef077159..05241772693 100644 --- a/mysql-test/t/trigger.test +++ b/mysql-test/t/trigger.test @@ -494,3 +494,17 @@ replace into t1 (i, k) values (2, 11); select * from t1; # Also drops all triggers drop table t1, t2; + +# Test for bug #5893 "Triggers with dropped functions cause crashes" +# Appropriate error should be reported instead of crash. +--disable_warnings +drop function if exists bug5893; +--enable_warnings +create table t1 (col1 int, col2 int); +insert into t1 values (1, 2); +create function bug5893 () returns int return 5; +create trigger t1_bu before update on t1 for each row set new.col1= bug5893(); +drop function bug5893; +--error 1305 +update t1 set col2 = 4; +drop table t1;