diff options
author | unknown <ramil@mysql.com> | 2006-03-23 18:09:35 +0400 |
---|---|---|
committer | unknown <ramil@mysql.com> | 2006-03-23 18:09:35 +0400 |
commit | abffce9cadb9db491e76f681f8a4c055f5d70958 (patch) | |
tree | 365dbc0bdd69a835bb81f738f3f65d77577fdd1d /mysql-test/t/subselect.test | |
parent | 0ef3cd6c701fa07aff2db95a76f5cef079f68c39 (diff) | |
download | mariadb-git-abffce9cadb9db491e76f681f8a4c055f5d70958.tar.gz |
Fix for bug #18306: MySQL crashes and restarts using subquery
mysql-test/r/subselect.result:
Fix for bug #18306: MySQL crashes and restarts using subquery
test case
mysql-test/t/subselect.test:
Fix for bug #18306: MySQL crashes and restarts using subquery
test case
sql/opt_range.cc:
Fix for bug #18306: MySQL crashes and restarts using subquery
Restore thd->mem_root because
during the cond->val_int() evaluation we can come across a subselect
item which may allocate memory on the thd->mem_root and assumes
all the memory allocated has the same life span as the subselect
item itself.
Diffstat (limited to 'mysql-test/t/subselect.test')
-rw-r--r-- | mysql-test/t/subselect.test | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 368020dd721..1ef80bdd7ac 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -2074,3 +2074,14 @@ create table t1( f1 int,f2 int); insert into t1 values (1,1),(2,2); select tt.t from (select 'crash1' as t, f2 from t1) as tt left join t1 on tt.t = 'crash2' and tt.f2 = t1.f2 where tt.t = 'crash1'; drop table t1; + +# +# Bug #18306: server crash on delete using subquery. +# + +create table t1 (c int, key(c)); +insert into t1 values (1142477582), (1142455969); +create table t2 (a int, b int); +insert into t2 values (2, 1), (1, 0); +delete from t1 where c <= 1140006215 and (select b from t2 where a = 2) = 1; +drop table t1, t2; |