V3 Attempting to rename the ORIGID attribute on a OQGRAPH engine table to 'parent' will cause mysqld to segfault
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OQGRAPH |
Fix Committed
|
Undecided
|
OQgraph developers |
Bug Description
This segfault is in a different place from #1134338
Given
CREATE TABLE tol_tree (
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='tol' origid='id' destid='id';
then
alter table tol_tree ORIGID='parent';
will segfault mysqld.
Note, if tol has another not null integer other than parent added to it, the following error is reported instead (and no crash)
ERROR 1036 (HY000): Table '#sql-36e_1' is read only
The only difference I can see is:
| parent | int(10) unsigned | YES | | NULL |
| someother | int(11) | NO | | NULL |
But then adding
| another | int(10) unsigned | YES | | NULL |
Allows the segfault to trigger, so it appears that it only occurs if the type itself matches.
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff7f64700 (LWP 32564)]
0x000000000075c6ca in merge_engine_
609 for (end= first; end->next; end= end->next) /* no-op */;
(gdb) bt
#0 0x000000000075c6ca in merge_engine_
#1 0x00000000006bbcc5 in mysql_prepare_
#2 0x00000000006be42e in mysql_alter_table (thd=0x7fffd41c
#3 0x000000000096f863 in Alter_table_
#4 0x000000000061c840 in mysql_execute_
#5 0x000000000061f9ec in mysql_parse (thd=0x7fffd41c
#6 0x00000000006129ba in dispatch_command (command=COM_QUERY, thd=0x7fffd41cee30, packet=
#7 0x0000000000611b35 in do_command (thd=0x7fffd41c
#8 0x0000000000721b31 in do_handle_
#9 0x00000000007215d9 in handle_
#10 0x00007ffff7bc98ca in start_thread (arg=<value optimized out>) at pthread_
#11 0x00007ffff706b92d in clone () at ../sysdeps/
#12 0x0000000000000000 in ?? ()
Related branches
- Maria-captains: Pending requested
summary: |
- Attempting to rename the ORIGID attribute on a OQGRAPH engine table to - 'parent' will cause mysqld to segfault + V3 Attempting to rename the ORIGID attribute on a OQGRAPH engine table + to 'parent' will cause mysqld to segfault |
Update - added a regression / repetition test case to test suite, and this instead now reports an error with junk table names:
mysqltest: At line 39: query 'alter table graph ORIGID = 'something_else'' failed: 1296: Got error -1 'Invalid OQGRAPH backing store ('/#sql- 4ad5_2' .origid attribute not set to a valid column of 'graph_b' from OQGRAPH
Maybe hints toward result