[MDEV-18865] Assertion `t->first->versioned_by_id()' failed in innodb_prepare_commit_versioned Created: 2019-03-08  Updated: 2019-12-29  Resolved: 2019-12-29

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB, Versioned Tables
Affects Version/s: 10.3, 10.4
Fix Version/s: 10.3.22, 10.4.12

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Nikita Malyavin
Resolution: Fixed Votes: 0
Labels: None


 Description   

--source include/have_innodb.inc
 
CREATE OR REPLACE TABLE t1 (b CHAR(8) GENERATED ALWAYS AS ('') VIRTUAL) ENGINE=InnoDB;
INSERT INTO t1 () VALUES ();
ALTER TABLE t1 ADD `row_start` BIGINT UNSIGNED AS ROW START, ADD `row_end` BIGINT UNSIGNED AS ROW END, ADD PERIOD FOR SYSTEM_TIME(`row_start`,`row_end`), WITH SYSTEM VERSIONING;
 
# Cleanup
DROP TABLE t1;

10.3 d30f17af

mysqld: /data/src/10.3/storage/innobase/handler/ha_innodb.cc:3641: ulonglong innodb_prepare_commit_versioned(THD*, ulonglong*): Assertion `t->first->versioned_by_id()' failed.
190309  1:14:30 [ERROR] mysqld got signal 6 ;
 
#7  0x00007f780fb75ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
#8  0x000055c58597fb7c in innodb_prepare_commit_versioned (thd=0x7f77c0000b00, trx_id=0x7f7808eb8020) at /data/src/10.3/storage/innobase/handler/ha_innodb.cc:3641
#9  0x000055c58544415b in mysql_inplace_alter_table (thd=0x7f77c0000b00, table_list=0x7f77c0014f08, table=0x7f77c00a60d0, altered_table=0x7f77c006db90, ha_alter_info=0x7f7808eb88b0, inplace_supported=HA_ALTER_INPLACE_COPY_LOCK, target_mdl_request=0x7f7808eb8ae0, alter_ctx=0x7f7808eb9090) at /data/src/10.3/sql/sql_table.cc:7578
#10 0x000055c58544a35e in mysql_alter_table (thd=0x7f77c0000b00, new_db=0x7f77c00051d0, new_name=0x7f77c0005590, create_info=0x7f7808eb9c80, table_list=0x7f77c0014f08, alter_info=0x7f7808eb9bc0, order_num=0, order=0x0, ignore=false) at /data/src/10.3/sql/sql_table.cc:9758
#11 0x000055c5854d252b in Sql_cmd_alter_table::execute (this=0x7f77c0015818, thd=0x7f77c0000b00) at /data/src/10.3/sql/sql_alter.cc:497
#12 0x000055c585373678 in mysql_execute_command (thd=0x7f77c0000b00) at /data/src/10.3/sql/sql_parse.cc:6335
#13 0x000055c58537873a in mysql_parse (thd=0x7f77c0000b00, rawbuf=0x7f77c0014cf8 "ALTER TABLE t1 ADD `row_start` BIGINT UNSIGNED AS ROW START, ADD `row_end` BIGINT UNSIGNED AS ROW END, ADD PERIOD FOR SYSTEM_TIME(`row_start`,`row_end`), WITH SYSTEM VERSIONING", length=176, parser_state=0x7f7808ebb5f0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:8142
#14 0x000055c585365825 in dispatch_command (command=COM_QUERY, thd=0x7f77c0000b00, packet=0x7f77c01622e1 "ALTER TABLE t1 ADD `row_start` BIGINT UNSIGNED AS ROW START, ADD `row_end` BIGINT UNSIGNED AS ROW END, ADD PERIOD FOR SYSTEM_TIME(`row_start`,`row_end`), WITH SYSTEM VERSIONING", packet_length=176, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1854
#15 0x000055c58536420f in do_command (thd=0x7f77c0000b00) at /data/src/10.3/sql/sql_parse.cc:1396
#16 0x000055c5854ccab5 in do_handle_one_connection (connect=0x55c58869b110) at /data/src/10.3/sql/sql_connect.cc:1403
#17 0x000055c5854cc839 in handle_one_connection (arg=0x55c58869b110) at /data/src/10.3/sql/sql_connect.cc:1309
#18 0x000055c585968fdb in pfs_spawn_thread (arg=0x55c5885e0400) at /data/src/10.3/storage/perfschema/pfs.cc:1862
#19 0x00007f781184c494 in start_thread (arg=0x7f7808ebc700) at pthread_create.c:333
#20 0x00007f780fc3293f in clone () from /lib/x86_64-linux-gnu/libc.so.6

No obvious effect on a non-debug build.



 Comments   
Comment by Nikita Malyavin [ 2019-03-22 ]

reproduced without virtual columns:

create or replace table t (x int) engine=innodb;
insert into t values (0);
alter table t add `row_start` bigint unsigned as row start, add `row_end` bigint unsigned as row end, add period for system_time(`row_start`,`row_end`), modify x int after row_start, with system versioning;

Comment by Sergei Golubchik [ 2019-10-25 ]

server change is fine, dunno about InnoDB part

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