Commit c087e527 authored by marko's avatar marko

ha_innobase::innobase_read_and_init_auto_inc(): Remember and restore

prebuilt->sql_stat_start.  In an ALTER TABLE statement in the innodb_gis
test, an ut_ad() assertion failed, because no IX lock had been acquired
on the table, because prebuilt->sql_stat_start was inadvertently reset
to FALSE, by this function.  This function was called via
ha_innobase::info() and mysql_prepare_alter_table().
parent 4a814d70
......@@ -7056,11 +7056,16 @@ ha_innobase::innobase_read_and_init_auto_inc(
longlong auto_inc;
ulint old_select_lock_type;
ibool trx_was_not_started = FALSE;
ibool stmt_start;
int error;
ut_a(prebuilt);
ut_a(prebuilt->table);
/* Remember if we are in the beginning of an SQL statement.
This function must not change that flag. */
stmt_start = prebuilt->sql_stat_start;
/* Prepare prebuilt->trx in the table handle */
update_thd(ha_thd());
......@@ -7182,6 +7187,8 @@ ha_innobase::innobase_read_and_init_auto_inc(
innobase_commit_low(prebuilt->trx);
}
prebuilt->sql_stat_start = stmt_start;
return(error);
}
......
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