diff options
author | unknown <evgen@moonbone.local> | 2005-11-24 19:16:51 +0300 |
---|---|---|
committer | unknown <evgen@moonbone.local> | 2005-11-24 19:16:51 +0300 |
commit | 3190b21f95e58886e1507384bf792ed68a9f8397 (patch) | |
tree | 16784e30c0a37d173e3e44faee2f209c32a2b58a /mysql-test/t/select.test | |
parent | 1484d54821ff70c2acc43f851ff97fddff0b156c (diff) | |
download | mariadb-git-3190b21f95e58886e1507384bf792ed68a9f8397.tar.gz |
Fix bug #14482 Wrongly applied optimization in resolve_const_item() caused
crash
resolve_const_item() substitutes item which will evaluate to constant with
equvalent constant item, basing on the item's result type. In this case
subselect was resolved as constant, and resolve_const_item() was substituting
it's result's Item_caches to Item_null. Later Item_cache's function was called
for Item_null object, which caused server crash.
resolve_const_item() now substitutes constants for items with
result_type == ROW_RESULT only for Item_rows.
sql/item.cc:
Fix bug #14482 Wrongly applied optimization in resolve_const_item() caused
crash
resolve_const_item() now applies optimization for items with
result_type == ROW_RESULT only to Item_rows.
mysql-test/t/select.test:
Test case for bug #14482 Wrongly applied optimization in resolve_const_item() caused crash
mysql-test/r/select.result:
Test case for bug #14482 Wrongly applied optimization in resolve_const_item() caused crash
Diffstat (limited to 'mysql-test/t/select.test')
-rw-r--r-- | mysql-test/t/select.test | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 39c7cdfa8a9..996d5854854 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -2237,4 +2237,15 @@ insert into t1 values (1,1); insert into t2 values (1,1),(1,2); select distinct count(f2) >0 from t1 left join t2 on f1=f3 group by f1; drop table t1,t2; + +# +# Bug #14482 Server crash when subselecting from the same table +# +create table t1 (f1 int,f2 int); +insert into t1 values(1,1); +create table t2 (f3 int, f4 int, primary key(f3,f4)); +insert into t2 values(1,1); +select * from t1 where f1 in (select f3 from t2 where (f3,f4)= (select f3,f4 from t2)); +drop table t1,t2; + # End of 4.1 tests |