1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

BUG#952583: Server crashes in Item_field::fix_after_pullout on INSERT .. SELECT

- Take into account that there may exist Item_field objects with context==NULL.
This commit is contained in:
Sergey Petrunya
2012-03-19 01:04:55 +04:00
parent 5338a28912
commit 91d17a9c20
4 changed files with 50 additions and 11 deletions

View File

@ -2628,4 +2628,15 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 100 Using where; Using join buffer (flat, BNL join)
drop table t0,t1,t3;
set optimizer_switch= @tmp_923246;
#
# BUG#952583: Server crashes in Item_field::fix_after_pullout on INSERT .. SELECT
#
CREATE TABLE t1 ( a INT );
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 ( b INT );
INSERT INTO t2 VALUES (3),(4);
INSERT INTO t1
SELECT * FROM ( SELECT * FROM t1 ) AS alias
WHERE a IN ( SELECT b FROM t2 );
DROP TABLE t1, t2;
set optimizer_switch=@subselect_sj_tmp;

View File

@ -2642,6 +2642,17 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 100 Using where; Using join buffer (flat, BNL join)
drop table t0,t1,t3;
set optimizer_switch= @tmp_923246;
#
# BUG#952583: Server crashes in Item_field::fix_after_pullout on INSERT .. SELECT
#
CREATE TABLE t1 ( a INT );
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 ( b INT );
INSERT INTO t2 VALUES (3),(4);
INSERT INTO t1
SELECT * FROM ( SELECT * FROM t1 ) AS alias
WHERE a IN ( SELECT b FROM t2 );
DROP TABLE t1, t2;
set optimizer_switch=@subselect_sj_tmp;
#
# BUG#49129: Wrong result with IN-subquery with join_cache_level=6 and firstmatch=off

View File

@ -2331,5 +2331,19 @@ explain select * from t3 where a in (select kp1 from t1 where kp1<20);
drop table t0,t1,t3;
set optimizer_switch= @tmp_923246;
--echo #
--echo # BUG#952583: Server crashes in Item_field::fix_after_pullout on INSERT .. SELECT
--echo #
CREATE TABLE t1 ( a INT );
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 ( b INT );
INSERT INTO t2 VALUES (3),(4);
INSERT INTO t1
SELECT * FROM ( SELECT * FROM t1 ) AS alias
WHERE a IN ( SELECT b FROM t2 );
DROP TABLE t1, t2;
# The following command must be the last one the file
set optimizer_switch=@subselect_sj_tmp;