Debian Codegraph @

mysql-test/suite/innodb/t/lock_memory.test

raw
1 --source include/have_innodb.inc
2 --source include/have_innodb_16k.inc
3
4 --echo #
5 --echo # MDEV-28800 SIGABRT due to running out of memory for InnoDB locks
6 --echo #
7
8 SET @save_ahi=@@GLOBAL.innodb_adaptive_hash_index;
9 SET GLOBAL innodb_adaptive_hash_index=OFF;
10
11 CREATE TABLE t1 (col1 INT) ENGINE=InnoDB;
12
13 INSERT INTO t1 VALUES (1),(2),(3),(4);
14 INSERT INTO t1 SELECT * FROM t1;
15 INSERT INTO t1 SELECT * FROM t1;
16
17 START TRANSACTION;
18
19 # Insert 64K records
20 INSERT INTO t1 SELECT a.* FROM t1 a, t1 b, t1 c, t1 d;
21
22 # The check needs to be adjusted if we start using more memory for locks. It
23 # needs 9 pages for 16k page size and we put the limit as 10.
24 SELECT CASE WHEN (POOL_SIZE - (FREE_BUFFERS + DATABASE_PAGES)) <= 10 THEN "PASSED"
25 ELSE (POOL_SIZE - (FREE_BUFFERS + DATABASE_PAGES)) END
26 FROM information_schema.innodb_buffer_pool_stats;
27
28 COMMIT;
29
30 SELECT COUNT(*) FROM t1;
31
32 DROP TABLE t1;
33 SET GLOBAL innodb_adaptive_hash_index=@save_ahi;