[MDEV-15165] InnoDB purge for index on virtual column is trying to access an incomplete record Created: 2018-02-01  Updated: 2019-06-21  Resolved: 2018-02-01

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.2.2
Fix Version/s: 10.2.13

Type: Bug Priority: Major
Reporter: Marko Mäkelä Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: upstream-fixed, virtual_columns

Issue Links:
PartOf
is part of MDEV-14958 Merge new release of InnoDB MySQL 5.7... Closed
Relates
relates to MDEV-16222 Assertion `0' failed in row_purge_rem... Closed

 Description   

The following test, based on a test in a MySQL 8.0 fix BUG #26818787: ASSERTION: DATA0DATA.IC:430:TUPLE causes a crash in InnoDB:

diff --git a/mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test b/mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test
index 1862de268af..5e2cf3fd59b 100644
--- a/mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test
+++ b/mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test
@@ -184,7 +184,8 @@ connection default;
 update t set a = repeat('m', 16000) where a like "aaa%";
 connect(lock_table, localhost, root);
 lock table t write;
-disconnect prevent_purge;
+connection prevent_purge;
+commit;
 connection default;
 --source ../../innodb/include/wait_all_purged.inc
 disconnect lock_table;
@@ -194,6 +195,28 @@ commit;
 set global debug_dbug=@old_dbug;
 drop table t;
 
+CREATE TABLE t1(
+ u INT PRIMARY KEY, b BLOB, ug INT GENERATED ALWAYS AS (u) VIRTUAL,
+ INDEX bug(b(100),ug)
+) ENGINE=InnoDB;
+INSERT INTO t1 (u,b) VALUES(1,REPEAT('a',16384));
+connection prevent_purge;
+start transaction with consistent snapshot;
+connection default;
+DELETE FROM t1;
+SET DEBUG_SYNC='blob_write_middle SIGNAL halfway WAIT_FOR purged';
+send INSERT INTO t1 (u,b) VALUES(1,REPEAT('a',16384));
+connection prevent_purge;
+SET DEBUG_SYNC='now WAIT_FOR halfway';
+COMMIT;
+--source ../../innodb/include/wait_all_purged.inc
+SET DEBUG_SYNC='now SIGNAL purged';
+disconnect prevent_purge;
+
+connection default;
+reap;
+DROP TABLE t1;
+
 --source include/wait_until_count_sessions.inc
 set debug_sync=reset;
 SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;

error log

Version: '10.2.13-MariaDB-debug-log'  socket: '/mariadb/10.2-ext/build/mysql-test/var/tmp/mysqld.1.sock'  port: 16000  Source distribution
mysqld: /mariadb/10.2-ext/storage/innobase/include/data0data.ic:429: dfield_t* dtuple_get_nth_field(const dtuple_t*, ulint): Assertion `tuple' failed.
mysys/stacktrace.c:267(my_print_stacktrace)[0x55a6a0877ec9]
include/data0data.ic:430(dtuple_get_nth_field(dtuple_t const*, unsigned long))[0x55a6a08784e3]
row/row0purge.cc:584(0purge.cc:477)[0x55a6a0878b49]
que/que0que.cc:1055(que_thr_step(que_thr_t*))[0x55a6a0758888]
que/que0que.cc:1117(que_run_threads_low(que_thr_t*))[0x55a6a0758c35]
que/que0que.cc:1159(que_run_threads(que_thr_t*))[0x55a6a0758fde]
srv/srv0srv.cc:2561(srv_task_execute())[0x55a6a094083e]
srv/srv0srv.cc:2606(srv_worker_thread)[0x55a6a09409c4]


Generated at Thu Feb 08 08:19:10 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.