Commit 8fceadc7 authored by Andrew McDonnell's avatar Andrew McDonnell

Updated regression test to force repeat of 1134355. A 'fix' in sql_table,...

Updated regression test to force repeat of 1134355. A 'fix' in sql_table, causes assertion in ha_oqgraph
parent a4ab3fc6
......@@ -9,6 +9,8 @@ DROP TABLE IF EXISTS graph;
CREATE TABLE graph_base (
from_id INT UNSIGNED NOT NULL,
to_id INT UNSIGNED NOT NULL,
another_id INT UNSIGNED NOT NULL DEFAULT 1,
w DOUBLE NOT NULL DEFAULT 1,
PRIMARY KEY (from_id,to_id),
INDEX (to_id)
) ENGINE=MyISAM;
......@@ -23,7 +25,7 @@ CREATE TABLE graph (
linkid BIGINT UNSIGNED NULL,
KEY (latch, origid, destid) USING HASH,
KEY (latch, destid, origid) USING HASH
) ENGINE=OQGRAPH DATA_TABLE='graph_base' ORIGID='from_id', DESTID='to_id';
) ENGINE=OQGRAPH DATA_TABLE='graph_base' ORIGID='from_id', DESTID='to_id', WEIGHT='w';
# -- do some stuff
......@@ -35,8 +37,15 @@ INSERT INTO graph_base(from_id, to_id) VALUES (3,4), (4,3);
SELECT * from graph;
SELECT * FROM graph WHERE destid=2 and origid=1;
# -- trigger bug
# --error 1296 # commented out at the moment because the message is corrupted
# We cant do this anyway because of read onlyness of table.... 1036 == read only
--error 1036
alter table graph ORIGID = 'another_id';
# But we need that to hold even in an invalid situation!
# -- bug was: the following alter table would crash, instead of returning error 1296
# -- currently following may not crash, but does with the previous error 1036 causing statement present
# 'attribute not set to a valid column of 'xxx' - note currently truncating to graph_b instead of graph_base for some reason...
--error 1296
alter table graph ORIGID = 'something_else';
DELETE FROM graph_base;
......
......@@ -6093,6 +6093,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
uint *index_add_buffer= NULL;
uint candidate_key_count= 0;
bool no_pk;
engine_option_value *undo_option_list = NULL;
ulong explicit_used_fields= 0;
enum ha_extra_function extra_func= thd->locked_tables_mode
? HA_EXTRA_NOT_USED
......@@ -6500,6 +6501,16 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
if (is_index_maintenance_unique (table, alter_info))
need_copy_table= ALTER_TABLE_DATA_CHANGED;
// This modifies the options list of table
// we need to save the current end of list so we can de-link if
// there is a failure to copy_data_between_tables() (and posibly other cases?)
if (table->s->option_list) {
engine_option_value *end;
for (end= table->s->option_list; end->next; end= end->next) { undo_option_list = end; }
}
if (mysql_prepare_alter_table(thd, table, create_info, alter_info))
goto err;
......@@ -6898,6 +6909,10 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
order_num, order, &copied, &deleted,
alter_info->keys_onoff,
alter_info->error_if_not_empty);
if (error && undo_option_list) {
undo_option_list->next = NULL; // delink create_options, which will still get freed (which was causing a segfault on subsequent alter)
}
}
else
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment