A OQGRAPH engine table with an empty ORIGID will cause myslqd to segfault on DESCRIBE

Bug #1134337 reported by Andrew McDonnell
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OQGRAPH
Fix Committed
Undecided
Andrew McDonnell

Bug Description

Suspect same probably happens if DESTID is also ''.

DESCRIBE tol_tree;

Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7ffff7f64700 (LWP 31426)]
0x00007ffff6fce1b5 in *__GI_raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
 in ../nptl/sysdeps/unix/sysv/linux/raise.c
Current language: auto
The current source language is "auto; currently c".
(gdb) bt
#0 0x00007ffff6fce1b5 in *__GI_raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1 0x00007ffff6fd0fc0 in *__GI_abort () at abort.c:92
#2 0x0000000000aadf95 in ha_innobase::innobase_get_index (this=0x2ce2488, keynr=0) at /home/andrew/develop/maria/repo/andrew-dev/storage/innobase/handler/ha_innodb.cc:7419
#3 0x0000000000ab341e in ha_innobase::info_low (this=0x2ce2488, flag=26, stats_upd_option=DICT_STATS_FETCH) at /home/andrew/develop/maria/repo/andrew-dev/storage/innobase/handler/ha_innodb.cc:10398
#4 0x0000000000ab3a73 in ha_innobase::info (this=0x2ce2488, flag=26) at /home/andrew/develop/maria/repo/andrew-dev/storage/innobase/handler/ha_innodb.cc:10550
#5 0x0000000000aa9b2d in ha_innobase::open (this=0x2ce2488, name=0x2cdfb88 "./test/tol", mode=2, test_if_locked=18) at /home/andrew/develop/maria/repo/andrew-dev/storage/innobase/handler/ha_innodb.cc:4927
#6 0x00000000007e4f06 in handler::ha_open (this=0x2ce2488, table_arg=0x2cde888, name=0x2cdfb88 "./test/tol", mode=2, test_if_locked=18) at /home/andrew/develop/maria/repo/andrew-dev/sql/handler.cc:2347
#7 0x00000000006e55fd in open_table_from_share (thd=0x2bfc340, share=0x2cde468, alias=0x7fffec0db4cf "", db_stat=39, prgflag=44, ha_open_flags=16, outparam=0x2cde888, is_create_table=false) at /home/andrew/develop/maria/repo/andrew-dev/sql/table.cc:2652
#8 0x00007fffec0b9ae3 in ha_oqgraph::open (this=0x2cde058, name=0x2bcbd88 "./test/tol_tree", mode=2, test_if_locked=18) at /home/andrew/develop/maria/repo/andrew-dev/storage/oqgraph/ha_oqgraph.cc:415
#9 0x00000000007e4f06 in handler::ha_open (this=0x2cde058, table_arg=0x2cdd660, name=0x2bcbd88 "./test/tol_tree", mode=2, test_if_locked=18) at /home/andrew/develop/maria/repo/andrew-dev/sql/handler.cc:2347
#10 0x00000000006e55fd in open_table_from_share (thd=0x2bfc340, share=0x2bcb958, alias=0x2bd7a80 "tol_tree", db_stat=39, prgflag=44, ha_open_flags=16, outparam=0x2cdd660, is_create_table=false) at /home/andrew/develop/maria/repo/andrew-dev/sql/table.cc:2652
#11 0x00000000005b4377 in open_table (thd=0x2bfc340, table_list=0x2cf3d80, mem_root=0x7ffff7f60e20, ot_ctx=0x7ffff7f60e60) at /home/andrew/develop/maria/repo/andrew-dev/sql/sql_base.cc:3207
#12 0x00000000005b68e8 in open_and_process_table (thd=0x2bfc340, lex=0x7ffff7f61000, tables=0x2cf3d80, counter=0x7ffff7f60f8c, flags=1026, prelocking_strategy=0x7ffff7f60f90, has_prelocking_list=false, ot_ctx=0x7ffff7f60e60, new_frm_mem=0x7ffff7f60e20) at /home/andrew/develop/maria/repo/andrew-dev/sql/sql_base.cc:4564
#13 0x00000000005b7b35 in open_tables (thd=0x2bfc340, start=0x7ffff7f60f40, counter=0x7ffff7f60f8c, flags=1026, prelocking_strategy=0x7ffff7f60f90) at /home/andrew/develop/maria/repo/andrew-dev/sql/sql_base.cc:5115
#14 0x00000000005b8c33 in open_normal_and_derived_tables (thd=0x2bfc340, tables=0x2cf3d80, flags=1026, dt_phases=34) at /home/andrew/develop/maria/repo/andrew-dev/sql/sql_base.cc:5781
#15 0x0000000000693254 in fill_schema_table_by_open (thd=0x2bfc340, is_show_fields_or_keys=true, table=0x2c00d78, schema_table=0x1507740, orig_db_name=0x7ffff7f62580, orig_table_name=0x7ffff7f62570, open_tables_state_backup=0x7ffff7f62460, can_deadlock=false) at /home/andrew/develop/maria/repo/andrew-dev/sql/sql_show.cc:4067
#16 0x0000000000694239 in get_all_tables (thd=0x2bfc340, tables=0x2bda878, cond=0x0) at /home/andrew/develop/maria/repo/andrew-dev/sql/sql_show.cc:4623
#17 0x00000000006a21a2 in do_fill_table (thd=0x2bfc340, table_list=0x2bda878, join_table=0x2cf3668) at /home/andrew/develop/maria/repo/andrew-dev/sql/sql_show.cc:7928
#18 0x00000000006a25b9 in get_schema_tables_result (join=0x2bd6b68, executed_place=PROCESSED_BY_JOIN_EXEC) at /home/andrew/develop/maria/repo/andrew-dev/sql/sql_show.cc:8035
#19 0x000000000064c05c in JOIN::exec_inner (this=0x2bd6b68) at /home/andrew/develop/maria/repo/andrew-dev/sql/sql_select.cc:2411
#20 0x000000000064b6a7 in JOIN::exec (this=0x2bd6b68) at /home/andrew/develop/maria/repo/andrew-dev/sql/sql_select.cc:2255
#21 0x000000000064ec3e in mysql_select (thd=0x2bfc340, rref_pointer_array=0x2bff700, tables=0x2bda878, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2684619520, result=0x2bd6b48, unit=0x2bfedc8, select_lex=0x2bff4a0) at /home/andrew/develop/maria/repo/andrew-dev/sql/sql_select.cc:3192
#22 0x000000000064547a in handle_select (thd=0x2bfc340, lex=0x2bfed10, result=0x2bd6b48, setup_tables_done_option=0) at /home/andrew/develop/maria/repo/andrew-dev/sql/sql_select.cc:363
#23 0x000000000061d175 in execute_sqlcom_select (thd=0x2bfc340, all_tables=0x2bda878) at /home/andrew/develop/maria/repo/andrew-dev/sql/sql_parse.cc:5004
#24 0x0000000000615788 in mysql_execute_command (thd=0x2bfc340) at /home/andrew/develop/maria/repo/andrew-dev/sql/sql_parse.cc:2472
#25 0x000000000061f9ec in mysql_parse (thd=0x2bfc340, rawbuf=0x2bd9798 "describe tol_tree", length=17, parser_state=0x7ffff7f63670) at /home/andrew/develop/maria/repo/andrew-dev/sql/sql_parse.cc:6124
#26 0x00000000006129ba in dispatch_command (command=COM_QUERY, thd=0x2bfc340, packet=0x2bcf991 "describe tol_tree", packet_length=17) at /home/andrew/develop/maria/repo/andrew-dev/sql/sql_parse.cc:1266
#27 0x0000000000611b35 in do_command (thd=0x2bfc340) at /home/andrew/develop/maria/repo/andrew-dev/sql/sql_parse.cc:982
#28 0x0000000000721b31 in do_handle_one_connection (thd_arg=0x2bc5560) at /home/andrew/develop/maria/repo/andrew-dev/sql/sql_connect.cc:1267
#29 0x00000000007215d9 in handle_one_connection (arg=0x2bc5560) at /home/andrew/develop/maria/repo/andrew-dev/sql/sql_connect.cc:1181
#30 0x00007ffff7bc98ca in start_thread (arg=<value optimized out>) at pthread_create.c:300
#31 0x00007ffff706b92d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#32 0x0000000000000000 in ?? ()

Related branches

Revision history for this message
Andrew McDonnell (andymc73) wrote :

Note, even when #1134305 is fixed, this also must be fixed independently, because it may be posible to use ALTER TABLE to modify the attribute, or even for a misinformed user to modify the .FRM.

Example:

alter table tol_tree ORIGID='somefield';

Revision history for this message
Andrew McDonnell (andymc73) wrote :

Seems fixed by Arjens latest commit

Revision history for this message
Andrew McDonnell (andymc73) wrote :
Changed in oqgraph:
status: New → Fix Committed
Revision history for this message
Arjen Lentz (arjen-lentz) wrote :

Thanks for catching that Andrew. It'll be good to have the tests updated and extended.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.