Commit 8f9c6400 authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-15336 Server crashes in handler::print_error / ha_partition::print_error upon query timeout

set m_last_part to something meaningful when opening partitions
parent 22073cbf
CREATE TABLE t1 (i INT) ENGINE=InnoDB PARTITION BY HASH (i) PARTITIONS 2;
XA START 'xid';
INSERT INTO t1 VALUES (1),(2),(3),(4);
connect con1,localhost,root,,test;
CREATE TABLE t2 SELECT * FROM t1;;
connect con2,localhost,root,,test;
SET max_statement_time= 1;
DELETE FROM t1 PARTITION (p1) ORDER BY i LIMIT 2;
ERROR 70100: Query execution was interrupted (max_statement_time exceeded)
disconnect con2;
connection default;
XA END 'xid';
XA ROLLBACK 'xid';
connection con1;
disconnect con1;
connection default;
call mtr.add_suppression('Sort aborted');
DROP TABLE IF EXISTS t2, t1;
#
# MDEV-15336 Server crashes in handler::print_error / ha_partition::print_error upon query timeout
#
--source include/have_innodb.inc
--source include/have_partition.inc
CREATE TABLE t1 (i INT) ENGINE=InnoDB PARTITION BY HASH (i) PARTITIONS 2;
XA START 'xid';
INSERT INTO t1 VALUES (1),(2),(3),(4);
--connect (con1,localhost,root,,test)
--send CREATE TABLE t2 SELECT * FROM t1;
--connect (con2,localhost,root,,test)
SET max_statement_time= 1;
--error ER_STATEMENT_TIMEOUT
DELETE FROM t1 PARTITION (p1) ORDER BY i LIMIT 2;
# Cleanup
--disconnect con2
--connection default
XA END 'xid';
XA ROLLBACK 'xid';
--connection con1
--reap
--disconnect con1
--connection default
call mtr.add_suppression('Sort aborted');
DROP TABLE IF EXISTS t2, t1;
......@@ -8383,6 +8383,7 @@ int ha_partition::open_read_partitions(char *name_buff, size_t name_buff_size)
if (error)
goto err_handler;
bitmap_set_bit(&m_opened_partitions, n_file);
m_last_part= n_file;
}
if (!m_file_sample && should_be_open)
m_file_sample= *file;
......
Markdown is supported
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