[MDEV-19490] show tables fails when selecting the information_schema database Created: 2019-05-16  Updated: 2022-01-27  Resolved: 2019-05-16

Status: Closed
Project: MariaDB Server
Component/s: Information Schema
Affects Version/s: 10.2, 10.3, 10.4
Fix Version/s: 10.2.25, 10.3.16, 10.4.5

Type: Bug Priority: Blocker
Reporter: Daniel Gavrila Assignee: Michael Widenius
Resolution: Fixed Votes: 1
Labels: regression

Issue Links:
Duplicate
duplicates MDEV-19494 Crash on "SHOW TABLES" in INFORMATION... Closed
duplicates MDEV-19504 Segfault in COM_FIELD_LIST for INFORM... Closed
duplicates MDEV-19607 mysqld got signal 11 Closed
duplicates MDEV-19697 MariaDB crash/signal 11 when performi... Closed
duplicates MDEV-19721 use information_schema results in "[E... Closed
duplicates MDEV-19742 Signal 11 querying information_schema... Closed
is duplicated by MDEV-20678 MariaDB 10.3.15 Crash "[ERROR] mysqld... Closed
is duplicated by MDEV-21270 MariaDB crash on information_schema w... Closed
Problem/Incident
is caused by MDEV-19112 WITH clause does not work with inform... Closed
Relates

 Description   

I've recently upgraded from 10.2.24 -> 10.3.15 on
Linux 0 4.9.0-9-amd64 #1 SMP Debian 4.9.168-1 (2019-04-12) x86_64 GNU/Linux
Debian 9.9

MariaDB [core]> select version();
+---------------------------------------------+
| version()                                   |
+---------------------------------------------+
| 10.3.15-MariaDB-1:10.3.15+maria~stretch-log |
+---------------------------------------------+

When trying to:
```
> use information_schema;
> show tables;
```
I get
```

MariaDB [information_schema]> show tables;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)
ERROR: Can't connect to the server

```
and the following error.log entries:
```

190516  5:15:19 [ERROR] mysqld got signal 11 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
 
To report this bug, see https://mariadb.com/kb/en/reporting-bugs
 
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed, 
something is definitely wrong and this may fail.
 
Server version: 10.3.15-MariaDB-1:10.3.15+maria~stretch-log
key_buffer_size=33554432
read_buffer_size=131072
max_used_connections=1
max_threads=65537
thread_count=12
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 75756414 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
 
Thread pointer: 0x7fa440000a88
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0x7fa4b67fbc48 thread_stack 0x49000
/usr/sbin/mysqld(my_print_stacktrace+0x2e)[0x55b751c568de]
/usr/sbin/mysqld(handle_fatal_signal+0x3af)[0x55b75170535f]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x110e0)[0x7fac7699e0e0]
/usr/sbin/mysqld(+0xce1695)[0x55b751c96695]
/usr/sbin/mysqld(_Z17find_schema_tableP3THDPK25st_mysql_const_lex_stringPb+0x55)[0x55b7515940d5]
/usr/sbin/mysqld(_Z11open_tablesP3THDRK14DDL_options_stPP10TABLE_LISTPjPP19Sroutine_hash_entryjP19Prelocking_strategy+0xd9e)[0x55b7514ccbde]
/usr/sbin/mysqld(_Z30open_normal_and_derived_tablesP3THDP10TABLE_LISTjj+0x5a)[0x55b7514cd5da]
/usr/sbin/mysqld(_Z18mysqld_list_fieldsP3THDP10TABLE_LISTPKc+0x35)[0x55b751587225]
/usr/sbin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcjbb+0x234c)[0x55b75152f64c]
/usr/sbin/mysqld(_Z10do_commandP3THD+0x131)[0x55b75152fbc1]
/usr/sbin/mysqld(_Z11tp_callbackP13TP_connection+0x11f)[0x55b75163f73f]
/usr/sbin/mysqld(+0x724a10)[0x55b7516d9a10]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x74a4)[0x7fac769944a4]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x3f)[0x7fac750f3d0f]
 
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x7fa44000f650): 
Connection ID (thread ID): 13
Status: NOT_KILLED
 
Optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on
 
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
Writing a core file...
Working directory at /home/services/mariadb/data
Resource Limits:
Limit                     Soft Limit           Hard Limit           Units     
Max cpu time              unlimited            unlimited            seconds   
Max file size             unlimited            unlimited            bytes     
Max data size             unlimited            unlimited            bytes     
Max stack size            8388608              unlimited            bytes     
Max core file size        0                    unlimited            bytes     
Max resident set          unlimited            unlimited            bytes     
Max processes             122577               122577               processes 
Max open files            65535                65535                files     
Max locked memory         65536                65536                bytes     
Max address space         unlimited            unlimited            bytes     
Max file locks            unlimited            unlimited            locks     
Max pending signals       122577               122577               signals   
Max msgqueue size         819200               819200               bytes     
Max nice priority         0                    0                    
Max realtime priority     0                    0                    
Max realtime timeout      unlimited            unlimited            us        
Core pattern: core
```
 



 Comments   
