1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-31822 ALTER TABLE ENGINE=x started failing instead of producing warning on unsupported TRANSACTIONAL=1

make TRANSACTIONAL table option behave similar to other engine-defined
table options. If the engine doesn't suport it:
* if specified expicitly in CREATE or ALTER - it's ER_UNKNOWN_OPTION
* an error or a warning depending on sql_mode IGNORE_BAD_TABLE_OPTIONS
* in ALTER TABLE from the engine that suppors it to the engine that
  doesn't - silently preserved (no warning)
* it is commented out in SHOW CREATE unless IGNORE_BAD_TABLE_OPTIONS
This commit is contained in:
Sergei Golubchik
2023-08-01 21:40:18 +02:00
parent da09ae05a9
commit 61acb43689
11 changed files with 177 additions and 34 deletions

View File

@ -1956,8 +1956,13 @@ static void add_table_options(THD *thd, TABLE *table,
}
if (share->transactional != HA_CHOICE_UNDEF)
{
bool do_comment= !table->file->has_transactional_option() && check_options;
if (do_comment)
packet->append(STRING_WITH_LEN(" /*"));
packet->append(STRING_WITH_LEN(" TRANSACTIONAL="));
packet->append(ha_choice_values[(uint) share->transactional], 1);
if (do_comment)
packet->append(STRING_WITH_LEN(" */"));
}
if (share->table_type == TABLE_TYPE_SEQUENCE)
packet->append(STRING_WITH_LEN(" SEQUENCE=1"));