summaryrefslogtreecommitdiff
path: root/mysql-test/suite/innodb/r
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-05-02 15:44:52 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2018-05-02 15:44:52 +0300
commit73a10cbcc5178ae5378abb821428d35d3276b4da (patch)
tree3975499030462d57bbd8533f248636cc2ec9cabf /mysql-test/suite/innodb/r
parentdcc5de66f45e6362ce20f2a8f1437b032735f996 (diff)
downloadmariadb-git-73a10cbcc5178ae5378abb821428d35d3276b4da.tar.gz
MDEV-16065 Assertion failed in btr_pcur_restore_position_func on UPDATE
btr_pcur_store_position(): Assert that the 'default row' record never is the only record in a page. (If that would happen, an empty root page would be re-created in the non-instant format, not containing the special record.) When the cursor is positioned on the page infimum, never use the 'default row' as the BTR_PCUR_BEFORE reference. (This is additional cleanup, not fixing the bug.) rec_copy_prefix_to_buf(): When converting a record prefix to the non-instant-add format, copy the original number of null flags. Rename the variable instant_len to instant_omit, and introduce a few more variables to make the code easiser to read. Note: In purge, rec_copy_prefix_to_buf() is also used for storing the persistent cursor position on a 'default row' record. The stored record reference will be garbage, but row_search_on_row_ref() will do special handling to reposition the cursor on the 'default row', based on ref->info_bits. innodb.dml_purge: Also cover the 'default row'.
Diffstat (limited to 'mysql-test/suite/innodb/r')
-rw-r--r--mysql-test/suite/innodb/r/dml_purge.result18
-rw-r--r--mysql-test/suite/innodb/r/instant_alter.result20
-rw-r--r--mysql-test/suite/innodb/r/instant_alter_debug.result2
3 files changed, 32 insertions, 8 deletions
diff --git a/mysql-test/suite/innodb/r/dml_purge.result b/mysql-test/suite/innodb/r/dml_purge.result
index eb542484724..95330b80d33 100644
--- a/mysql-test/suite/innodb/r/dml_purge.result
+++ b/mysql-test/suite/innodb/r/dml_purge.result
@@ -11,6 +11,7 @@ connect prevent_purge,localhost,root;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
connection default;
INSERT INTO t1 VALUES(1,2),(3,4);
+ALTER TABLE t1 ADD COLUMN c INT;
UPDATE t1 SET b=-3 WHERE a=3;
connect con1,localhost,root;
BEGIN;
@@ -21,8 +22,13 @@ InnoDB 0 transactions not purged
disconnect con1;
FLUSH TABLE t1 FOR EXPORT;
Clustered index root page contents:
-N_RECS=2; LEVEL=0
-header=0x010000030087 (a=0x696e66696d756d00)
+N_RECS=3; LEVEL=0
+header=0x0100000300c6 (a=0x696e66696d756d00)
+header=0x1000200b0087 (a=0x80000000,
+ DB_TRX_ID=0x000000000000,
+ DB_ROLL_PTR=0x80000000000000,
+ b=0x80000000,
+ c=NULL(4 bytes))
header=0x0000100900a6 (a=0x80000001,
DB_TRX_ID=0x000000000000,
DB_ROLL_PTR=0x80000000000000,
@@ -31,11 +37,11 @@ header=0x000018090074 (a=0x80000003,
DB_TRX_ID=0x000000000000,
DB_ROLL_PTR=0x80000000000000,
b=0x7ffffffd)
-header=0x030008030000 (a=0x73757072656d756d00)
+header=0x040008030000 (a=0x73757072656d756d00)
UNLOCK TABLES;
SELECT * FROM t1;
-a b
-1 2
-3 -3
+a b c
+1 2 NULL
+3 -3 NULL
DROP TABLE t1;
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;
diff --git a/mysql-test/suite/innodb/r/instant_alter.result b/mysql-test/suite/innodb/r/instant_alter.result
index 1580ba29717..a70a3d077e0 100644
--- a/mysql-test/suite/innodb/r/instant_alter.result
+++ b/mysql-test/suite/innodb/r/instant_alter.result
@@ -440,6 +440,12 @@ SELECT * FROM t1;
a b
a 1
DROP TABLE t1;
+CREATE TABLE t1 (a INT, b VARCHAR(8), PRIMARY KEY(b,a)) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
+INSERT INTO t1 VALUES (1,'foo');
+ALTER TABLE t1 ADD COLUMN c INT;
+UPDATE t1 SET c = 1;
+UPDATE t1 SET c = 2;
+DROP TABLE t1;
CREATE TABLE t1
(id INT PRIMARY KEY, c2 INT UNIQUE,
c3 POINT NOT NULL DEFAULT ST_GeomFromText('POINT(3 4)'),
@@ -826,6 +832,12 @@ SELECT * FROM t1;
a b
a 1
DROP TABLE t1;
+CREATE TABLE t1 (a INT, b VARCHAR(8), PRIMARY KEY(b,a)) ENGINE=InnoDB ROW_FORMAT=COMPACT;
+INSERT INTO t1 VALUES (1,'foo');
+ALTER TABLE t1 ADD COLUMN c INT;
+UPDATE t1 SET c = 1;
+UPDATE t1 SET c = 2;
+DROP TABLE t1;
CREATE TABLE t1
(id INT PRIMARY KEY, c2 INT UNIQUE,
c3 POINT NOT NULL DEFAULT ST_GeomFromText('POINT(3 4)'),
@@ -1212,10 +1224,16 @@ SELECT * FROM t1;
a b
a 1
DROP TABLE t1;
+CREATE TABLE t1 (a INT, b VARCHAR(8), PRIMARY KEY(b,a)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
+INSERT INTO t1 VALUES (1,'foo');
+ALTER TABLE t1 ADD COLUMN c INT;
+UPDATE t1 SET c = 1;
+UPDATE t1 SET c = 2;
+DROP TABLE t1;
disconnect analyze;
SELECT variable_value-@old_instant instants
FROM information_schema.global_status
WHERE variable_name = 'innodb_instant_alter_column';
instants
-36
+39
SET GLOBAL innodb_purge_rseg_truncate_frequency= @saved_frequency;
diff --git a/mysql-test/suite/innodb/r/instant_alter_debug.result b/mysql-test/suite/innodb/r/instant_alter_debug.result
index 3aec7553ff0..bd7d538678a 100644
--- a/mysql-test/suite/innodb/r/instant_alter_debug.result
+++ b/mysql-test/suite/innodb/r/instant_alter_debug.result
@@ -35,7 +35,7 @@ ALTER TABLE t4 ADD COLUMN b INT;
SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS
LEFT JOIN t4 ON (NUMERIC_SCALE = pk);
COUNT(*)
-1748
+953
SET DEBUG_SYNC='innodb_inplace_alter_table_enter SIGNAL enter WAIT_FOR delete';
ALTER TABLE t4 ADD COLUMN c INT;
connect dml,localhost,root,,;