Comment by Alice Sherepa [ 2019-05-16 ]

Reproducible on debug and non-debug version, 10.2-10.4

MariaDB [test]> use information_schema;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
 
Database changed
MariaDB [information_schema]> select 1;
ERROR 2006 (HY000): MySQL server has gone away

10.2 796486d19b7eede585666

190516 14:31:19 [ERROR] mysqld got signal 11 ;
 
strings/ctype-utf8.c:5300(my_strcasecmp_utf8)[0x557a46d4cb9c]
sql/sql_show.cc:7708(find_schema_table(THD*, char const*, bool*))[0x557a463d7b68]
sql/sql_show.h:123(find_schema_table(THD*, char const*))[0x557a462b5a2f]
sql/sql_base.cc:3402(open_and_process_table(THD*, TABLE_LIST*, unsigned int*, unsigned int, Prelocking_strategy*, bool, Open_table_context*))[0x557a462bba9f]
sql/sql_base.cc:4054(open_tables(THD*, DDL_options_st const&, TABLE_LIST**, unsigned int*, Sroutine_hash_entry**, unsigned int, Prelocking_strategy*))[0x557a462bd075]
sql/sql_base.h:251(open_tables(THD*, DDL_options_st const&, TABLE_LIST**, unsigned int*, unsigned int, Prelocking_strategy*))[0x557a462b5967]
sql/sql_base.h:260(open_tables(THD*, TABLE_LIST**, unsigned int*, unsigned int, Prelocking_strategy*))[0x557a462b59b8]
sql/sql_base.cc:4873(open_normal_and_derived_tables(THD*, TABLE_LIST*, unsigned int, unsigned int))[0x557a462bea55]
sql/sql_show.cc:1529(mysqld_list_fields(THD*, TABLE_LIST*, char const*))[0x557a463bf5cf]
sql/sql_parse.cc:2028(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x557a46328495]
sql/sql_parse.cc:1387(do_command(THD*))[0x557a463263b5]
sql/sql_connect.cc:1335(do_handle_one_connection(CONNECT*))[0x557a4647a120]
sql/sql_connect.cc:1242(handle_one_connection)[0x557a46479ea0]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7f9057d256ba]
x86_64/clone.S:111(clone)[0x7f90571ba41d]

Comment by Hartmut Holzgraefe [ 2019-05-16 ]

"Fun" part:

  • crashes when run interactively
  • not crashing if starting mysql client with "-A" option
  • not crashing when running directly from command line

    mysql information_schema -e 'SHOW TABLES'

  • not crashing when run interactively on Windows
Comment by Michael Widenius [ 2019-05-16 ]

The bug was that when using mysql_list_fields, then table_list->schema_table_name was not
filled in.
Fixed by using table_list->schema_table instead, which is always filled in.

Comment by Jaroslaw Jozwik [ 2019-06-06 ]

Version 10.3.15 on RHEL 7.6 64bit also affected.

Comment by Faustin Lammler [ 2019-07-10 ]

Version 10.3.15 on Debian 10 affected too (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=931801)

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