mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
Fix for bug #1727 ( Crash in EXPLAIN & UNION & derived)
another version of the fix. Here i removed a loop that seems to be superfluous
This commit is contained in:
parent
8a41df536c
commit
a88f4ea30f
3 changed files with 25 additions and 29 deletions
|
@ -228,3 +228,20 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||||
2 DERIVED t1 ALL NULL NULL NULL NULL 2 Using where
|
2 DERIVED t1 ALL NULL NULL NULL NULL 2 Using where
|
||||||
3 DEPENDENT SUBQUERY B ALL NULL NULL NULL NULL 2 Using where
|
3 DEPENDENT SUBQUERY B ALL NULL NULL NULL NULL 2 Using where
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
create table t1 (a int);
|
||||||
|
insert into t1 values (1),(2);
|
||||||
|
select * from ( select * from t1 union select * from t1) a,(select * from t1 union select * from t1) b;
|
||||||
|
a a
|
||||||
|
1 1
|
||||||
|
2 1
|
||||||
|
1 2
|
||||||
|
2 2
|
||||||
|
explain select * from ( select * from t1 union select * from t1) a,(select * from t1 union select * from t1) b;
|
||||||
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
|
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2
|
||||||
|
1 PRIMARY <derived4> ALL NULL NULL NULL NULL 2
|
||||||
|
4 DERIVED t1 ALL NULL NULL NULL NULL 2
|
||||||
|
5 UNION t1 ALL NULL NULL NULL NULL 2
|
||||||
|
2 DERIVED t1 ALL NULL NULL NULL NULL 2
|
||||||
|
3 UNION t1 ALL NULL NULL NULL NULL 2
|
||||||
|
drop table t1;
|
||||||
|
|
|
@ -132,3 +132,9 @@ insert into t1 VALUES(1,1,1), (2,2,1);
|
||||||
select count(*) from t1 INNER JOIN (SELECT A.E1, A.E2, A.E3 FROM t1 AS A WHERE A.E3 = (SELECT MAX(B.E3) FROM t1 AS B WHERE A.E2 = B.E2)) AS THEMAX ON t1.E1 = THEMAX.E2 AND t1.E1 = t1.E2;
|
select count(*) from t1 INNER JOIN (SELECT A.E1, A.E2, A.E3 FROM t1 AS A WHERE A.E3 = (SELECT MAX(B.E3) FROM t1 AS B WHERE A.E2 = B.E2)) AS THEMAX ON t1.E1 = THEMAX.E2 AND t1.E1 = t1.E2;
|
||||||
explain select count(*) from t1 INNER JOIN (SELECT A.E1, A.E2, A.E3 FROM t1 AS A WHERE A.E3 = (SELECT MAX(B.E3) FROM t1 AS B WHERE A.E2 = B.E2)) AS THEMAX ON t1.E1 = THEMAX.E2 AND t1.E1 = t1.E2;
|
explain select count(*) from t1 INNER JOIN (SELECT A.E1, A.E2, A.E3 FROM t1 AS A WHERE A.E3 = (SELECT MAX(B.E3) FROM t1 AS B WHERE A.E2 = B.E2)) AS THEMAX ON t1.E1 = THEMAX.E2 AND t1.E1 = t1.E2;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
create table t1 (a int);
|
||||||
|
insert into t1 values (1),(2);
|
||||||
|
select * from ( select * from t1 union select * from t1) a,(select * from t1 union select * from t1) b;
|
||||||
|
explain select * from ( select * from t1 union select * from t1) a,(select * from t1 union select * from t1) b;
|
||||||
|
drop table t1;
|
||||||
|
|
|
@ -1269,28 +1269,6 @@ bool st_select_lex::test_limit()
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Interface method of table list creation for query
|
Interface method of table list creation for query
|
||||||
|
|
||||||
|
@ -1315,13 +1293,8 @@ bool st_select_lex_unit::create_total_list(THD *thd, st_lex *lex,
|
||||||
bool check_derived)
|
bool check_derived)
|
||||||
{
|
{
|
||||||
*result= 0;
|
*result= 0;
|
||||||
for (SELECT_LEX_UNIT *unit= this; unit; unit= unit->next_unit())
|
res= create_total_list_n_last_return(thd, lex, &result, check_derived);
|
||||||
{
|
return res;
|
||||||
if ((res= unit->create_total_list_n_last_return(thd, lex, &result,
|
|
||||||
check_derived)))
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue