mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
Bug#46922: crash when adding partitions and open_files_limit
is reached Problem was bad error handling, leaving some new temporary partitions locked and initialized and some not yet initialized and locked, leading to a crash when trying to unlock the not yet initialized and locked partitions Solution was to unlock the already locked partitions, and not include any of the new temporary partitions in later unlocks
This commit is contained in:
parent
7079338e0e
commit
87a4644db8
4 changed files with 43 additions and 1 deletions
22
mysql-test/r/partition_open_files_limit.result
Normal file
22
mysql-test/r/partition_open_files_limit.result
Normal file
|
@ -0,0 +1,22 @@
|
|||
DROP TABLE IF EXISTS `t1`;
|
||||
# Bug#46922: crash when adding partitions and open_files_limit is reached
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY)
|
||||
ENGINE=MyISAM PARTITION BY KEY () PARTITIONS 1;
|
||||
INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10), (11);
|
||||
# if the bug exists, then crash will happen here
|
||||
ALTER TABLE t1 ADD PARTITION PARTITIONS 511;
|
||||
ERROR HY000: Out of resources when opening file '<partition file>' (Errcode: 24)
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
1
|
||||
10
|
||||
11
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
DROP TABLE t1;
|
1
mysql-test/t/partition_open_files_limit-master.opt
Normal file
1
mysql-test/t/partition_open_files_limit-master.opt
Normal file
|
@ -0,0 +1 @@
|
|||
--open-files-limit=5 --max_connections=2 --table_open_cache=1
|
19
mysql-test/t/partition_open_files_limit.test
Normal file
19
mysql-test/t/partition_open_files_limit.test
Normal file
|
@ -0,0 +1,19 @@
|
|||
--source include/have_partition.inc
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
--enable_warnings
|
||||
|
||||
#
|
||||
--echo # Bug#46922: crash when adding partitions and open_files_limit is reached
|
||||
#
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY)
|
||||
ENGINE=MyISAM PARTITION BY KEY () PARTITIONS 1;
|
||||
INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10), (11);
|
||||
--echo # if the bug exists, then crash will happen here
|
||||
--replace_regex /file '.*'/file '<partition file>'/
|
||||
--error 23
|
||||
ALTER TABLE t1 ADD PARTITION PARTITIONS 511;
|
||||
--sorted_result
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
|
@ -1280,10 +1280,10 @@ void ha_partition::cleanup_new_partition(uint part_count)
|
|||
m_file= m_added_file;
|
||||
m_added_file= NULL;
|
||||
|
||||
external_lock(ha_thd(), F_UNLCK);
|
||||
/* delete_table also needed, a bit more complex */
|
||||
close();
|
||||
|
||||
m_added_file= m_file;
|
||||
m_file= save_m_file;
|
||||
}
|
||||
DBUG_VOID_RETURN;
|
||||
|
|
Loading…
Add table
Reference in a new issue