diff options
Diffstat (limited to 'sql/handler.cc')
-rw-r--r-- | sql/handler.cc | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/sql/handler.cc b/sql/handler.cc index c5bd441eaf0..df95c0244db 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -8448,90 +8448,6 @@ bool Vers_parse_info::check_conditions(const Lex_table_name &table_name, return false; } -static bool is_versioning_timestamp(const Column_definition *f) -{ - return f->type_handler() == &type_handler_timestamp2 && - f->length == MAX_DATETIME_FULL_WIDTH; -} - -static bool is_some_bigint(const Column_definition *f) -{ - return f->type_handler() == &type_handler_slonglong || - f->type_handler() == &type_handler_ulonglong || - f->type_handler() == &type_handler_vers_trx_id; -} - -static bool is_versioning_bigint(const Column_definition *f) -{ - return is_some_bigint(f) && f->flags & UNSIGNED_FLAG && - f->length == MY_INT64_NUM_DECIMAL_DIGITS - 1; -} - -static void require_timestamp_error(const char *field, const char *table) -{ - my_error(ER_VERS_FIELD_WRONG_TYPE, MYF(0), field, "TIMESTAMP(6)", table); -} - -static void require_trx_id_error(const char *field, const char *table) -{ - my_error(ER_VERS_FIELD_WRONG_TYPE, MYF(0), field, "BIGINT(20) UNSIGNED", - table); -} - - -bool Vers_type_timestamp::check_sys_fields(const LEX_CSTRING &table_name, - const Column_definition *row_start, - const Column_definition *row_end) const -{ - if (!is_versioning_timestamp(row_start)) - { - require_timestamp_error(row_start->field_name.str, table_name.str); - return true; - } - - if (row_end->type_handler()->vers() != this || - !is_versioning_timestamp(row_end)) - { - require_timestamp_error(row_end->field_name.str, table_name.str); - return true; - } - - return false; -} - - -bool Vers_type_trx::check_sys_fields(const LEX_CSTRING &table_name, - const Column_definition *row_start, - const Column_definition *row_end) const -{ - if (!is_versioning_bigint(row_start)) - { - require_trx_id_error(row_start->field_name.str, table_name.str); - return true; - } - - if (row_end->type_handler()->vers() != this || - !is_versioning_bigint(row_end)) - { - require_trx_id_error(row_end->field_name.str, table_name.str); - return true; - } - - if (!is_some_bigint(row_start)) - { - require_timestamp_error(row_start->field_name.str, table_name.str); - return true; - } - - if (!TR_table::use_transaction_registry) - { - my_error(ER_VERS_TRT_IS_DISABLED, MYF(0)); - return true; - } - - return false; -} - bool Vers_parse_info::check_sys_fields(const Lex_table_name &table_name, const Lex_table_name &db, |