mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
MDEV-13536 DB_TRX_ID is not actually being reset when the history is removed
This should have been part of MDEV-12288. trx_undo_t::del_marks: Remove. Purge needs to process all undo log records in order to reset the DB_TRX_ID. Before MDEV-12288, it sufficed to only delete the purgeable delete-marked records, and it ignore other undo log. trx_rseg_t::needs_purge: Renamed from trx_rseg_t::last_del_marks. Indicates whether a rollback segment needs to be processed by purge. TRX_UNDO_NEEDS_PURGE: Renamed from TRX_UNDO_DEL_MARKS. Indicates whether a rollback segment needs to be processed by purge. This will be 1 until trx_purge_free_segment() has been invoked. row_purge_record_func(): Set the is_insert flag for TRX_UNDO_INSERT_REC, so that the DB_ROLL_PTR will match in row_purge_reset_trx_id(). trx_purge_fetch_next_rec(): Add a comment about row_purge_record_func() going to set the is_insert flag. trx_purge_read_undo_rec(): Always attempt to read the undo log record. trx_purge_get_next_rec(): Do not skip any undo log records. Even when no clustered index record is going to be removed, we may want to reset some DB_TRX_ID,DB_ROLL_PTR. trx_undo_rec_get_cmpl_info(), trx_undo_rec_get_extern_storage(): Remove. trx_purge_add_undo_to_history(): Set the TRX_UNDO_NEEDS_PURGE flag so that the resetting will work on undo logs that were originally created before MDEV-12288 (MariaDB 10.3.1). trx_undo_roll_ptr_is_insert(), trx_purge_free_segment(): Cleanup (should be no functional change).
This commit is contained in:
26
mysql-test/suite/innodb/r/dml_purge.result
Normal file
26
mysql-test/suite/innodb/r/dml_purge.result
Normal file
@@ -0,0 +1,26 @@
|
||||
#
|
||||
# MDEV-12288 Reset DB_TRX_ID when the history is removed,
|
||||
# to speed up MVCC
|
||||
#
|
||||
CREATE TABLE t1(a INT PRIMARY KEY, b INT NOT NULL)
|
||||
ROW_FORMAT=REDUNDANT ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(1,2),(3,4);
|
||||
UPDATE t1 SET b=-3 WHERE a=3;
|
||||
SET GLOBAL innodb_fast_shutdown=0;
|
||||
Clustered index root page contents:
|
||||
N_RECS=2; LEVEL=0
|
||||
header=0x010000030087 (a=0x696e66696d756d00)
|
||||
header=0x0000100900a6 (a=0x80000001,
|
||||
DB_TRX_ID=0x000000000000,
|
||||
DB_ROLL_PTR=0x80000000000000,
|
||||
b=0x80000002)
|
||||
header=0x000018090074 (a=0x80000003,
|
||||
DB_TRX_ID=0x000000000000,
|
||||
DB_ROLL_PTR=0x80000000000000,
|
||||
b=0x7ffffffd)
|
||||
header=0x030008030000 (a=0x73757072656d756d00)
|
||||
SELECT * FROM t1;
|
||||
a b
|
||||
1 2
|
||||
3 -3
|
||||
DROP TABLE t1;
|
||||
@@ -9,93 +9,8 @@
|
||||
SET innodb_strict_mode=ON;
|
||||
CREATE TABLE tp(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC
|
||||
PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9;
|
||||
@@ -13,7 +15,7 @@
|
||||
header=0x01000003016e (NAME=0x696e66696d756d00)
|
||||
header=0x00002815008d (NAME='SYS_DATAFILES',
|
||||
DB_TRX_ID=0x000000000302,
|
||||
- DB_ROLL_PTR=0x81000001320194,
|
||||
+ DB_ROLL_PTR=0x81000001310194,
|
||||
ID=0x000000000000000e,
|
||||
N_COLS=0x00000002,
|
||||
TYPE=0x00000001,
|
||||
@@ -23,7 +25,7 @@
|
||||
SPACE=0x00000000)
|
||||
header=0x0000101500d5 (NAME='SYS_FOREIGN',
|
||||
DB_TRX_ID=0x000000000300,
|
||||
- DB_ROLL_PTR=0x800000012d0110,
|
||||
+ DB_ROLL_PTR=0x800000012c0110,
|
||||
ID=0x000000000000000b,
|
||||
N_COLS=0x00000004,
|
||||
TYPE=0x00000001,
|
||||
@@ -33,7 +35,7 @@
|
||||
SPACE=0x00000000)
|
||||
header=0x000018150122 (NAME='SYS_FOREIGN_COLS',
|
||||
DB_TRX_ID=0x000000000300,
|
||||
- DB_ROLL_PTR=0x800000012d0201,
|
||||
+ DB_ROLL_PTR=0x800000012c0201,
|
||||
ID=0x000000000000000c,
|
||||
N_COLS=0x00000004,
|
||||
TYPE=0x00000001,
|
||||
@@ -43,7 +45,7 @@
|
||||
SPACE=0x00000000)
|
||||
header=0x0400201501b8 (NAME='SYS_TABLESPACES',
|
||||
DB_TRX_ID=0x000000000302,
|
||||
- DB_ROLL_PTR=0x81000001320110,
|
||||
+ DB_ROLL_PTR=0x81000001310110,
|
||||
ID=0x000000000000000d,
|
||||
N_COLS=0x00000003,
|
||||
TYPE=0x00000001,
|
||||
@@ -53,7 +55,7 @@
|
||||
SPACE=0x00000000)
|
||||
header=0x000030150244 (NAME='SYS_VIRTUAL',
|
||||
DB_TRX_ID=0x000000000304,
|
||||
- DB_ROLL_PTR=0x82000001350110,
|
||||
+ DB_ROLL_PTR=0x82000001340110,
|
||||
ID=0x000000000000000f,
|
||||
N_COLS=0x00000003,
|
||||
TYPE=0x00000001,
|
||||
@@ -63,7 +65,7 @@
|
||||
SPACE=0x00000000)
|
||||
header=0x000040150288 (NAME='test/tc',
|
||||
DB_TRX_ID=0x000000000308,
|
||||
- DB_ROLL_PTR=0x84000001380110,
|
||||
+ DB_ROLL_PTR=0x84000001370110,
|
||||
ID=0x0000000000000011,
|
||||
N_COLS=0x80000001,
|
||||
TYPE=0x00000001,
|
||||
@@ -73,7 +75,7 @@
|
||||
SPACE=0x00000002)
|
||||
header=0x000048150310 (NAME='test/td',
|
||||
DB_TRX_ID=0x00000000030a,
|
||||
- DB_ROLL_PTR=0x85000001390110,
|
||||
+ DB_ROLL_PTR=0x85000001380110,
|
||||
ID=0x0000000000000012,
|
||||
N_COLS=0x80000001,
|
||||
TYPE=0x00000021,
|
||||
@@ -83,7 +85,7 @@
|
||||
SPACE=0x00000003)
|
||||
header=0x000058150200 (NAME='test/tp',
|
||||
DB_TRX_ID=0x00000000030e,
|
||||
- DB_ROLL_PTR=0x870000013b0110,
|
||||
+ DB_ROLL_PTR=0x870000013a0110,
|
||||
ID=0x0000000000000014,
|
||||
N_COLS=0x80000001,
|
||||
TYPE=0x000009a1,
|
||||
@@ -93,7 +95,7 @@
|
||||
SPACE=0x00000005)
|
||||
header=0x0000381502cc (NAME='test/tr',
|
||||
DB_TRX_ID=0x000000000306,
|
||||
- DB_ROLL_PTR=0x83000001370110,
|
||||
+ DB_ROLL_PTR=0x83000001360110,
|
||||
ID=0x0000000000000010,
|
||||
N_COLS=0x00000001,
|
||||
TYPE=0x00000001,
|
||||
@@ -103,10 +105,10 @@
|
||||
SPACE=0x00000001)
|
||||
header=0x000050150074 (NAME='test/tz',
|
||||
DB_TRX_ID=0x00000000030c,
|
||||
- DB_ROLL_PTR=0x860000013a0110,
|
||||
+ DB_ROLL_PTR=0x86000001390110,
|
||||
@@ -103,7 +105,7 @@
|
||||
DB_ROLL_PTR=0x80000000000000,
|
||||
ID=0x0000000000000013,
|
||||
N_COLS=0x80000001,
|
||||
- TYPE=0x00000023,
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
--- suite/innodb/r/table_flags.result
|
||||
+++ suite/innodb/r/table_flags,4k.reject
|
||||
@@ -13,7 +13,7 @@
|
||||
header=0x01000003016e (NAME=0x696e66696d756d00)
|
||||
header=0x00002815008d (NAME='SYS_DATAFILES',
|
||||
DB_TRX_ID=0x000000000302,
|
||||
- DB_ROLL_PTR=0x81000001320194,
|
||||
+ DB_ROLL_PTR=0x81000003260194,
|
||||
ID=0x000000000000000e,
|
||||
N_COLS=0x00000002,
|
||||
TYPE=0x00000001,
|
||||
@@ -23,7 +23,7 @@
|
||||
SPACE=0x00000000)
|
||||
header=0x0000101500d5 (NAME='SYS_FOREIGN',
|
||||
DB_TRX_ID=0x000000000300,
|
||||
- DB_ROLL_PTR=0x800000012d0110,
|
||||
+ DB_ROLL_PTR=0x80000003200110,
|
||||
ID=0x000000000000000b,
|
||||
N_COLS=0x00000004,
|
||||
TYPE=0x00000001,
|
||||
@@ -33,7 +33,7 @@
|
||||
SPACE=0x00000000)
|
||||
header=0x000018150122 (NAME='SYS_FOREIGN_COLS',
|
||||
DB_TRX_ID=0x000000000300,
|
||||
- DB_ROLL_PTR=0x800000012d0201,
|
||||
+ DB_ROLL_PTR=0x80000003200201,
|
||||
ID=0x000000000000000c,
|
||||
N_COLS=0x00000004,
|
||||
TYPE=0x00000001,
|
||||
@@ -43,7 +43,7 @@
|
||||
SPACE=0x00000000)
|
||||
header=0x0400201501b8 (NAME='SYS_TABLESPACES',
|
||||
DB_TRX_ID=0x000000000302,
|
||||
- DB_ROLL_PTR=0x81000001320110,
|
||||
+ DB_ROLL_PTR=0x81000003260110,
|
||||
ID=0x000000000000000d,
|
||||
N_COLS=0x00000003,
|
||||
TYPE=0x00000001,
|
||||
@@ -53,7 +53,7 @@
|
||||
SPACE=0x00000000)
|
||||
header=0x000030150244 (NAME='SYS_VIRTUAL',
|
||||
DB_TRX_ID=0x000000000304,
|
||||
- DB_ROLL_PTR=0x82000001350110,
|
||||
+ DB_ROLL_PTR=0x820000032a0110,
|
||||
ID=0x000000000000000f,
|
||||
N_COLS=0x00000003,
|
||||
TYPE=0x00000001,
|
||||
@@ -63,7 +63,7 @@
|
||||
SPACE=0x00000000)
|
||||
header=0x000040150288 (NAME='test/tc',
|
||||
DB_TRX_ID=0x000000000308,
|
||||
- DB_ROLL_PTR=0x84000001380110,
|
||||
+ DB_ROLL_PTR=0x840000032d0110,
|
||||
ID=0x0000000000000011,
|
||||
N_COLS=0x80000001,
|
||||
TYPE=0x00000001,
|
||||
@@ -73,7 +73,7 @@
|
||||
SPACE=0x00000002)
|
||||
header=0x000048150310 (NAME='test/td',
|
||||
DB_TRX_ID=0x00000000030a,
|
||||
- DB_ROLL_PTR=0x85000001390110,
|
||||
+ DB_ROLL_PTR=0x850000032f0110,
|
||||
ID=0x0000000000000012,
|
||||
N_COLS=0x80000001,
|
||||
TYPE=0x00000021,
|
||||
@@ -83,7 +83,7 @@
|
||||
SPACE=0x00000003)
|
||||
header=0x000058150200 (NAME='test/tp',
|
||||
DB_TRX_ID=0x00000000030e,
|
||||
- DB_ROLL_PTR=0x870000013b0110,
|
||||
+ DB_ROLL_PTR=0x87000003310110,
|
||||
ID=0x0000000000000014,
|
||||
N_COLS=0x80000001,
|
||||
TYPE=0x000009a1,
|
||||
@@ -93,7 +93,7 @@
|
||||
SPACE=0x00000005)
|
||||
header=0x0000381502cc (NAME='test/tr',
|
||||
DB_TRX_ID=0x000000000306,
|
||||
- DB_ROLL_PTR=0x83000001370110,
|
||||
+ DB_ROLL_PTR=0x830000032c0110,
|
||||
ID=0x0000000000000010,
|
||||
N_COLS=0x00000001,
|
||||
TYPE=0x00000001,
|
||||
@@ -103,7 +103,7 @@
|
||||
SPACE=0x00000001)
|
||||
header=0x000050150074 (NAME='test/tz',
|
||||
DB_TRX_ID=0x00000000030c,
|
||||
- DB_ROLL_PTR=0x860000013a0110,
|
||||
+ DB_ROLL_PTR=0x86000003300110,
|
||||
ID=0x0000000000000013,
|
||||
N_COLS=0x80000001,
|
||||
TYPE=0x00000023,
|
||||
@@ -9,93 +9,8 @@
|
||||
SET innodb_strict_mode=ON;
|
||||
CREATE TABLE tp(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC
|
||||
PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9;
|
||||
@@ -13,7 +15,7 @@
|
||||
header=0x01000003016e (NAME=0x696e66696d756d00)
|
||||
header=0x00002815008d (NAME='SYS_DATAFILES',
|
||||
DB_TRX_ID=0x000000000302,
|
||||
- DB_ROLL_PTR=0x81000001320194,
|
||||
+ DB_ROLL_PTR=0x81000001310194,
|
||||
ID=0x000000000000000e,
|
||||
N_COLS=0x00000002,
|
||||
TYPE=0x00000001,
|
||||
@@ -23,7 +25,7 @@
|
||||
SPACE=0x00000000)
|
||||
header=0x0000101500d5 (NAME='SYS_FOREIGN',
|
||||
DB_TRX_ID=0x000000000300,
|
||||
- DB_ROLL_PTR=0x800000012d0110,
|
||||
+ DB_ROLL_PTR=0x800000012c0110,
|
||||
ID=0x000000000000000b,
|
||||
N_COLS=0x00000004,
|
||||
TYPE=0x00000001,
|
||||
@@ -33,7 +35,7 @@
|
||||
SPACE=0x00000000)
|
||||
header=0x000018150122 (NAME='SYS_FOREIGN_COLS',
|
||||
DB_TRX_ID=0x000000000300,
|
||||
- DB_ROLL_PTR=0x800000012d0201,
|
||||
+ DB_ROLL_PTR=0x800000012c0201,
|
||||
ID=0x000000000000000c,
|
||||
N_COLS=0x00000004,
|
||||
TYPE=0x00000001,
|
||||
@@ -43,7 +45,7 @@
|
||||
SPACE=0x00000000)
|
||||
header=0x0400201501b8 (NAME='SYS_TABLESPACES',
|
||||
DB_TRX_ID=0x000000000302,
|
||||
- DB_ROLL_PTR=0x81000001320110,
|
||||
+ DB_ROLL_PTR=0x81000001310110,
|
||||
ID=0x000000000000000d,
|
||||
N_COLS=0x00000003,
|
||||
TYPE=0x00000001,
|
||||
@@ -53,7 +55,7 @@
|
||||
SPACE=0x00000000)
|
||||
header=0x000030150244 (NAME='SYS_VIRTUAL',
|
||||
DB_TRX_ID=0x000000000304,
|
||||
- DB_ROLL_PTR=0x82000001350110,
|
||||
+ DB_ROLL_PTR=0x82000001340110,
|
||||
ID=0x000000000000000f,
|
||||
N_COLS=0x00000003,
|
||||
TYPE=0x00000001,
|
||||
@@ -63,7 +65,7 @@
|
||||
SPACE=0x00000000)
|
||||
header=0x000040150288 (NAME='test/tc',
|
||||
DB_TRX_ID=0x000000000308,
|
||||
- DB_ROLL_PTR=0x84000001380110,
|
||||
+ DB_ROLL_PTR=0x84000001370110,
|
||||
ID=0x0000000000000011,
|
||||
N_COLS=0x80000001,
|
||||
TYPE=0x00000001,
|
||||
@@ -73,7 +75,7 @@
|
||||
SPACE=0x00000002)
|
||||
header=0x000048150310 (NAME='test/td',
|
||||
DB_TRX_ID=0x00000000030a,
|
||||
- DB_ROLL_PTR=0x85000001390110,
|
||||
+ DB_ROLL_PTR=0x85000001380110,
|
||||
ID=0x0000000000000012,
|
||||
N_COLS=0x80000001,
|
||||
TYPE=0x00000021,
|
||||
@@ -83,7 +85,7 @@
|
||||
SPACE=0x00000003)
|
||||
header=0x000058150200 (NAME='test/tp',
|
||||
DB_TRX_ID=0x00000000030e,
|
||||
- DB_ROLL_PTR=0x870000013b0110,
|
||||
+ DB_ROLL_PTR=0x870000013a0110,
|
||||
ID=0x0000000000000014,
|
||||
N_COLS=0x80000001,
|
||||
TYPE=0x000009a1,
|
||||
@@ -93,7 +95,7 @@
|
||||
SPACE=0x00000005)
|
||||
header=0x0000381502cc (NAME='test/tr',
|
||||
DB_TRX_ID=0x000000000306,
|
||||
- DB_ROLL_PTR=0x83000001370110,
|
||||
+ DB_ROLL_PTR=0x83000001360110,
|
||||
ID=0x0000000000000010,
|
||||
N_COLS=0x00000001,
|
||||
TYPE=0x00000001,
|
||||
@@ -103,10 +105,10 @@
|
||||
SPACE=0x00000001)
|
||||
header=0x000050150074 (NAME='test/tz',
|
||||
DB_TRX_ID=0x00000000030c,
|
||||
- DB_ROLL_PTR=0x860000013a0110,
|
||||
+ DB_ROLL_PTR=0x86000001390110,
|
||||
@@ -103,7 +105,7 @@
|
||||
DB_ROLL_PTR=0x80000000000000,
|
||||
ID=0x0000000000000013,
|
||||
N_COLS=0x80000001,
|
||||
- TYPE=0x00000023,
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
--- suite/innodb/r/table_flags.result
|
||||
+++ suite/innodb/r/table_flags,8k.reject
|
||||
@@ -13,7 +13,7 @@
|
||||
header=0x01000003016e (NAME=0x696e66696d756d00)
|
||||
header=0x00002815008d (NAME='SYS_DATAFILES',
|
||||
DB_TRX_ID=0x000000000302,
|
||||
- DB_ROLL_PTR=0x81000001320194,
|
||||
+ DB_ROLL_PTR=0x81000001d70194,
|
||||
ID=0x000000000000000e,
|
||||
N_COLS=0x00000002,
|
||||
TYPE=0x00000001,
|
||||
@@ -23,7 +23,7 @@
|
||||
SPACE=0x00000000)
|
||||
header=0x0000101500d5 (NAME='SYS_FOREIGN',
|
||||
DB_TRX_ID=0x000000000300,
|
||||
- DB_ROLL_PTR=0x800000012d0110,
|
||||
+ DB_ROLL_PTR=0x80000001d10110,
|
||||
ID=0x000000000000000b,
|
||||
N_COLS=0x00000004,
|
||||
TYPE=0x00000001,
|
||||
@@ -33,7 +33,7 @@
|
||||
SPACE=0x00000000)
|
||||
header=0x000018150122 (NAME='SYS_FOREIGN_COLS',
|
||||
DB_TRX_ID=0x000000000300,
|
||||
- DB_ROLL_PTR=0x800000012d0201,
|
||||
+ DB_ROLL_PTR=0x80000001d10201,
|
||||
ID=0x000000000000000c,
|
||||
N_COLS=0x00000004,
|
||||
TYPE=0x00000001,
|
||||
@@ -43,7 +43,7 @@
|
||||
SPACE=0x00000000)
|
||||
header=0x0400201501b8 (NAME='SYS_TABLESPACES',
|
||||
DB_TRX_ID=0x000000000302,
|
||||
- DB_ROLL_PTR=0x81000001320110,
|
||||
+ DB_ROLL_PTR=0x81000001d70110,
|
||||
ID=0x000000000000000d,
|
||||
N_COLS=0x00000003,
|
||||
TYPE=0x00000001,
|
||||
@@ -53,7 +53,7 @@
|
||||
SPACE=0x00000000)
|
||||
header=0x000030150244 (NAME='SYS_VIRTUAL',
|
||||
DB_TRX_ID=0x000000000304,
|
||||
- DB_ROLL_PTR=0x82000001350110,
|
||||
+ DB_ROLL_PTR=0x82000001da0110,
|
||||
ID=0x000000000000000f,
|
||||
N_COLS=0x00000003,
|
||||
TYPE=0x00000001,
|
||||
@@ -63,7 +63,7 @@
|
||||
SPACE=0x00000000)
|
||||
header=0x000040150288 (NAME='test/tc',
|
||||
DB_TRX_ID=0x000000000308,
|
||||
- DB_ROLL_PTR=0x84000001380110,
|
||||
+ DB_ROLL_PTR=0x84000001dd0110,
|
||||
ID=0x0000000000000011,
|
||||
N_COLS=0x80000001,
|
||||
TYPE=0x00000001,
|
||||
@@ -73,7 +73,7 @@
|
||||
SPACE=0x00000002)
|
||||
header=0x000048150310 (NAME='test/td',
|
||||
DB_TRX_ID=0x00000000030a,
|
||||
- DB_ROLL_PTR=0x85000001390110,
|
||||
+ DB_ROLL_PTR=0x85000001de0110,
|
||||
ID=0x0000000000000012,
|
||||
N_COLS=0x80000001,
|
||||
TYPE=0x00000021,
|
||||
@@ -83,7 +83,7 @@
|
||||
SPACE=0x00000003)
|
||||
header=0x000058150200 (NAME='test/tp',
|
||||
DB_TRX_ID=0x00000000030e,
|
||||
- DB_ROLL_PTR=0x870000013b0110,
|
||||
+ DB_ROLL_PTR=0x87000001e00110,
|
||||
ID=0x0000000000000014,
|
||||
N_COLS=0x80000001,
|
||||
TYPE=0x000009a1,
|
||||
@@ -93,7 +93,7 @@
|
||||
SPACE=0x00000005)
|
||||
header=0x0000381502cc (NAME='test/tr',
|
||||
DB_TRX_ID=0x000000000306,
|
||||
- DB_ROLL_PTR=0x83000001370110,
|
||||
+ DB_ROLL_PTR=0x83000001dc0110,
|
||||
ID=0x0000000000000010,
|
||||
N_COLS=0x00000001,
|
||||
TYPE=0x00000001,
|
||||
@@ -103,7 +103,7 @@
|
||||
SPACE=0x00000001)
|
||||
header=0x000050150074 (NAME='test/tz',
|
||||
DB_TRX_ID=0x00000000030c,
|
||||
- DB_ROLL_PTR=0x860000013a0110,
|
||||
+ DB_ROLL_PTR=0x86000001df0110,
|
||||
ID=0x0000000000000013,
|
||||
N_COLS=0x80000001,
|
||||
TYPE=0x00000023,
|
||||
@@ -12,8 +12,8 @@ SYS_TABLES clustered index root page (8):
|
||||
N_RECS=10; LEVEL=0; INDEX_ID=0x0000000000000001
|
||||
header=0x01000003016e (NAME=0x696e66696d756d00)
|
||||
header=0x00002815008d (NAME='SYS_DATAFILES',
|
||||
DB_TRX_ID=0x000000000302,
|
||||
DB_ROLL_PTR=0x81000001320194,
|
||||
DB_TRX_ID=0x000000000000,
|
||||
DB_ROLL_PTR=0x80000000000000,
|
||||
ID=0x000000000000000e,
|
||||
N_COLS=0x00000002,
|
||||
TYPE=0x00000001,
|
||||
@@ -22,8 +22,8 @@ header=0x00002815008d (NAME='SYS_DATAFILES',
|
||||
CLUSTER_NAME=NULL(0 bytes),
|
||||
SPACE=0x00000000)
|
||||
header=0x0000101500d5 (NAME='SYS_FOREIGN',
|
||||
DB_TRX_ID=0x000000000300,
|
||||
DB_ROLL_PTR=0x800000012d0110,
|
||||
DB_TRX_ID=0x000000000000,
|
||||
DB_ROLL_PTR=0x80000000000000,
|
||||
ID=0x000000000000000b,
|
||||
N_COLS=0x00000004,
|
||||
TYPE=0x00000001,
|
||||
@@ -32,8 +32,8 @@ header=0x0000101500d5 (NAME='SYS_FOREIGN',
|
||||
CLUSTER_NAME=NULL(0 bytes),
|
||||
SPACE=0x00000000)
|
||||
header=0x000018150122 (NAME='SYS_FOREIGN_COLS',
|
||||
DB_TRX_ID=0x000000000300,
|
||||
DB_ROLL_PTR=0x800000012d0201,
|
||||
DB_TRX_ID=0x000000000000,
|
||||
DB_ROLL_PTR=0x80000000000000,
|
||||
ID=0x000000000000000c,
|
||||
N_COLS=0x00000004,
|
||||
TYPE=0x00000001,
|
||||
@@ -42,8 +42,8 @@ header=0x000018150122 (NAME='SYS_FOREIGN_COLS',
|
||||
CLUSTER_NAME=NULL(0 bytes),
|
||||
SPACE=0x00000000)
|
||||
header=0x0400201501b8 (NAME='SYS_TABLESPACES',
|
||||
DB_TRX_ID=0x000000000302,
|
||||
DB_ROLL_PTR=0x81000001320110,
|
||||
DB_TRX_ID=0x000000000000,
|
||||
DB_ROLL_PTR=0x80000000000000,
|
||||
ID=0x000000000000000d,
|
||||
N_COLS=0x00000003,
|
||||
TYPE=0x00000001,
|
||||
@@ -52,8 +52,8 @@ header=0x0400201501b8 (NAME='SYS_TABLESPACES',
|
||||
CLUSTER_NAME=NULL(0 bytes),
|
||||
SPACE=0x00000000)
|
||||
header=0x000030150244 (NAME='SYS_VIRTUAL',
|
||||
DB_TRX_ID=0x000000000304,
|
||||
DB_ROLL_PTR=0x82000001350110,
|
||||
DB_TRX_ID=0x000000000000,
|
||||
DB_ROLL_PTR=0x80000000000000,
|
||||
ID=0x000000000000000f,
|
||||
N_COLS=0x00000003,
|
||||
TYPE=0x00000001,
|
||||
@@ -62,8 +62,8 @@ header=0x000030150244 (NAME='SYS_VIRTUAL',
|
||||
CLUSTER_NAME=NULL(0 bytes),
|
||||
SPACE=0x00000000)
|
||||
header=0x000040150288 (NAME='test/tc',
|
||||
DB_TRX_ID=0x000000000308,
|
||||
DB_ROLL_PTR=0x84000001380110,
|
||||
DB_TRX_ID=0x000000000000,
|
||||
DB_ROLL_PTR=0x80000000000000,
|
||||
ID=0x0000000000000011,
|
||||
N_COLS=0x80000001,
|
||||
TYPE=0x00000001,
|
||||
@@ -72,8 +72,8 @@ header=0x000040150288 (NAME='test/tc',
|
||||
CLUSTER_NAME=NULL(0 bytes),
|
||||
SPACE=0x00000002)
|
||||
header=0x000048150310 (NAME='test/td',
|
||||
DB_TRX_ID=0x00000000030a,
|
||||
DB_ROLL_PTR=0x85000001390110,
|
||||
DB_TRX_ID=0x000000000000,
|
||||
DB_ROLL_PTR=0x80000000000000,
|
||||
ID=0x0000000000000012,
|
||||
N_COLS=0x80000001,
|
||||
TYPE=0x00000021,
|
||||
@@ -82,8 +82,8 @@ header=0x000048150310 (NAME='test/td',
|
||||
CLUSTER_NAME=NULL(0 bytes),
|
||||
SPACE=0x00000003)
|
||||
header=0x000058150200 (NAME='test/tp',
|
||||
DB_TRX_ID=0x00000000030e,
|
||||
DB_ROLL_PTR=0x870000013b0110,
|
||||
DB_TRX_ID=0x000000000000,
|
||||
DB_ROLL_PTR=0x80000000000000,
|
||||
ID=0x0000000000000014,
|
||||
N_COLS=0x80000001,
|
||||
TYPE=0x000009a1,
|
||||
@@ -92,8 +92,8 @@ header=0x000058150200 (NAME='test/tp',
|
||||
CLUSTER_NAME=NULL(0 bytes),
|
||||
SPACE=0x00000005)
|
||||
header=0x0000381502cc (NAME='test/tr',
|
||||
DB_TRX_ID=0x000000000306,
|
||||
DB_ROLL_PTR=0x83000001370110,
|
||||
DB_TRX_ID=0x000000000000,
|
||||
DB_ROLL_PTR=0x80000000000000,
|
||||
ID=0x0000000000000010,
|
||||
N_COLS=0x00000001,
|
||||
TYPE=0x00000001,
|
||||
@@ -102,8 +102,8 @@ header=0x0000381502cc (NAME='test/tr',
|
||||
CLUSTER_NAME=NULL(0 bytes),
|
||||
SPACE=0x00000001)
|
||||
header=0x000050150074 (NAME='test/tz',
|
||||
DB_TRX_ID=0x00000000030c,
|
||||
DB_ROLL_PTR=0x860000013a0110,
|
||||
DB_TRX_ID=0x000000000000,
|
||||
DB_ROLL_PTR=0x80000000000000,
|
||||
ID=0x0000000000000013,
|
||||
N_COLS=0x80000001,
|
||||
TYPE=0x00000023,
|
||||
|
||||
57
mysql-test/suite/innodb/t/dml_purge.test
Normal file
57
mysql-test/suite/innodb/t/dml_purge.test
Normal file
@@ -0,0 +1,57 @@
|
||||
--source include/innodb_page_size.inc
|
||||
--source include/not_embedded.inc
|
||||
|
||||
let INNODB_PAGE_SIZE=`select @@innodb_page_size`;
|
||||
let MYSQLD_DATADIR=`select @@datadir`;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-12288 Reset DB_TRX_ID when the history is removed,
|
||||
--echo # to speed up MVCC
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1(a INT PRIMARY KEY, b INT NOT NULL)
|
||||
ROW_FORMAT=REDUNDANT ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(1,2),(3,4);
|
||||
UPDATE t1 SET b=-3 WHERE a=3;
|
||||
|
||||
# Initiate a full purge, which should reset all DB_TRX_ID.
|
||||
SET GLOBAL innodb_fast_shutdown=0;
|
||||
--source include/shutdown_mysqld.inc
|
||||
# The following is based on innodb.table_flags:
|
||||
--perl
|
||||
use strict;
|
||||
my $ps= $ENV{INNODB_PAGE_SIZE};
|
||||
my $file= "$ENV{MYSQLD_DATADIR}/test/t1.ibd";
|
||||
open(FILE, "<", $file) || die "Unable to open $file\n";
|
||||
my $page;
|
||||
print "Clustered index root page contents:\n";
|
||||
sysseek(FILE, 3*$ps, 0) || die "Unable to seek $file";
|
||||
die "Unable to read $file" unless sysread(FILE, $page, $ps) == $ps;
|
||||
print "N_RECS=", unpack("n", substr($page,38+16,2));
|
||||
print "; LEVEL=", unpack("n", substr($page,38+26,2)), "\n";
|
||||
my @fields=("a","DB_TRX_ID","DB_ROLL_PTR", "b");
|
||||
for (my $offset= 0x65; $offset;
|
||||
$offset= unpack("n", substr($page,$offset-2,2)))
|
||||
{
|
||||
print "header=0x", unpack("H*",substr($page,$offset-6,6)), " (";
|
||||
my $n_fields= unpack("n", substr($page,$offset-4,2)) >> 1 & 0x3ff;
|
||||
my $start= 0;
|
||||
my $name;
|
||||
for (my $i= 0; $i < $n_fields; $i++) {
|
||||
my $end= unpack("C", substr($page, $offset-7-$i, 1));
|
||||
print ",\n " if $i;
|
||||
print "$fields[$i]=";
|
||||
if ($end & 0x80) {
|
||||
print "NULL(", ($end & 0x7f) - $start, " bytes)"
|
||||
} else {
|
||||
print "0x", unpack("H*", substr($page,$offset+$start,$end-$start))
|
||||
}
|
||||
$start= $end & 0x7f;
|
||||
}
|
||||
print ")\n";
|
||||
}
|
||||
close(FILE) || die "Unable to close $file\n";
|
||||
EOF
|
||||
--source include/start_mysqld.inc
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
@@ -27,6 +27,9 @@ let bugdir= $MYSQLTEST_VARDIR/tmp/table_flags;
|
||||
--let $d=--innodb-data-home-dir=$bugdir --innodb-log-group-home-dir=$bugdir
|
||||
--let $d=$d --innodb-data-file-path=ibdata1:1M:autoextend
|
||||
--let $d=$d --innodb-undo-tablespaces=0
|
||||
--let $d=$d --innodb-purge-rseg-truncate-frequency=1
|
||||
--let $d=$d --skip-innodb-fast-shutdown
|
||||
|
||||
--let $restart_parameters=$d --innodb-stats-persistent=0
|
||||
--source include/restart_mysqld.inc
|
||||
|
||||
|
||||
Reference in New Issue
Block a user