mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
Merge tag '11.4' into 11.6
MariaDB 11.4.4 release
This commit is contained in:
@ -698,7 +698,30 @@ int SEQUENCE::read_initial_values(TABLE *table)
|
||||
|
||||
|
||||
/*
|
||||
Do the actiual reading of data from sequence table and
|
||||
This class is here to allow one to use import table space on sequences
|
||||
*/
|
||||
|
||||
class Silence_table_space_errors : public Internal_error_handler
|
||||
{
|
||||
public:
|
||||
Silence_table_space_errors() {}
|
||||
~Silence_table_space_errors() override = default;
|
||||
bool handle_condition(THD *thd,
|
||||
uint sql_errno,
|
||||
const char* sql_state,
|
||||
Sql_condition::enum_warning_level *level,
|
||||
const char* msg,
|
||||
Sql_condition ** cond_hdl) override
|
||||
{
|
||||
if (sql_errno == ER_TABLESPACE_DISCARDED || HA_ERR_TABLESPACE_MISSING)
|
||||
return true; // Silence it
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
Do the actual reading of data from sequence table and
|
||||
update values in the sequence object.
|
||||
|
||||
Called once from when table is opened
|
||||
@ -707,14 +730,21 @@ int SEQUENCE::read_initial_values(TABLE *table)
|
||||
int SEQUENCE::read_stored_values(TABLE *table)
|
||||
{
|
||||
int error;
|
||||
Silence_table_space_errors error_handler;
|
||||
THD *thd= table->in_use;
|
||||
DBUG_ENTER("SEQUENCE::read_stored_values");
|
||||
|
||||
thd->push_internal_handler(&error_handler);
|
||||
|
||||
MY_BITMAP *save_read_set= tmp_use_all_columns(table, &table->read_set);
|
||||
error= table->file->ha_read_first_row(table->record[0], MAX_KEY);
|
||||
tmp_restore_column_map(&table->read_set, save_read_set);
|
||||
|
||||
if (unlikely(error))
|
||||
{
|
||||
thd->pop_internal_handler();
|
||||
if (error == HA_ERR_TABLESPACE_MISSING && thd->tablespace_op)
|
||||
DBUG_RETURN(0); // Ignore error for ALTER TABLESPACE
|
||||
table->file->print_error(error, MYF(0));
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
@ -722,6 +752,7 @@ int SEQUENCE::read_stored_values(TABLE *table)
|
||||
adjust_values(reserved_until);
|
||||
|
||||
all_values_used= 0;
|
||||
thd->pop_internal_handler();
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
@ -944,8 +975,9 @@ longlong SEQUENCE::next_value(TABLE *table, bool second_round, int *error)
|
||||
DBUG_RETURN(next_value(table, 1, error));
|
||||
}
|
||||
|
||||
if (unlikely((*error= write(table, thd->variables.binlog_row_image !=
|
||||
BINLOG_ROW_IMAGE_MINIMAL))))
|
||||
if (unlikely((*error= write(table,
|
||||
(thd->variables.binlog_row_image !=
|
||||
BINLOG_ROW_IMAGE_MINIMAL)))))
|
||||
{
|
||||
reserved_until= org_reserved_until;
|
||||
next_free_value= res_value;
|
||||
|
Reference in New Issue
Block a user