Commit 6b61f1bb authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-17161 TRUNCATE TABLE fails after upgrade from 10.1

parents b02c722e fc34e4c0
......@@ -12220,9 +12220,7 @@ create_table_info_t::gcols_in_fulltext_or_spatial()
/** Prepare to create a new table to an InnoDB database.
@param[in] name Table name
@return error number */
int
create_table_info_t::prepare_create_table(
const char* name)
int create_table_info_t::prepare_create_table(const char* name, bool strict)
{
DBUG_ENTER("prepare_create_table");
......@@ -12245,7 +12243,7 @@ create_table_info_t::prepare_create_table(
because InnoDB might actually support the option, but not under
the current conditions. The messages revealing the specific
problems are reported inside this function. */
if (create_options_are_invalid()) {
if (strict && create_options_are_invalid()) {
DBUG_RETURN(HA_WRONG_CREATE_OPTION);
}
......@@ -12572,7 +12570,7 @@ ha_innobase::create(
file_per_table, trx);
if ((error = info.initialize())
|| (error = info.prepare_create_table(name))) {
|| (error = info.prepare_create_table(name, !trx))) {
if (trx) {
trx_rollback_for_mysql(trx);
row_mysql_unlock_data_dictionary(trx);
......
......@@ -706,7 +706,7 @@ class create_table_info_t
bool create_option_tablespace_is_valid();
/** Prepare to create a table. */
int prepare_create_table(const char* name);
int prepare_create_table(const char* name, bool strict = true);
void allocate_trx();
......
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