[MDEV-20101] Assertion failure on select @@global.'m2'.replicate_ignore_table; Created: 2019-07-19  Updated: 2019-08-05  Resolved: 2019-08-05

Status: Closed
Project: MariaDB Server
Component/s: Parser
Affects Version/s: 10.3.8, 10.4.0
Fix Version/s: 10.3.18, 10.4.8

Type: Bug Priority: Critical
Reporter: Marko Mäkelä Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: crash, regression

Issue Links:
Problem/Incident
is caused by MDEV-16244 sql_mode=ORACLE: Some keywords do not... Closed

 Description   

The following statement by itself in a test file will crash the server:

select @@global.'m2'.replicate_ignore_table;

I narrowed down the crash to this commit that implemented MDEV-16244.

10.3 611488e3d9029f617884e10e47da208b0a77efec

Version: '10.3.7-MariaDB-debug-log'  socket: '/dev/shm/10.3/mysql-test/var/tmp/mysqld.1.sock'  port: 16000  Source distribution
mysqld: /mariadb/10.3/sql/sql_class.cc:2486: bool THD::check_string_for_wellformedness(const char *, size_t, CHARSET_INFO *) const: Assertion `charset_is_system_charset' failed.
190719 11:01:22 [ERROR] mysqld got signal 6 ;
#6  0x00007fab9bf3d102 in __GI___assert_fail (assertion=0x55ba5a069ce5 "charset_is_system_charset", file=0x55ba5a069629 "/mariadb/10.3/sql/sql_class.cc", line=2486, function=0x55ba5a069cff "bool THD::check_string_for_wellformedness(const char *, size_t, CHARSET_INFO *) const") at assert.c:101
#7  0x000055ba596ffdf6 in THD::check_string_for_wellformedness (this=0x7fab84000cf8, str=0x7fab84014180 "m2", length=2, cs=0x55ba5a89e480 <my_charset_utf8_general_ci>) at /mariadb/10.3/sql/sql_class.cc:2486
#8  0x000055ba5973b2a7 in Lex_ident_sys_st::copy_sys (this=0x7fab95ded800, thd=0x7fab84000cf8, src=0x7fab95dedb70) at /mariadb/10.3/sql/sql_lex.cc:7991
#9  0x000055ba598fd77b in MYSQLparse (thd=0x7fab84000cf8) at /mariadb/10.3/sql/sql_yacc.yy:15214
#10 0x000055ba5975a8c8 in parse_sql (thd=0x7fab84000cf8, parser_state=0x7fab95dee6a0, creation_ctx=0x0, do_pfs_digest=<optimized out>) at /mariadb/10.3/sql/sql_parse.cc:10031
#11 0x000055ba5974ae70 in mysql_parse (thd=0x7fab84000cf8, rawbuf=0x7fab840140a8 "select @@global.'m2'.replicate_ignore_table", length=<optimized out>, parser_state=0x7fab95dee6a0, is_com_multi=<optimized out>, is_next_command=<optimized out>) at /mariadb/10.3/sql/sql_parse.cc:7973

Note: this change narrowly missed the 10.3.7 release, even though the version string says 10.3.7.

This bug was accidentally found by merging the test multi_source.mdev-8874 from 10.2 to 10.3. That test will be disabled in 10.3+ until this bug has been fixed. Please remember to re-enable the test as part of fixing this.



 Comments   
Comment by Alexander Barkov [ 2019-08-05 ]

Repeatable with this script executed in the `mysql` command line:

SET NAMES latin1;
SELECT @@global.'m2'.replicate_ignore_table;

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