An OQGRAPH table with ORIGID attribute empty or set to non-existent column on a OQGRAPH cause mysqld to segfault in ha_oqgraph
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OQGRAPH |
Fix Committed
|
Undecided
|
Andrew McDonnell |
Bug Description
Note: alter table tol_tree ORIGID='blah' correctly yields an error message if blah doesnt exist (not non-null integer)
alter table tol_tree ORIGID=''
alter table tol_tree ORIGID='' when correct
[Switching to Thread 0x7ffff7f64700 (LWP 32528)]
0x00007fffec0b9e07 in ha_oqgraph::open (this=0x2a024b8, name=0x29fde18 "./test/
464 if ((*field)->type() != origid->type() ||
(gdb) bt
#0 0x00007fffec0b9e07 in ha_oqgraph::open (this=0x2a024b8, name=0x29fde18 "./test/
#1 0x00000000007e4f06 in handler::ha_open (this=0x2a024b8, table_arg=
#2 0x00000000006e55fd in open_table_
#3 0x00000000005b9b65 in open_table_uncached (thd=0x7fffe81d
#4 0x00000000006bf184 in mysql_alter_table (thd=0x7fffe81d
#5 0x000000000096f863 in Alter_table_
#6 0x000000000061c840 in mysql_execute_
#7 0x000000000061f9ec in mysql_parse (thd=0x7fffe81d
#8 0x00000000006129ba in dispatch_command (command=COM_QUERY, thd=0x7fffe81d3820, packet=
#9 0x0000000000611b35 in do_command (thd=0x7fffe81d
#10 0x0000000000721b31 in do_handle_
#11 0x00000000007215d9 in handle_
#12 0x00007ffff7bc98ca in start_thread (arg=<value optimized out>) at pthread_
#13 0x00007ffff706b92d in clone () at ../sysdeps/
#14 0x0000000000000000 in ?? ()
#1134337
Related branches
Changed in oqgraph: | |
assignee: | nobody → Andrew McDonnell (andymc73) |
Changed in oqgraph: | |
status: | New → Fix Committed |
This also happens at the same line if you create a table with a non-existent column for ORIGID (and posibly DESTID)
CREATE TABLE `backing` (
`id` int(10) unsigned NOT NULL DEFAULT '0',
`parent` int(10) unsigned DEFAULT NULL,
`info` varchar(20) DEFAULT NULL,
`not_id_type` varchar(20) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `name` (`info`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE oqtable ( latch SMALLINT UNSIGNED NULL, origid BIGINT UNSIGNED NULL, destid BIGINT UNSIGNED NULL, weight DOUBLE NULL, seq BIGINT UNSIGNED NULL, linkid BIGINT UNSIGNED NULL, KEY (latch, origid, destid) USING HASH, KEY (latch, destid, origid) USING HASH ) ENGINE=OQGRAPH, DATA_TABLE= 'backing' ,ORIGID= 'bogus' ,DESTID= 'id';
describe oqtable;
Note that the stack trace is different (it comes through JOIN) :
Program received signal SIGSEGV, Segmentation fault. develop/ maria/repo/ andrew- dev/storage/ oqgraph/ ha_oqgraph. cc:462 develop/ maria/repo/ andrew- dev/storage/ oqgraph/ ha_oqgraph. cc:462 0x2d0aed0, name=0x2d1b578 "./test/oqtable", mode=2, test_if_locked=18) at /home/andrew/ develop/ maria/repo/ andrew- dev/sql/ handler. cc:2347 from_share (thd=0x2c92590, share=0x2d1b148, alias=0x2cc5aa8 "oqtable", db_stat=39, prgflag=44, ha_open_flags=16, outparam=0x2d0aed0, is_create_ table=false) at /home/andrew/ develop/ maria/repo/ andrew- dev/sql/ table.cc: 2663 0x2d07840, mem_root= 0x7ffff7f60e20, ot_ctx= 0x7ffff7f60e60) at /home/andrew/ develop/ maria/repo/ andrew- dev/sql/ sql_base. cc:3207 process_ table (thd=0x2c92590, lex=0x7ffff7f61000, tables=0x2d07840, counter= 0x7ffff7f60f8c, flags=1026, prelocking_ strategy= 0x7ffff7f60f90, has_prelocking_ list=false, ot_ctx= 0x7ffff7f60e60, new_frm_ mem=0x7ffff7f60 e20) at /home/andrew/ develop/ maria/repo/ andrew- dev/sql/ sql_base. cc:4564 60f40, counter= 0x7ffff7f60f8c, flags=1026, prelocking_ strategy= 0x7ffff7f60f90) at /home/andrew/ develop/ maria/repo/ andrew- dev/sql/ sql_base. cc:5115 and_derived_ tables (thd=0x2c92590, tables=0x2d07840, flags=1026, dt_phases=34) at /home/andrew/ develop/ maria/repo/ andrew- dev/sql/ sql_base. cc:5781 table_by_ open (thd=0x2c92590, is_show_ fields_ or_keys= true, table=0x2cf7378, schema_ table=0x1507740 , orig_db_ name=0x7ffff7f6 2580, orig_table_ name=0x7ffff7f6 2570, open_tables_ state_backup= 0x7ffff7f62460, can_deadlock=false) at /home/andrew/ develop/ maria/repo/ andrew- dev/sql/ sql_show. cc:4067 develop/ maria/. ..
[Switching to Thread 0x7ffff7f64700 (LWP 16055)]
0x00007fffd5dc4e33 in ha_oqgraph::open (this=0x2d0b8c8, name=0x2d1b578 "./test/oqtable", mode=2, test_if_locked=18) at /home/andrew/
462 if ((*field)->type() != origid->type() ||
(gdb) ^CQuit
(gdb) bt
#0 0x00007fffd5dc4e33 in ha_oqgraph::open (this=0x2d0b8c8, name=0x2d1b578 "./test/oqtable", mode=2, test_if_locked=18) at /home/andrew/
#1 0x00000000007e4f7e in handler::ha_open (this=0x2d0b8c8, table_arg=
#2 0x00000000006e5677 in open_table_
#3 0x00000000005b4377 in open_table (thd=0x2c92590, table_list=
#4 0x00000000005b68e8 in open_and_
#5 0x00000000005b7b35 in open_tables (thd=0x2c92590, start=0x7ffff7f
#6 0x00000000005b8c33 in open_normal_
#7 0x0000000000693254 in fill_schema_
#8 0x0000000000694239 in get_all_tables (thd=0x2c92590, tables=0x2ca2c38, cond=0x0) at /home/andrew/