mirror of
https://github.com/MariaDB/server.git
synced 2025-12-10 19:44:09 +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:
@@ -7056,11 +7056,16 @@ ha_innobase::innobase_read_and_init_auto_inc(
|
|||||||
longlong auto_inc;
|
longlong auto_inc;
|
||||||
ulint old_select_lock_type;
|
ulint old_select_lock_type;
|
||||||
ibool trx_was_not_started = FALSE;
|
ibool trx_was_not_started = FALSE;
|
||||||
|
ibool stmt_start;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
ut_a(prebuilt);
|
ut_a(prebuilt);
|
||||||
ut_a(prebuilt->table);
|
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 */
|
/* Prepare prebuilt->trx in the table handle */
|
||||||
update_thd(ha_thd());
|
update_thd(ha_thd());
|
||||||
|
|
||||||
@@ -7182,6 +7187,8 @@ func_exit_early:
|
|||||||
innobase_commit_low(prebuilt->trx);
|
innobase_commit_low(prebuilt->trx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
prebuilt->sql_stat_start = stmt_start;
|
||||||
|
|
||||||
return(error);
|
return(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user