1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +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

@ -3548,7 +3548,7 @@ public:
- How things are tracked in trx and in add_changed_table().
- If we can combine several statements under one commit in the binary log.
*/
bool has_transactions()
bool has_transactions() const
{
return ((ha_table_flags() & (HA_NO_TRANSACTIONS | HA_PERSISTENT_TABLE))
== 0);
@ -3559,24 +3559,33 @@ public:
we don't have to write failed statements to the log as they can be
rolled back.
*/
bool has_transactions_and_rollback()
bool has_transactions_and_rollback() const
{
return has_transactions() && has_rollback();
}
/*
True if the underlaying table support transactions and rollback
*/
bool has_transaction_manager()
bool has_transaction_manager() const
{
return ((ha_table_flags() & HA_NO_TRANSACTIONS) == 0 && has_rollback());
}
/*
True if the underlaying table support TRANSACTIONAL table option
*/
bool has_transactional_option() const
{
extern handlerton *maria_hton;
return partition_ht() == maria_hton || has_transaction_manager();
}
/*
True if table has rollback. Used to check if an update on the table
can be killed fast.
*/
bool has_rollback()
bool has_rollback() const
{
return ((ht->flags & HTON_NO_ROLLBACK) == 0);
}