mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Merge 5.3->5.5
This commit is contained in:
@ -438,6 +438,33 @@ CALL p();
|
||||
id
|
||||
drop procedure p;
|
||||
drop temporary table t1;
|
||||
#
|
||||
# MDEV-5143: update of a joined table with a nested subquery with
|
||||
# a syntax error crashes mysqld with signal 11
|
||||
#
|
||||
create table t1 (id int(11) not null auto_increment, val varchar(100) null,primary key (id));
|
||||
create table t2 (id int(11) not null auto_increment, val varchar(100) null,primary key (id));
|
||||
insert into t1 (val) values('a');
|
||||
insert into t2 (val) values('1');
|
||||
update
|
||||
(
|
||||
select
|
||||
val
|
||||
from
|
||||
(
|
||||
select
|
||||
v.val
|
||||
from
|
||||
t2 wrong_table_alias
|
||||
) t4
|
||||
) t3
|
||||
inner join t1 on
|
||||
t1.id=t3.val
|
||||
set
|
||||
t1.val=t3.val
|
||||
;
|
||||
ERROR 42S22: Unknown column 'v.val' in 'field list'
|
||||
drop table t1, t2;
|
||||
# End of 5.3 tests
|
||||
#
|
||||
# Bug#58730 Assertion failed: table->key_read == 0 in close_thread_table,
|
||||
|
@ -2415,6 +2415,11 @@ a
|
||||
200
|
||||
set optimizer_switch=@save_optimizer_switch;
|
||||
DROP TABLE t1,t2;
|
||||
#
|
||||
# MDEV-5104 crash in Item_field::used_tables with broken order by
|
||||
#
|
||||
(select 1 order by x(y)) order by 1;
|
||||
ERROR 42S22: Unknown column 'y' in 'order clause'
|
||||
# End of 5.3 tests
|
||||
#
|
||||
# Bug#49771: Incorrect MIN (date) when minimum value is 0000-00-00
|
||||
|
@ -193,7 +193,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
4 SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00
|
||||
NULL UNION RESULT <union1,3> ALL NULL NULL NULL NULL NULL NULL
|
||||
Warnings:
|
||||
Note 1003 (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`b` = (select `test`.`t3`.`a` from `test`.`t3` order by 1 desc limit 1))) union (select `test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t4` where (`test`.`t4`.`b` = (select (max(`test`.`t2`.`a`) * 4) from `test`.`t2`)) order by `a`)
|
||||
Note 1003 (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`b` = (select `test`.`t3`.`a` from `test`.`t3` order by 1 desc limit 1))) union (select `test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t4` where (`test`.`t4`.`b` = (select (max(`test`.`t2`.`a`) * 4) from `test`.`t2`)))
|
||||
select (select a from t3 where a<t2.a*4 order by 1 desc limit 1), a from t2;
|
||||
(select a from t3 where a<t2.a*4 order by 1 desc limit 1) a
|
||||
3 1
|
||||
|
@ -200,7 +200,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
4 SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00
|
||||
NULL UNION RESULT <union1,3> ALL NULL NULL NULL NULL NULL NULL
|
||||
Warnings:
|
||||
Note 1003 (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`b` = (select `test`.`t3`.`a` from `test`.`t3` order by 1 desc limit 1))) union (select `test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t4` where (`test`.`t4`.`b` = (select (max(`test`.`t2`.`a`) * 4) from `test`.`t2`)) order by `a`)
|
||||
Note 1003 (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`b` = (select `test`.`t3`.`a` from `test`.`t3` order by 1 desc limit 1))) union (select `test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t4` where (`test`.`t4`.`b` = (select (max(`test`.`t2`.`a`) * 4) from `test`.`t2`)))
|
||||
select (select a from t3 where a<t2.a*4 order by 1 desc limit 1), a from t2;
|
||||
(select a from t3 where a<t2.a*4 order by 1 desc limit 1) a
|
||||
3 1
|
||||
|
@ -196,7 +196,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
4 SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00
|
||||
NULL UNION RESULT <union1,3> ALL NULL NULL NULL NULL NULL NULL
|
||||
Warnings:
|
||||
Note 1003 (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`b` = (select `test`.`t3`.`a` from `test`.`t3` order by 1 desc limit 1))) union (select `test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t4` where (`test`.`t4`.`b` = (select (max(`test`.`t2`.`a`) * 4) from `test`.`t2`)) order by `a`)
|
||||
Note 1003 (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`b` = (select `test`.`t3`.`a` from `test`.`t3` order by 1 desc limit 1))) union (select `test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t4` where (`test`.`t4`.`b` = (select (max(`test`.`t2`.`a`) * 4) from `test`.`t2`)))
|
||||
select (select a from t3 where a<t2.a*4 order by 1 desc limit 1), a from t2;
|
||||
(select a from t3 where a<t2.a*4 order by 1 desc limit 1) a
|
||||
3 1
|
||||
|
@ -199,7 +199,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
4 SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00
|
||||
NULL UNION RESULT <union1,3> ALL NULL NULL NULL NULL NULL NULL
|
||||
Warnings:
|
||||
Note 1003 (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`b` = (select `test`.`t3`.`a` from `test`.`t3` order by 1 desc limit 1))) union (select `test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t4` where (`test`.`t4`.`b` = (select (max(`test`.`t2`.`a`) * 4) from `test`.`t2`)) order by `a`)
|
||||
Note 1003 (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`b` = (select `test`.`t3`.`a` from `test`.`t3` order by 1 desc limit 1))) union (select `test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t4` where (`test`.`t4`.`b` = (select (max(`test`.`t2`.`a`) * 4) from `test`.`t2`)))
|
||||
select (select a from t3 where a<t2.a*4 order by 1 desc limit 1), a from t2;
|
||||
(select a from t3 where a<t2.a*4 order by 1 desc limit 1) a
|
||||
3 1
|
||||
|
@ -196,7 +196,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
4 SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00
|
||||
NULL UNION RESULT <union1,3> ALL NULL NULL NULL NULL NULL NULL
|
||||
Warnings:
|
||||
Note 1003 (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`b` = (select `test`.`t3`.`a` from `test`.`t3` order by 1 desc limit 1))) union (select `test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t4` where (`test`.`t4`.`b` = (select (max(`test`.`t2`.`a`) * 4) from `test`.`t2`)) order by `a`)
|
||||
Note 1003 (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`b` = (select `test`.`t3`.`a` from `test`.`t3` order by 1 desc limit 1))) union (select `test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t4` where (`test`.`t4`.`b` = (select (max(`test`.`t2`.`a`) * 4) from `test`.`t2`)))
|
||||
select (select a from t3 where a<t2.a*4 order by 1 desc limit 1), a from t2;
|
||||
(select a from t3 where a<t2.a*4 order by 1 desc limit 1) a
|
||||
3 1
|
||||
|
@ -350,6 +350,40 @@ drop procedure p;
|
||||
|
||||
drop temporary table t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-5143: update of a joined table with a nested subquery with
|
||||
--echo # a syntax error crashes mysqld with signal 11
|
||||
--echo #
|
||||
|
||||
create table t1 (id int(11) not null auto_increment, val varchar(100) null,primary key (id));
|
||||
create table t2 (id int(11) not null auto_increment, val varchar(100) null,primary key (id));
|
||||
|
||||
insert into t1 (val) values('a');
|
||||
insert into t2 (val) values('1');
|
||||
|
||||
--error ER_BAD_FIELD_ERROR
|
||||
update
|
||||
(
|
||||
select
|
||||
val
|
||||
from
|
||||
(
|
||||
select
|
||||
v.val
|
||||
from
|
||||
t2 wrong_table_alias
|
||||
) t4
|
||||
) t3
|
||||
inner join t1 on
|
||||
t1.id=t3.val
|
||||
set
|
||||
t1.val=t3.val
|
||||
;
|
||||
|
||||
drop table t1, t2;
|
||||
|
||||
|
||||
--echo # End of 5.3 tests
|
||||
|
||||
--echo #
|
||||
|
@ -1593,6 +1593,13 @@ set optimizer_switch=@save_optimizer_switch;
|
||||
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-5104 crash in Item_field::used_tables with broken order by
|
||||
--echo #
|
||||
|
||||
--error ER_BAD_FIELD_ERROR
|
||||
(select 1 order by x(y)) order by 1;
|
||||
|
||||
--echo # End of 5.3 tests
|
||||
|
||||
--echo #
|
||||
|
Reference in New Issue
Block a user