1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-09 08:01:34 +03:00

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().
This commit is contained in:
marko
2007-06-04 12:25:32 +00:00
parent 935ac4c285
commit a837a4df1e

View File

@@ -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 @@ func_exit_early:
innobase_commit_low(prebuilt->trx);
}
prebuilt->sql_stat_start = stmt_start;
return(error);
}