1
0
mirror of https://github.com/MariaDB/server.git synced 2025-09-02 09:41:40 +03:00

MDEV-8756 MariaDB 10.0.21 crashes during PREPARE

Non-select-like queries has no correct JOIN structure connected to top-most SELECT_LEX (and should not).
This commit is contained in:
Oleksandr Byelkin
2015-10-22 16:08:45 +02:00
parent ac67f9a42a
commit b0e3f484f7
3 changed files with 61 additions and 2 deletions

View File

@@ -4052,3 +4052,24 @@ SELECT 1 FROM t1 GROUP BY 0 OR 18446744073709551615+1;
ERROR 22003: BIGINT UNSIGNED value is out of range in '(18446744073709551615 + 1)'
drop table t1;
# End of 5.3 tests
#
# MDEV-8756: MariaDB 10.0.21 crashes during PREPARE
#
CREATE TABLE t1 ( id INT(10), value INT(10) );
CREATE TABLE t2 ( id INT(10) );
SET @save_sql_mode= @@sql_mode;
SET SESSION sql_mode = 'ONLY_FULL_GROUP_BY';
PREPARE stmt FROM 'UPDATE t1 t1 SET value = (SELECT 1 FROM t2 WHERE id = t1.id)';
execute stmt;
insert into t1 values (1,10),(2,10),(3,10);
insert into t2 values (1),(2);
execute stmt;
select * from t1;
id value
1 1
2 1
3 NULL
deallocate prepare stmt;
SET SESSION sql_mode = @save_sql_mode;
DROP TABLE t1,t2;
# End of 10.0 tests