summaryrefslogtreecommitdiff
path: root/mysql-test/r/sp-prelocking.result
diff options
context:
space:
mode:
authorunknown <dlenev@mysql.com>2006-06-21 01:50:20 +0400
committerunknown <dlenev@mysql.com>2006-06-21 01:50:20 +0400
commite9452db1c1b7fb534a44590312d6608640675350 (patch)
tree47d48c79ace5fcdbac5cd5c1f69187657896bc25 /mysql-test/r/sp-prelocking.result
parent375a1894512b80302fb73858759050d3d56b58bf (diff)
downloadmariadb-git-e9452db1c1b7fb534a44590312d6608640675350.tar.gz
Fix for bug#19634 "Re-execution of multi-delete which involve trigger/stored
function crashes server". Attempts to execute prepared multi-delete statement which involved trigger or stored function caused server crashes (the same happened for such statements included in stored procedures in cases when one tried to execute them more than once). The problem was caused by yet another incorrect usage of check_table_access() routine (the latter assumes that table list which it gets as argument corresponds to value LEX::query_tables_own_last). We solve this problem by juggling with LEX::query_tables_own_last value when we call check_table_access() for LEX::auxilliary_table_list (better solution is too intrusive and should be done in 5.1). mysql-test/r/sp-prelocking.result: Added test for bug#19634 "Re-execution of multi-delete which involve trigger/ stored function crashes server". mysql-test/t/sp-prelocking.test: Added test for bug#19634 "Re-execution of multi-delete which involve trigger/ stored function crashes server". sql/sql_parse.cc: To call safely check_table_access() for LEX::auxilliary_table_list we have to juggle with LEX::query_tables_own_last value.
Diffstat (limited to 'mysql-test/r/sp-prelocking.result')
-rw-r--r--mysql-test/r/sp-prelocking.result18
1 files changed, 18 insertions, 0 deletions
diff --git a/mysql-test/r/sp-prelocking.result b/mysql-test/r/sp-prelocking.result
index 2335513b28a..7d8dd862748 100644
--- a/mysql-test/r/sp-prelocking.result
+++ b/mysql-test/r/sp-prelocking.result
@@ -237,3 +237,21 @@ deallocate prepare stmt;
drop table t1;
drop view v1, v2, v3;
drop function bug15683;
+drop table if exists t1, t2, t3;
+drop function if exists bug19634;
+create table t1 (id int, data int);
+create table t2 (id int);
+create table t3 (data int);
+create function bug19634() returns int return (select count(*) from t3);
+prepare stmt from "delete t1 from t1, t2 where t1.id = t2.id and bug19634()";
+execute stmt;
+execute stmt;
+deallocate prepare stmt;
+create trigger t1_bi before delete on t1 for each row insert into t3 values (old.data);
+prepare stmt from "delete t1 from t1, t2 where t1.id = t2.id";
+execute stmt;
+execute stmt;
+deallocate prepare stmt;
+drop function bug19634;
+drop table t1, t2, t3;
+End of 5.0 tests