[MDEV-25692] Assertion `thd->is_error()' failed in void convert_error_to_warning(THD*) Created: 2021-05-17  Updated: 2022-05-23

Status: Open
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.6
Fix Version/s: 10.6

Type: Bug Priority: Major
Reporter: Ramesh Sivaraman Assignee: Alexey Botchkov
Resolution: Unresolved Votes: 0
Labels: not-10.2, not-10.3, not-10.4, not-10.5


 Description   

The assertion is similar to MDEV-25144, but the issue is not related to JSON

SET character_set_client=filename;
CREATE VIEW v1 AS SELECT 1;
SELECT * FROM information_schema.geometry_columns;

Leads to:

10.6.1 adb0fdb268c6b461a130c27f53a5244a3aa217e9 (Debug)

mysqld: /test/10.6_dbg/sql/sql_error.cc:994: void convert_error_to_warning(THD*): Assertion `thd->is_error()' failed.

10.6.1 adb0fdb268c6b461a130c27f53a5244a3aa217e9 (Debug)

Core was generated by `/test/MD170521-mariadb-10.6.1-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
Program terminated with signal SIGABRT, Aborted.
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
[Current thread is 1 (Thread 0x1500d0084700 (LWP 3341931))]
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00001500d242e859 in __GI_abort () at abort.c:79
#2  0x00001500d242e729 in __assert_fail_base (fmt=0x1500d25c4588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x563d8ff3d389 "thd->is_error()", file=0x563d8ff3c430 "/test/10.6_dbg/sql/sql_error.cc", line=994, function=<optimized out>) at assert.c:92
#3  0x00001500d243ff36 in __GI___assert_fail (assertion=assertion@entry=0x563d8ff3d389 "thd->is_error()", file=file@entry=0x563d8ff3c430 "/test/10.6_dbg/sql/sql_error.cc", line=line@entry=994, function=function@entry=0x563d8ff3c8c8 "void convert_error_to_warning(THD*)") at assert.c:101
#4  0x0000563d8f240c7f in convert_error_to_warning (thd=thd@entry=0x150078000db8) at /test/10.6_dbg/sql/sql_error.h:1007
#5  0x0000563d8fed8ec4 in Show::get_geometry_column_record (thd=0x150078000db8, tables=0x15007802d380, table=0x15007801efe0, res=<optimized out>, db_name=0x150078019950, table_name=0x150078019968) at /test/10.6_dbg/plugin/type_geom/plugin.cc:168
#6  0x0000563d8f3217d9 in fill_schema_table_by_open (thd=thd@entry=0x150078000db8, mem_root=mem_root@entry=0x1500d00812a0, is_show_fields_or_keys=is_show_fields_or_keys@entry=false, table=table@entry=0x15007801efe0, schema_table=schema_table@entry=0x563d921a7d38, orig_db_name=orig_db_name@entry=0x150078019950, orig_table_name=0x150078019968, open_tables_state_backup=0x1500d00812e0, can_deadlock=false) at /test/10.6_dbg/sql/sql_show.cc:4645
#7  0x0000563d8f3446d9 in get_all_tables (thd=0x150078000db8, tables=0x150078014738, cond=<optimized out>) at /test/10.6_dbg/sql/sql_show.cc:5253
#8  0x0000563d8f345d7f in get_schema_tables_result (join=join@entry=0x150078015df8, executed_place=executed_place@entry=PROCESSED_BY_JOIN_EXEC) at /test/10.6_dbg/sql/sql_show.cc:8727
#9  0x0000563d8f319c02 in JOIN::exec_inner (this=this@entry=0x150078015df8) at /test/10.6_dbg/sql/sql_select.cc:4586
#10 0x0000563d8f31a844 in JOIN::exec (this=this@entry=0x150078015df8) at /test/10.6_dbg/sql/sql_select.cc:4389
#11 0x0000563d8f318920 in mysql_select (thd=thd@entry=0x150078000db8, tables=0x150078014738, fields=@0x1500780141f8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x150078014678, last = 0x1500780177d8, elements = 13}, <No data fields>}, conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2684619520, result=0x150078015dd0, unit=0x150078005120, select_lex=0x1500780140a0) at /test/10.6_dbg/sql/sql_select.cc:4865
#12 0x0000563d8f318be6 in handle_select (thd=thd@entry=0x150078000db8, lex=lex@entry=0x150078005058, result=result@entry=0x150078015dd0, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.6_dbg/sql/sql_select.cc:446
#13 0x0000563d8f28c48b in execute_sqlcom_select (thd=thd@entry=0x150078000db8, all_tables=0x150078014738) at /test/10.6_dbg/sql/sql_parse.cc:6245
#14 0x0000563d8f299374 in mysql_execute_command (thd=thd@entry=0x150078000db8) at /test/10.6_dbg/sql/sql_parse.cc:3940
#15 0x0000563d8f2855af in mysql_parse (thd=thd@entry=0x150078000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1500d0083410) at /test/10.6_dbg/sql/sql_parse.cc:8019
#16 0x0000563d8f2943d3 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x150078000db8, packet=packet@entry=0x15007800b799 "SELECT * FROM information_schema.geometry_columns", packet_length=packet_length@entry=49, blocking=blocking@entry=true) at /test/10.6_dbg/sql/sql_class.h:1333
#17 0x0000563d8f2977cc in do_command (thd=0x150078000db8, blocking=blocking@entry=true) at /test/10.6_dbg/sql/sql_parse.cc:1406
#18 0x0000563d8f3f1550 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x563d92797a88, put_in_cache=put_in_cache@entry=true) at /test/10.6_dbg/sql/sql_connect.cc:1410
#19 0x0000563d8f3f1b55 in handle_one_connection (arg=arg@entry=0x563d92797a88) at /test/10.6_dbg/sql/sql_connect.cc:1312
#20 0x0000563d8f8a5b00 in pfs_spawn_thread (arg=0x563d92681398) at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
#21 0x00001500d293c609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#22 0x00001500d252b293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Bug confirmed present in:
MariaDB: 10.6.1 (dbg)

Bug (or feature/syntax) confirmed not present in:
MariaDB: 10.2.39 (dbg), 10.2.39 (opt), 10.3.30 (dbg), 10.3.30 (opt), 10.4.20 (dbg), 10.4.20 (opt), 10.5.11 (dbg), 10.5.11 (opt), 10.6.1 (opt)



 Comments   
Comment by Norio Akagi [ 2022-05-23 ]

I tried to repro this and saw this failure

==============================================================================
 
TEST                                      RESULT   TIME (ms) or COMMENT
--------------------------------------------------------------------------
 
worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 16000..16019
innodb.MDEV-28215                        [ fail ]
        Test ended at 2022-05-23 10:41:18
 
CURRENT_TEST: innodb.MDEV-28215
mysqltest: At line 1: query 'SET character_set_client=filename' failed: ER_WRONG_VALUE_FOR_VAR (1231): Variable 'character_set_client' can't be set to the value of 'filename'
 
The result from queries just before the failure was:
SET character_set_client=filename;

Wasn't this bug fixed by adding the validation showing up here ? @holyfoot

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