File: partition_open_files_limit.test

package info (click to toggle)
percona-xtrabackup 2.2.3-2.1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 293,260 kB
  • ctags: 146,881
  • sloc: cpp: 1,051,960; ansic: 570,217; java: 54,595; perl: 53,495; pascal: 44,194; sh: 27,826; yacc: 15,314; python: 12,142; xml: 7,848; sql: 4,125; makefile: 1,459; awk: 785; lex: 758
file content (34 lines) | stat: -rw-r--r-- 1,130 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--source include/have_partition.inc

--disable_warnings
DROP TABLE IF EXISTS `t1`;
--enable_warnings

# On some platforms the lowest possible open_files_limit is too high...
let $max_open_files_limit= `SELECT @@open_files_limit > 1024`;
if ($max_open_files_limit)
{
  skip Need open_files_limit to be lower than 1025;
}

#
--echo # Bug#46922: crash when adding partitions and open_files_limit is reached
#
# Note:
# The test script ask for open_files_limit=5
# The server silently increase that to 5000 before asking the OS.
# The OS may (or may not) reduce/increase open_files_limit, typically to 1024
# (Linux, see 'ulimit -n')
# So, for the ADD PARTITIONS to really reach the 'Too many open files'
# error, the test script attempts 600 partitions.
#
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 600;
--sorted_result
SELECT * FROM t1;
DROP TABLE t1;