[MDEV-20599] Virtual column: InnoDB: Failing assertion: !((system_charset_info)->coll->strcasecmp((system_charset_info), (from), (s))) Created: 2019-09-16  Updated: 2021-04-28  Resolved: 2020-12-04

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

Type: Bug Priority: Major
Reporter: Matthias Leich Assignee: Nikita Malyavin
Resolution: Won't Fix Votes: 0
Labels: affects-tests

Issue Links:
Relates
relates to MDEV-25533 Assertion `!((system_charset_info)->c... Open
relates to MDEV-16501 [10.1] InnoDB: Failing assertion: !st... Closed

 Description   

Assert hit during RQG testing. The corresponding MTR based test is:
CREATE TABLE t2 ( col1 INT, col_text TEXT, col_text_g_copy TEXT GENERATED ALWAYS AS (SUBSTR(col_text,1,499)) VIRTUAL ) ENGINE = InnoDB ;
 
ALTER TABLE t2 CHANGE COLUMN col_text_g_copy col_text_g TEXT GENERATED ALWAYS AS (SUBSTR(col_text,1,499)) VIRTUAL ;
 
DROP TABLE t2;
 
...
Version: '10.1.42-MariaDB-debug'  socket: 'bld_debug/mysql-test/var/tmp/mysqld.1.sock'  port: 16000  Source distribution
2019-09-16 12:58:39 7fe52d002700  InnoDB: Assertion failure in thread 140622279223040 in file dict0mem.cc line 501
InnoDB: Failing assertion: !((system_charset_info)->coll->strcasecmp((system_charset_info), (from), (s)))
...
Query (0x7fe514cfc020): ALTER TABLE t2 CHANGE COLUMN col_text_g_copy col_text_g TEXT GENERATED ALWAYS AS (SUBSTR(col_text,1,499)) VIRTUAL
Connection ID (thread ID): 3
Status: NOT_KILLED
...
Thread 1 (Thread 0x7fe52d002700 (LWP 94677)):
#0  __pthread_kill (threadid=<optimized out>, signo=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:62
#1  0x000055d77291143a in my_write_core (sig=6) at mysys/stacktrace.c:477
#2  0x000055d7722aeee9 in handle_fatal_signal (sig=6) at sql/signal_handler.cc:296
#3  <signal handler called>
#4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:58
#5  0x00007fe52adf137a in __GI_abort () at abort.c:89
#6  0x00007fe523e74d14 in dict_mem_table_col_rename (table=0x7fe514d8b678, nth_col=2, from=0x7fe514ca08c7 "col_text_g_copy", to=0x7fe514cfc7c0 "col_text_g") at storage/innobase/dict/dict0mem.cc:501
#7  0x00007fe523f18fe2 in innobase_rename_columns_cache (ha_alter_info=0x7fe52cffe740, table=0x7fe514cd1c08, user_table=0x7fe514d8b678) at storage/innobase/handler/handler0alter.cc:4905
#8  0x00007fe523f1b25b in ha_innodb::commit_inplace_alter_table (this=0x7fe514cab820, altered_table=0x7fe514d5c008, ha_alter_info=0x7fe52cffe740, commit=true) at storage/innobase/handler/handler0alter.cc:6186
#9  0x000055d7722b9573 in handler::ha_commit_inplace_alter_table (this=0x7fe514cab820, altered_table=0x7fe514d5c008, ha_alter_info=0x7fe52cffe740, commit=true) at sql/handler.cc:4292
#10 0x000055d772130b5e in mysql_inplace_alter_table (thd=0x7fe51e2f8008, table_list=0x7fe514cfc1b0, table=0x7fe514cd1c08, altered_table=0x7fe514d5c008, ha_alter_info=0x7fe52cffe740, inplace_supported=HA_ALTER_INPLACE_NO_LOCK_AFTER_PREPARE, target_mdl_request=0x7fe52cffe7b0, alter_ctx=0x7fe52cfff360) at sql/sql_table.cc:7209
#11 0x000055d772135710 in mysql_alter_table (thd=0x7fe51e2f8008, new_db=0x7fe514cfc7a8 "test", new_name=0x0, create_info=0x7fe52cffff50, table_list=0x7fe514cfc1b0, alter_info=0x7fe52cfffec0, order_num=0, order=0x0, ignore=false) at sql/sql_table.cc:9077
#12 0x000055d7721a8458 in Sql_cmd_alter_table::execute (this=0x7fe514cfcc18, thd=0x7fe51e2f8008) at sql/sql_alter.cc:334
#13 0x000055d772073bcb in mysql_execute_command (thd=0x7fe51e2f8008) at sql/sql_parse.cc:5442
#14 0x000055d7720787a1 in mysql_parse (thd=0x7fe51e2f8008, rawbuf=0x7fe514cfc020 "ALTER TABLE t2 CHANGE COLUMN col_text_g_copy col_text_g TEXT GENERATED ALWAYS AS (SUBSTR(col_text,1,499)) VIRTUAL", length=113, parser_state=0x7fe52d0011e0) at sql/sql_parse.cc:7209
#15 0x000055d772067953 in dispatch_command (command=COM_QUERY, thd=0x7fe51e2f8008, packet=0x7fe51e281009 "ALTER TABLE t2 CHANGE COLUMN col_text_g_copy col_text_g TEXT GENERATED ALWAYS AS (SUBSTR(col_text,1,499)) VIRTUAL ", packet_length=114) at sql/sql_parse.cc:1499
#16 0x000055d772066711 in do_command (thd=0x7fe51e2f8008) at sql/sql_parse.cc:1131
#17 0x000055d7721a3893 in do_handle_one_connection (thd_arg=0x7fe51e2f8008) at sql/sql_connect.cc:1331
#18 0x000055d7721a35c4 in handle_one_connection (arg=0x7fe51e2f8008) at sql/sql_connect.cc:1242
#19 0x000055d7725d88fa in pfs_spawn_thread (arg=0x7fe52a03f208) at storage/perfschema/pfs.cc:1861
#20 0x00007fe52b8196da in start_thread (arg=0x7fe52d002700) at pthread_create.c:456
#21 0x00007fe52aec2d7f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:105
 
10.1 commit d6f0e60a67a5e81dc6fd90a117db2aa5fb658664          2019-09-11
No replay on
10.2.27 commit df4dee4b84ddc34799fa3a9648c142f12564597f    2019-09-11



 Comments   
Comment by Marko Mäkelä [ 2019-09-16 ]

Before MariaDB 10.2, InnoDB should ignore any virtual column definitions altogether. Apparently that is not the case in inplace_alter_table. It might be easiest to fix this in the SQL layer, outside InnoDB.

Comment by Elena Stepanova [ 2019-09-16 ]

It must be related to MDEV-16501.

Comment by Nikita Malyavin [ 2020-12-04 ]

I did not work through this task, but based on what marko says, it can be closed

Comment by Matthias Leich [ 2020-12-04 ]

I have never observed that problem on a version > 10.1.

Comment by Roel Van de Paar [ 2021-04-27 ]

See MDEV-25533

Generated at Thu Feb 08 09:00:43 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.