Commit ac824fa5 authored by Otto Kekäläinen's avatar Otto Kekäläinen
Browse files

Merge tag 'upstream/5.5.54' into ubuntu-14.04

Upstream version 5.5.54
parents 823a5cd5 aa39e58b
...@@ -44,5 +44,8 @@ SELECT @@GLOBAL.replicate_ignore_table; ...@@ -44,5 +44,8 @@ SELECT @@GLOBAL.replicate_ignore_table;
SET @@GLOBAL.replicate_ignore_table=""; SET @@GLOBAL.replicate_ignore_table="";
SELECT @@GLOBAL.replicate_ignore_table; SELECT @@GLOBAL.replicate_ignore_table;
SET @@GLOBAL.replicate_ignore_table=null;
SELECT @@GLOBAL.replicate_ignore_table;
--echo # Cleanup. --echo # Cleanup.
SET @@GLOBAL.replicate_ignore_table = @save_replicate_ignore_table; SET @@GLOBAL.replicate_ignore_table = @save_replicate_ignore_table;
...@@ -44,5 +44,8 @@ SELECT @@GLOBAL.replicate_wild_do_table; ...@@ -44,5 +44,8 @@ SELECT @@GLOBAL.replicate_wild_do_table;
SET @@GLOBAL.replicate_wild_do_table=""; SET @@GLOBAL.replicate_wild_do_table="";
SELECT @@GLOBAL.replicate_wild_do_table; SELECT @@GLOBAL.replicate_wild_do_table;
SET @@GLOBAL.replicate_wild_do_table=null;
SELECT @@GLOBAL.replicate_wild_do_table;
--echo # Cleanup. --echo # Cleanup.
SET @@GLOBAL.replicate_wild_do_table = @save_replicate_wild_do_table; SET @@GLOBAL.replicate_wild_do_table = @save_replicate_wild_do_table;
...@@ -44,5 +44,8 @@ SELECT @@GLOBAL.replicate_wild_ignore_table; ...@@ -44,5 +44,8 @@ SELECT @@GLOBAL.replicate_wild_ignore_table;
SET @@GLOBAL.replicate_wild_ignore_table=""; SET @@GLOBAL.replicate_wild_ignore_table="";
SELECT @@GLOBAL.replicate_wild_ignore_table; SELECT @@GLOBAL.replicate_wild_ignore_table;
SET @@GLOBAL.replicate_wild_ignore_table=null;
SELECT @@GLOBAL.replicate_wild_ignore_table;
--echo # Cleanup. --echo # Cleanup.
SET @@GLOBAL.replicate_wild_ignore_table = @save_replicate_wild_ignore_table; SET @@GLOBAL.replicate_wild_ignore_table = @save_replicate_wild_ignore_table;
...@@ -2081,4 +2081,13 @@ DELIMITER ;| ...@@ -2081,4 +2081,13 @@ DELIMITER ;|
create table t1 as select f1(); create table t1 as select f1();
drop function f1; drop function f1;
--echo #
--echo # MDEV-10274 Bundling insert with create statement
--echo # for table with unsigned Decimal primary key issues warning 1194
--echo #
create table t1(ID decimal(2,1) unsigned NOT NULL, PRIMARY KEY (ID))engine=memory
select 2.1 ID;
drop table t1;
--echo End of 5.5 tests --echo End of 5.5 tests
...@@ -1681,6 +1681,20 @@ SELECT length(data) AS len FROM (SELECT REPEAT('ä', 65535) AS data) AS sub; ...@@ -1681,6 +1681,20 @@ SELECT length(data) AS len FROM (SELECT REPEAT('ä', 65535) AS data) AS sub;
SELECT length(data) AS len FROM (SELECT REPEAT('ä', 65536) AS data) AS sub; SELECT length(data) AS len FROM (SELECT REPEAT('ä', 65536) AS data) AS sub;
SELECT length(data) AS len FROM (SELECT REPEAT('ä', 65537) AS data) AS sub; SELECT length(data) AS len FROM (SELECT REPEAT('ä', 65537) AS data) AS sub;
--echo #
--echo # MDEV-10717 Assertion `!null_value' failed in virtual bool Item::send(Protocol*, String*)
--echo #
CREATE TABLE t1 (i INT, KEY(i));
INSERT INTO t1 VALUES (20081205),(20050327);
SELECT HEX(i), HEX(CHAR(i USING utf8)) FROM t1;
SET sql_mode='STRICT_ALL_TABLES';
SELECT HEX(i), HEX(CHAR(i USING utf8)) FROM t1;
# Avoid garbage in the output
--replace_column 1 ###
SELECT CHAR(i USING utf8) FROM t1;
SET sql_mode=DEFAULT;
DROP TABLE t1;
--echo # --echo #
--echo # End of 5.5 tests --echo # End of 5.5 tests
--echo # --echo #
...@@ -796,3 +796,50 @@ A.DIVISION=C1.DIVISION AND A.RECEIVABLE_GROUP=C1.RECEIVABLE_GROUP AND A.CREDIT_L ...@@ -796,3 +796,50 @@ A.DIVISION=C1.DIVISION AND A.RECEIVABLE_GROUP=C1.RECEIVABLE_GROUP AND A.CREDIT_L
ORDER BY TOTAL DESC; ORDER BY TOTAL DESC;
DROP TABLES t1,t2; DROP TABLES t1,t2;
--echo #
--echo # MDEV-10663: Use of Inline table columns in HAVING clause
--echo # throws 1463 Error
--echo #
set @save_sql_mode = @@sql_mode;
set sql_mode='ONLY_FULL_GROUP_BY,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
CREATE TABLE `example1463` (
`Customer` varchar(255) NOT NULL,
`DeliveryStatus` varchar(255) NOT NULL,
`OrderSize` int(11) NOT NULL
);
INSERT INTO example1463 VALUES ('Charlie', 'Success', 100);
INSERT INTO example1463 VALUES ('David', 'Success', 110);
INSERT INTO example1463 VALUES ('Charlie', 'Failed', 200);
INSERT INTO example1463 VALUES ('David', 'Success', 100);
INSERT INTO example1463 VALUES ('David', 'Unknown', 100);
INSERT INTO example1463 VALUES ('Edward', 'Success', 150);
INSERT INTO example1463 VALUES ('Edward', 'Pending', 150);
SELECT Customer, Success, SUM(OrderSize)
FROM (SELECT Customer,
CASE WHEN DeliveryStatus='Success' THEN 'Yes' ELSE 'No' END AS Success,
OrderSize
FROM example1463) as subQ
GROUP BY Success, Customer
WITH ROLLUP;
SELECT Customer, Success, SUM(OrderSize)
FROM (SELECT Customer,
CASE WHEN DeliveryStatus='Success' THEN 'Yes' ELSE 'No' END AS Success,
OrderSize
FROM example1463) as subQ
GROUP BY Success, Customer;
SELECT Customer, Success, SUM(OrderSize)
FROM (SELECT Customer,
CASE WHEN DeliveryStatus='Success' THEN 'Yes' ELSE 'No' END AS Success,
OrderSize
FROM example1463) as subQ
GROUP BY Success, Customer
HAVING Success IS NOT NULL;
DROP TABLE example1463;
set sql_mode= @save_sql_mode;
--echo # end of 5.5
...@@ -1827,6 +1827,60 @@ DROP TABLE t1,t2; ...@@ -1827,6 +1827,60 @@ DROP TABLE t1,t2;
--echo # end of 5.3 tests --echo # end of 5.3 tests
--echo # --echo #
--echo #
--echo # Bug mdev-11161: The second execution of prepared statement
--echo # does not use generated key for materialized
--echo # derived table / view
--echo # (actually this is a 5.3 bug.)
--echo #
create table t1 (
mat_id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
matintnum CHAR(6) NOT NULL,
test MEDIUMINT UNSIGNED NULL
);
create table t2 (
mat_id MEDIUMINT UNSIGNED NOT NULL,
pla_id MEDIUMINT UNSIGNED NOT NULL
);
insert into t1 values
(NULL, 'a', 1), (NULL, 'b', 2), (NULL, 'c', 3), (NULL, 'd', 4),
(NULL, 'e', 5), (NULL, 'f', 6), (NULL, 'g', 7), (NULL, 'h', 8),
(NULL, 'i', 9);
insert into t2 values
(1, 100), (1, 101), (1, 102), (2, 100), (2, 103), (2, 104),
(3, 101), (3, 102), (3, 105);
explain
SELECT STRAIGHT_JOIN d.pla_id, m2.mat_id
FROM t1 m2
INNER JOIN
(SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum
FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id
GROUP BY mp.pla_id) d
ON d.matintnum=m2.matintnum;
prepare stmt1 from
"SELECT STRAIGHT_JOIN d.pla_id, m2.mat_id
FROM t1 m2
INNER JOIN
(SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum
FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id
GROUP BY mp.pla_id) d
ON d.matintnum=m2.matintnum";
flush status;
execute stmt1;
show status like '%Handler_read%';
flush status;
execute stmt1;
show status like '%Handler_read%';
deallocate prepare stmt1;
drop table t1,t2;
# The following command must be the last one the file # The following command must be the last one the file
set optimizer_switch=@exit_optimizer_switch; set optimizer_switch=@exit_optimizer_switch;
set join_cache_level=@exit_join_cache_level; set join_cache_level=@exit_join_cache_level;
--source include/not_embedded.inc
#
# MDEV-11552 Queries executed by event scheduler are written to slow log incorrectly or not written at all
#
set @event_scheduler_save= @@global.event_scheduler;
set @slow_query_log_save= @@global.slow_query_log;
set global event_scheduler= on;
set global slow_query_log= on;
set global long_query_time=0.2;
create table t1 (i int);
insert into t1 values (0);
create event ev on schedule at CURRENT_TIMESTAMP + INTERVAL 1 second do update t1 set i=1+sleep(0.5);
--let wait_condition= select i from t1 where i > 0
--source include/wait_condition.inc
--let SEARCH_FILE = `SELECT @@slow_query_log_file`
--let SEARCH_PATTERN= update t1 set i=1
--let SEARCH_RANGE= -1000
--source include/search_pattern_in_file.inc
drop table t1;
set global event_scheduler= @event_scheduler_save;
set global slow_query_log= @slow_query_log_save;
set global long_query_time= @@session.long_query_time;
#
# MDEV-11241 Certain combining marks cause MariaDB to crash when doing Full-Text searches
#
set names utf8mb4;
create table t1 (a int, b text, fulltext (b)) charset=utf8mb4 collate=utf8mb4_unicode_ci;
insert t1 values (1000, 'C͓̙̯͔̩ͅͅi̩̘̜̲a̯̲̬̳̜̖̤o͕͓̜͓̺̖̗,̠̬͚ ̺T͇̲h͈̱e ̬̜D̖o̦̖͔̗͖̩̘c̣̼t̝͉̫̮̗o͉̫̭r̙͎̗.͓̪̥');
select a from t1 where match(b) against ('ciao' in boolean mode);
drop table t1;
...@@ -1597,3 +1597,8 @@ INSERT INTO t1 VALUES (17, NULL); ...@@ -1597,3 +1597,8 @@ INSERT INTO t1 VALUES (17, NULL);
INSERT INTO t1 VALUES (18, '2010-10-13'); INSERT INTO t1 VALUES (18, '2010-10-13');
SELECT a.id,a.date1,FROM_DAYS(TO_DAYS(a.date1)-10) as date2, DATE_ADD(a.date1,INTERVAL -10 DAY),TO_DAYS(a.date1)-10 FROM t1 a ORDER BY a.id; SELECT a.id,a.date1,FROM_DAYS(TO_DAYS(a.date1)-10) as date2, DATE_ADD(a.date1,INTERVAL -10 DAY),TO_DAYS(a.date1)-10 FROM t1 a ORDER BY a.id;
DROP TABLE t1; DROP TABLE t1;
--echo #
--echo # MDEV-10524 Assertion `arg1_int >= 0' failed in Item_func_additive_op::result_precision()
--echo #
SELECT 1 MOD ADDTIME( '13:58:57', '00:00:01' ) + 2;
...@@ -1691,6 +1691,18 @@ SELECT MAX(i), c FROM t1 ...@@ -1691,6 +1691,18 @@ SELECT MAX(i), c FROM t1
WHERE c != 'qux' AND ( SELECT SUM(j) FROM t1, t2 ) IS NOT NULL GROUP BY c; WHERE c != 'qux' AND ( SELECT SUM(j) FROM t1, t2 ) IS NOT NULL GROUP BY c;
drop table t1,t2; drop table t1,t2;
--echo #
--echo # ONLY_FULL_GROUP_BY references
--echo #
set @save_sql_mode = @@sql_mode;
set sql_mode='ONLY_FULL_GROUP_BY';
create table t1 (a int, b int);
select a+b as x from t1 group by x having x > 1;
select a as x from t1 group by x having x > 1;
select a from t1 group by a having a > 1;
drop table t1;
set sql_mode= @save_sql_mode;
# #
# End of MariaDB 5.5 tests # End of MariaDB 5.5 tests
# #
...@@ -171,6 +171,37 @@ WHERE ( tb.b != ta.b OR tb.a = ta.a ) ...@@ -171,6 +171,37 @@ WHERE ( tb.b != ta.b OR tb.a = ta.a )
AND ( tb.b = ta.c OR tb.b = ta.b ); AND ( tb.b = ta.c OR tb.b = ta.b );
DROP TABLE t1; DROP TABLE t1;
set optimizer_switch= @optimizer_switch_save; set optimizer_switch= @optimizer_switch_save;
--echo #
--echo # MDEV-10927: Crash When Using sort_union Optimization
--echo #
set @tmp_optimizer_switch=@@optimizer_switch;
SET optimizer_switch='index_merge_sort_intersection=on';
SET SESSION sort_buffer_size = 1024;
create table t1 (
pk int(11) NOT NULL AUTO_INCREMENT,
col1 int(11) NOT NULL,
col2 int(11) NOT NULL,
col3 int(11) NOT NULL,
key2 int(11) NOT NULL,
col4 int(11) NOT NULL,
key1 int(11) NOT NULL,
PRIMARY KEY (pk),
KEY key1 (key1),
KEY key2 (key2)
) ENGINE=InnoDB AUTO_INCREMENT=12860259 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
create table t2(a int);
insert into t2 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t3(a int);
insert into t3 select A.a + B.a* 10 + C.a * 100 + D.a*1000 from t2 A, t2 B, t2 C, t2 D;
insert into t1 (key1, key2, col1,col2,col3,col4)
select a,a, a,a,a,a from t3;
SELECT sum(col1) FROM t1 FORCE INDEX (key1,key2) WHERE (key1 between 10 and 8191+10) or (key2= 5);
drop table t1,t2,t3;
set optimizer_switch=@tmp_optimizer_switch;
...@@ -612,13 +612,13 @@ select * from information_schema.schema_privileges order by grantee; ...@@ -612,13 +612,13 @@ select * from information_schema.schema_privileges order by grantee;
select * from information_schema.user_privileges order by grantee; select * from information_schema.user_privileges order by grantee;
show grants; show grants;
connection con4; connection con4;
select * from information_schema.column_privileges where grantee like '%user%' select * from information_schema.column_privileges where grantee like '\'user%'
order by grantee; order by grantee;
select * from information_schema.table_privileges where grantee like '%user%' select * from information_schema.table_privileges where grantee like '\'user%'
order by grantee; order by grantee;
select * from information_schema.schema_privileges where grantee like '%user%' select * from information_schema.schema_privileges where grantee like '\'user%'
order by grantee; order by grantee;
select * from information_schema.user_privileges where grantee like '%user%' select * from information_schema.user_privileges where grantee like '\'user%'
order by grantee; order by grantee;
show grants; show grants;
connection default; connection default;
......
...@@ -131,3 +131,10 @@ drop table if exists t1; ...@@ -131,3 +131,10 @@ drop table if exists t1;
create table t1 (f1 int key) partition by key(f1) partitions 2; create table t1 (f1 int key) partition by key(f1) partitions 2;
select create_options from information_schema.tables where table_schema="test"; select create_options from information_schema.tables where table_schema="test";
drop table t1; drop table t1;
--echo #
--echo # MDEV-11353 - Identical logical conditions
--echo #
CREATE TABLE t1(a INT) CHECKSUM=1 SELECT 1;
SELECT CHECKSUM FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
DROP TABLE t1;
...@@ -612,7 +612,7 @@ disconnect con1; ...@@ -612,7 +612,7 @@ disconnect con1;
--echo # --echo #
CREATE TABLE t1(f1 INT); CREATE TABLE t1(f1 INT);
EVAL SELECT 0xE1C330 INTO OUTFILE 't1.dat'; EVAL SELECT 0xE1BB30 INTO OUTFILE 't1.dat';
--disable_warnings --disable_warnings
LOAD DATA INFILE 't1.dat' IGNORE INTO TABLE t1 CHARACTER SET utf8; LOAD DATA INFILE 't1.dat' IGNORE INTO TABLE t1 CHARACTER SET utf8;
--enable_warnings --enable_warnings
...@@ -658,26 +658,3 @@ SET @@sql_mode= @old_mode; ...@@ -658,26 +658,3 @@ SET @@sql_mode= @old_mode;
--remove_file $MYSQLTEST_VARDIR/mysql --remove_file $MYSQLTEST_VARDIR/mysql
DROP TABLE t1; DROP TABLE t1;
--echo
--echo #
--echo # Bug#23080148 - Backport of Bug#20683959.
--echo # Bug#20683959 LOAD DATA INFILE IGNORES A SPECIFIC ROW SILENTLY
--echo # UNDER DB CHARSET IS UTF8.
--echo #
CREATE DATABASE d1 CHARSET latin1;
USE d1;
CREATE TABLE t1 (val TEXT);
LOAD DATA INFILE '../../std_data/bug20683959loaddata.txt' INTO TABLE t1;
SELECT COUNT(*) FROM t1;
SELECT HEX(val) FROM t1;
CREATE DATABASE d2 CHARSET utf8;
USE d2;
CREATE TABLE t1 (val TEXT);
--error ER_INVALID_CHARACTER_STRING
LOAD DATA INFILE '../../std_data/bug20683959loaddata.txt' INTO TABLE t1;
DROP TABLE d1.t1, d2.t1;
DROP DATABASE d1;
DROP DATABASE d2;
...@@ -770,3 +770,13 @@ select 2>!0, 2 > ! 0; ...@@ -770,3 +770,13 @@ select 2>!0, 2 > ! 0;
select 0<=!0, 0 <= !0; select 0<=!0, 0 <= !0;
select 1<<!0, 1 << !0; select 1<<!0, 1 << !0;
select 0<!0, 0 < ! 0; select 0<!0, 0 < ! 0;
--echo #
--echo # MDEV-11171 Assertion `m_cpp_buf <= ptr && ptr <= m_cpp_buf + m_buf_length' failed in Lex_input_stream::body_utf8_append(const char*, const char*)
--echo #
CREATE TABLE t1 (id INT);
--error ER_PARSE_ERROR
CREATE TRIGGER tr AFTER DELETE ON t1 FOR EACH ROW SET @a = 1\;
--error ER_PARSE_ERROR
PREPARE stmt FROM 'CREATE TRIGGER tr AFTER DELETE ON t1 FOR EACH ROW SET @a = 1\\';
DROP TABLE t1;
...@@ -9302,4 +9302,55 @@ CALL p1; ...@@ -9302,4 +9302,55 @@ CALL p1;
DROP PROCEDURE p1; DROP PROCEDURE p1;
DROP TABLE t1; DROP TABLE t1;
--echo #
--echo # MDEV-10713: signal 11 error on multi-table update - crash in
--echo # handler::increment_statistics or in make_select or assertion
--echo # failure pfs_thread == ((PFS_thread*) pthread_getspecific((THR_PFS)))
--echo #
CREATE TABLE `t1` (
`CLOSE_YN` varchar(10) COLLATE utf8_bin DEFAULT NULL
) DEFAULT CHARSET=utf8 COLLATE=utf8_bin ;
CREATE TABLE `t2` (
`ap_close_to` varchar(8) COLLATE utf8_bin DEFAULT NULL
) DEFAULT CHARSET=utf8 COLLATE=utf8_bin ;
insert t1 values (1);
--delimiter $$
CREATE FUNCTION `f1`(`P_DC_CD` VARBINARY(50), `P_SYS_DATE` DATETIME) RETURNS datetime
DETERMINISTIC
SQL SECURITY INVOKER
BEGIN
DECLARE V_SYS_DATE DATETIME;
SELECT now() AS LOC_DATE INTO V_SYS_DATE ;
RETURN v_sys_date ;
END $$
--delimiter ;
update t1 S
JOIN
(
SELECT CASE
WHEN DATE_FORMAT( f1('F01', NOW()) , '%Y%m%d') <= CLOSE_YMD
THEN '99991231'
ELSE '' END ACCOUNT_APPLY_YYYYMMDD
FROM (
select case
when 'AP'='AP'
then ap_close_to
end AS CLOSE_YMD
from t2
) A
) X
SET S.CLOSE_YN = ''
where 1=1;
drop function if exists f1;
drop table t1,t2;
--echo # End of 5.5 test --echo # End of 5.5 test
...@@ -5974,3 +5974,27 @@ INSERT INTO t1 VALUES(0),(0),(0); ...@@ -5974,3 +5974,27 @@ INSERT INTO t1 VALUES(0),(0),(0);
SELECT * FROM t1 WHERE a IN(SELECT MIN(a) FROM t1); SELECT * FROM t1 WHERE a IN(SELECT MIN(a) FROM t1);
DROP TABLE t1; DROP TABLE t1;
SET SESSION big_tables=0; SET SESSION big_tables=0;
--echo #
--echo # MDEV-10776: Server crash on query
--echo #
create table t1 (field1 int);
insert into t1 values (1);
select round((select 1 from t1 limit 1))
from t1
group by round((select 1 from t1 limit 1));
drop table t1;
--echo #
--echo # MDEV-10386 Assertion `fixed == 1' failed in virtual String* Item_func_conv_charset::val_str(String*)
--echo #
CREATE TABLE t1 (f1 CHAR(3) CHARACTER SET utf8 NULL, f2 CHAR(3) CHARACTER SET latin1 NULL);
INSERT INTO t1 VALUES ('foo','bar');
SELECT * FROM t1 WHERE f2 >= SOME ( SELECT f1 FROM t1 );
SELECT * FROM t1 WHERE f2 <= SOME ( SELECT f1 FROM t1 );
DROP TABLE t1;
...@@ -359,5 +359,55 @@ where t1.a = t2.a and ( t1.a = ( select min(a) from t1 ) or 0 ); ...@@ -359,5 +359,55 @@ where t1.a = t2.a and ( t1.a = ( select min(a) from t1 ) or 0 );
drop table t1,t2,t3; drop table t1,t2,t3;
--echo #
--echo # MDEV-10148: Database crashes in the query to the View
--echo #
CREATE TABLE t1 (
key_code INT(11) NOT NULL,
value_string VARCHAR(50) NULL DEFAULT NULL,
PRIMARY KEY (key_code)
) COLLATE='utf8_general_ci' ENGINE=InnoDB ;
CREATE TABLE t2 (
key_code INT(11) NOT NULL,
target_date DATE NULL DEFAULT NULL,
PRIMARY KEY (key_code)
) COLLATE='utf8_general_ci' ENGINE=InnoDB ;
CREATE TABLE t3 (
now_date DATE NOT NULL,
PRIMARY KEY (now_date)
) COLLATE='utf8_general_ci' ENGINE=InnoDB ;
CREATE VIEW v1
AS
SELECT
B.key_code,
B.target_date
FROM
t2 B INNER JOIN t3 C ON
B.target_date = C.now_date
;
SET @s = 'SELECT A.* FROM t1 A WHERE A.key_code IN (SELECT key_code FROM v1)';
PREPARE stmt FROM @s;
EXECUTE stmt; #1st time -> success
EXECUTE stmt; #2nd time -> crash
DEALLOCATE PREPARE stmt;
DROP VIEW v1;
DROP TABLE t1,t2,t3;
set optimizer_switch=@subselect2_test_tmp; set optimizer_switch=@subselect2_test_tmp;
#
# Bug #23303485 : HANDLE_FATAL_SIGNAL (SIG=11) IN SUBSELECT_UNION_ENGINE::NO_ROWS
#
create table t1 (a int);
create table t2 (a int);
create table t3(a int);
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
insert into t2 select a from t1;
insert into t3 select a from t1;
--error ER_SUBQUERY_NO_1_ROW
select null in (select a from t1 where a < out3.a union select a from t2 where
(select a from t3) +1 < out3.a+1) from t3 out3;
drop table t1, t2, t3;
...@@ -1959,5 +1959,46 @@ SELECT x FROM t1 WHERE id > (SELECT MAX(id) - 1000 FROM t1) ORDER BY x LIMIT 1; ...@@ -1959,5 +1959,46 @@ SELECT x FROM t1 WHERE id > (SELECT MAX(id) - 1000 FROM t1) ORDER BY x LIMIT 1;
drop table t1; drop table t1;
--echo #
--echo # MDEV-7691: Assertion `outer_context || !*from_field || *from_field == not_found_field' ...
--echo #
set optimizer_switch=default;
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (4),(6);
CREATE TABLE t2 (b INT) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1),(8);
PREPARE stmt FROM "
SELECT * FROM t2
HAVING 0 IN (
SELECT a FROM t1
WHERE a IN (
SELECT a FROM t1
WHERE b = a
)
)
";
EXECUTE stmt;
EXECUTE stmt;
--echo # Alternative test case, without HAVING
CREATE TABLE t3 (i INT) ENGINE=MyISAM;
INSERT INTO t3 VALUES (4),(6);
PREPARE stmt FROM "
SELECT * FROM t3 AS t10
WHERE EXISTS (
SELECT * FROM t3 AS t20 WHERE t10.i IN (
SELECT i FROM t3
)
)";
EXECUTE stmt;
EXECUTE stmt;
drop table t1, t2, t3;
SET optimizer_switch= @@global.optimizer_switch; SET optimizer_switch= @@global.optimizer_switch;
set @@tmp_table_size= @@global.tmp_table_size; set @@tmp_table_size= @@global.tmp_table_size;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment