1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

SHOW TABLE STATUS now shows if an Aria table is transactional or not

This change also affects information_schema.tables

The create table option "transactional=0 | 1" is now always shown for
storage engines that supports both transactional/crash safe tables and
non transactional tables.

Before this patch the transactional=... option was only shown if the user
specified transactional=... in the CREATE TABLE or ALTER TABLE statement.
The reason for the change was to be able to make it easy to know if an Aria
table is transactional or not.
This commit is contained in:
Monty
2020-05-28 22:40:27 +03:00
parent 39dc461662
commit df4ab26a6b
5 changed files with 45 additions and 19 deletions

View File

@ -5504,10 +5504,25 @@ static int get_schema_tables_record(THD *thd, TABLE_LIST *tables,
str.qs_append(STRING_WITH_LEN(" partitioned"));
#endif
if (share->transactional != HA_CHOICE_UNDEF)
/*
Write transactional=0|1 for tables where the user has specified the
option or for tables that supports both transactional and non
transactional tables
*/
if (share->transactional != HA_CHOICE_UNDEF ||
(share->db_type() &&
share->db_type()->flags & HTON_TRANSACTIONAL_AND_NON_TRANSACTIONAL &&
file))
{
uint choice= share->transactional;
if (choice == HA_CHOICE_UNDEF)
choice= ((file->ha_table_flags() &
(HA_NO_TRANSACTIONS | HA_CRASH_SAFE)) ==
HA_NO_TRANSACTIONS ?
HA_CHOICE_NO : HA_CHOICE_YES);
str.qs_append(STRING_WITH_LEN(" transactional="));
str.qs_append(ha_choice_values[(uint) share->transactional]);
str.qs_append(ha_choice_values[choice]);
}
append_create_options(thd, &str, share->option_list, false, 0);