Commit 94fb5f41 authored by Marko Mäkelä's avatar Marko Mäkelä

Assert that instant ADD COLUMN cannot be used on temporary tables

The ALGORITHM=INPLACE interface is not accessible to temporary tables.
Therefore, instant ADD COLUMN cannot be used either.

dict_table_t::is_temporary(): New predicate.

dict_table_is_temporary(): Define as a wrapper macro.
parent 8c85028c
......@@ -1937,15 +1937,7 @@ dict_table_is_discarded(
const dict_table_t* table) /*!< in: table to check */
MY_ATTRIBUTE((warn_unused_result));
/********************************************************************//**
Check if it is a temporary table.
@return true if temporary table flag is set. */
UNIV_INLINE
bool
dict_table_is_temporary(
/*====================*/
const dict_table_t* table) /*!< in: table to check */
MY_ATTRIBUTE((warn_unused_result));
#define dict_table_is_temporary(table) (table)->is_temporary()
/********************************************************************//**
Turn-off redo-logging if temporary table. */
......
......@@ -1484,18 +1484,6 @@ dict_table_is_discarded(
return(DICT_TF2_FLAG_IS_SET(table, DICT_TF2_DISCARDED));
}
/********************************************************************//**
Check if it is a temporary table.
@return true if temporary table flag is set. */
UNIV_INLINE
bool
dict_table_is_temporary(
/*====================*/
const dict_table_t* table) /*!< in: table to check */
{
return(DICT_TF2_FLAG_IS_SET(table, DICT_TF2_TEMPORARY));
}
/********************************************************************//**
Turn-off redo-logging if temporary table. */
UNIV_INLINE
......
......@@ -1486,6 +1486,12 @@ struct dict_table_t {
{
return !(~flags & DICT_TF_MASK_NO_ROLLBACK);
}
/** @return whether this is a temporary table */
bool is_temporary() const
{
return flags2 & DICT_TF2_TEMPORARY;
}
/** @return whether this table is readable
@retval true normally
@retval false if this is a single-table tablespace
......@@ -1902,8 +1908,8 @@ inline bool dict_index_t::is_instant() const
ut_ad(n_core_fields <= n_fields);
ut_ad(n_core_fields == n_fields
|| (type & ~(DICT_UNIQUE | DICT_CORRUPT)) == DICT_CLUSTERED);
ut_ad(n_core_fields == n_fields
|| !(table->flags & DICT_TF_MASK_ZIP_SSIZE));
ut_ad(n_core_fields == n_fields || table->supports_instant());
ut_ad(n_core_fields == n_fields || !table->is_temporary());
return(n_core_fields != n_fields);
}
......
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