[MDEV-12379] Server crashes in TABLE_LIST::is_with_table on SHOW CREATE VIEW Created: 2017-03-28  Updated: 2020-08-25  Resolved: 2017-04-07

Status: Closed
Project: MariaDB Server
Component/s: Admin statements, Data Manipulation - Subquery, Views
Affects Version/s: 10.2.4, 10.2
Fix Version/s: 10.2.6

Type: Bug Priority: Critical
Reporter: Elena Stepanova Assignee: Oleksandr Byelkin
Resolution: Fixed Votes: 0
Labels: 10.2-ga

Issue Links:
Duplicate
duplicates MDEV-13053 Database service (MySQL) stops after ... Closed
Relates
relates to MDEV-3944 Allow derived tables in VIEWS Closed
relates to MDEV-9664 Test MDEV-3944 (Allow derived tables ... Closed

 Description   

CREATE TABLE t (i INT);
CREATE VIEW v AS SELECT * FROM ( SELECT * FROM t ) sq;
DROP TABLE IF EXISTS t;
SHOW CREATE VIEW v;

10.2 ad7da60deda

#3  <signal handler called>
#4  0x00007f2a67fb3b7c in TABLE_LIST::is_with_table (this=0x0) at /data/src/10.2/sql/table.cc:8007
#5  0x00007f2a67f283cc in TABLE_LIST::print (this=0x7f2a5c8672e0, thd=0x7f2a5c816070, eliminated_tables=0, str=0x7f2a6903f950, query_type=QT_ITEM_ORIGINAL_FUNC_NULLIF) at /data/src/10.2/sql/sql_select.cc:25039
#6  0x00007f2a67f2793c in print_table_array (thd=0x7f2a5c816070, eliminated_tables=0, str=0x7f2a6903f950, table=0x7f2a5c867e68, end=0x7f2a5c867e70, query_type=QT_ITEM_ORIGINAL_FUNC_NULLIF) at /data/src/10.2/sql/sql_select.cc:24782
#7  0x00007f2a67f27f07 in print_join (thd=0x7f2a5c816070, eliminated_tables=0, str=0x7f2a6903f950, tables=0x7f2a5c865218, query_type=QT_ITEM_ORIGINAL_FUNC_NULLIF) at /data/src/10.2/sql/sql_select.cc:24939
#8  0x00007f2a67f28c3b in st_select_lex::print (this=0x7f2a5c8650a8, thd=0x7f2a5c816070, str=0x7f2a6903f950, query_type=QT_ITEM_ORIGINAL_FUNC_NULLIF) at /data/src/10.2/sql/sql_select.cc:25202
#9  0x00007f2a67e976eb in st_select_lex_unit::print (this=0x7f2a5c864978, str=0x7f2a6903f950, query_type=QT_ITEM_ORIGINAL_FUNC_NULLIF) at /data/src/10.2/sql/sql_lex.cc:2706
#10 0x00007f2a67f3b749 in show_create_view (thd=0x7f2a5c816070, table=0x7f2a5c864160, buff=0x7f2a6903f950) at /data/src/10.2/sql/sql_show.cc:2413
#11 0x00007f2a67f372d2 in mysqld_show_create_get_fields (thd=0x7f2a5c816070, table_list=0x7f2a5c864160, field_list=0x7f2a6903f930, buffer=0x7f2a6903f950) at /data/src/10.2/sql/sql_show.cc:1185
#12 0x00007f2a67f37821 in mysqld_show_create (thd=0x7f2a5c816070, table_list=0x7f2a5c864160) at /data/src/10.2/sql/sql_show.cc:1259
#13 0x00007f2a67eaab8b in mysql_execute_command (thd=0x7f2a5c816070) at /data/src/10.2/sql/sql_parse.cc:4193
#14 0x00007f2a67eb652e in mysql_parse (thd=0x7f2a5c816070, rawbuf=0x7f2a5c864088 "SHOW CREATE VIEW v", length=18, parser_state=0x7f2a69040dd0, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7858
#15 0x00007f2a67ea45f4 in dispatch_command (command=COM_QUERY, thd=0x7f2a5c816070, packet=0x7f2a5c858071 "SHOW CREATE VIEW v", packet_length=18, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1812
#16 0x00007f2a67ea2f64 in do_command (thd=0x7f2a5c816070) at /data/src/10.2/sql/sql_parse.cc:1362
#17 0x00007f2a67febf99 in do_handle_one_connection (connect=0x7f2a64c65410) at /data/src/10.2/sql/sql_connect.cc:1358
#18 0x00007f2a67febd26 in handle_one_connection (arg=0x7f2a64c65410) at /data/src/10.2/sql/sql_connect.cc:1264
#19 0x00007f2a684046d8 in pfs_spawn_thread (arg=0x7f2a64c499f0) at /data/src/10.2/storage/perfschema/pfs.cc:1862
#20 0x00007f2a674cd064 in start_thread (arg=0x7f2a69042300) at pthread_create.c:309
#21 0x00007f2a6568562d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111



 Comments   
Comment by Oleksandr Byelkin [ 2017-04-04 ]

revision-id: 2caac5ddf2feb5d2a87d1fa4a563b14520635f09 (mariadb-10.2.4-121-g2caac5d)
parent(s): 6e105d75351dfcfd103c7b60838e59f1fd6b4749
committer: Oleksandr Byelkin
timestamp: 2017-04-04 11:00:25 +0200
message:

MDEV-12379: Server crashes in TABLE_LIST::is_with_table on SHOW CREATE VIEW

In case of error on opening VIEW (absent table for example) it is still possible to print its definition but some variable is not set (table_list->derived->derived) so it is better do not try to test it when there is safer alternative (table_list itself).

Comment by Igor Babaev [ 2017-04-04 ]

Ok to push.

Generated at Thu Feb 08 07:57:16 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.