diff options
author | Alexander Barkov <bar@mariadb.com> | 2019-08-14 10:26:18 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2019-08-14 13:33:01 +0400 |
commit | e86010f909fb6b8c4ffd9d6df92991ac079e67e7 (patch) | |
tree | e30f0335d75b480ffe1f546c4b0f86b530c4558c /sql/handler.cc | |
parent | fa21952e25e3defef172e1f2074e3e2d5b091f5c (diff) | |
download | mariadb-git-e86010f909fb6b8c4ffd9d6df92991ac079e67e7.tar.gz |
MDEV-20342 Turn Field::flags from a member to a method
Diffstat (limited to 'sql/handler.cc')
-rw-r--r-- | sql/handler.cc | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/sql/handler.cc b/sql/handler.cc index 3e54d4a19d0..cd6ebe6495e 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -3259,7 +3259,7 @@ int handler::update_auto_increment() 1). Ignore negative values. */ - if ((longlong) nr > 0 || (table->next_number_field->flags & UNSIGNED_FLAG)) + if ((longlong) nr > 0 || table->next_number_field->is_unsigned()) adjust_next_insert_id_after_explicit_value(nr); insert_id_for_cur_row= 0; // didn't generate anything DBUG_RETURN(0); @@ -7262,11 +7262,11 @@ bool Vers_parse_info::is_end(const char *name) const } bool Vers_parse_info::is_start(const Create_field &f) const { - return f.flags & VERS_SYS_START_FLAG; + return f.flags() & VERS_SYS_START_FLAG; } bool Vers_parse_info::is_end(const Create_field &f) const { - return f.flags & VERS_SYS_END_FLAG; + return f.flags() & VERS_SYS_END_FLAG; } static Create_field *vers_init_sys_field(THD *thd, const char *field_name, int flags, bool integer) @@ -7278,13 +7278,13 @@ static Create_field *vers_init_sys_field(THD *thd, const char *field_name, int f f->field_name.str= field_name; f->field_name.length= strlen(field_name); f->charset= system_charset_info; - f->flags= flags | NOT_NULL_FLAG; + f->set_flags(flags | NOT_NULL_FLAG); if (integer) { DBUG_ASSERT(0); // Not implemented yet f->set_handler(&type_handler_vers_trx_id); f->length= MY_INT64_NUM_DECIMAL_DIGITS - 1; - f->flags|= UNSIGNED_FLAG; + f->add_flags(UNSIGNED_FLAG); } else { @@ -7370,7 +7370,7 @@ bool Table_scope_and_contents_source_st::vers_fix_system_fields( !(alter_info->flags & ALTER_ADD_SYSTEM_VERSIONING)) || f->versioning == Column_definition::WITHOUT_VERSIONING) { - f->flags|= VERS_UPDATE_UNVERSIONED_FLAG; + f->add_flags(VERS_UPDATE_UNVERSIONED_FLAG); } } // while (Create_field *f= it++) @@ -7460,7 +7460,7 @@ bool Vers_parse_info::fix_alter_info(THD *thd, Alter_info *alter_info, List_iterator_fast<Create_field> it(alter_info->create_list); while (Create_field *f= it++) { - if (f->change.length && f->flags & VERS_SYSTEM_FIELD) + if (f->change.length && f->flags() & VERS_SYSTEM_FIELD) { my_error(ER_VERS_ALTER_SYSTEM_FIELD, MYF(0), f->field_name.str); return true; @@ -7502,7 +7502,7 @@ bool Vers_parse_info::fix_alter_info(THD *thd, Alter_info *alter_info, while (Create_field *f= it++) { if (f->versioning == Column_definition::WITHOUT_VERSIONING) - f->flags|= VERS_UPDATE_UNVERSIONED_FLAG; + f->add_flags(VERS_UPDATE_UNVERSIONED_FLAG); if (f->change.str && (start.streq(f->change) || end.streq(f->change))) { @@ -7545,7 +7545,7 @@ Vers_parse_info::fix_create_like(Alter_info &alter_info, HA_CREATE_INFO &create_ int remove= 2; while (remove && (f= it++)) { - if (f->flags & VERS_SYSTEM_FIELD) + if (f->flags() & VERS_SYSTEM_FIELD) { it.remove(); remove--; @@ -7561,13 +7561,13 @@ Vers_parse_info::fix_create_like(Alter_info &alter_info, HA_CREATE_INFO &create_ while ((f= it++)) { - if (f->flags & VERS_SYS_START_FLAG) + if (f->flags() & VERS_SYS_START_FLAG) { f_start= f; if (f_end) break; } - else if (f->flags & VERS_SYS_END_FLAG) + else if (f->flags() & VERS_SYS_END_FLAG) { f_end= f; if (f_start) @@ -7643,7 +7643,7 @@ static bool is_some_bigint(const Create_field *f) static bool is_versioning_bigint(const Create_field *f) { - return is_some_bigint(f) && f->flags & UNSIGNED_FLAG && + return is_some_bigint(f) && f->is_unsigned() && f->length == MY_INT64_NUM_DECIMAL_DIGITS - 1; } @@ -7674,9 +7674,9 @@ bool Vers_parse_info::check_sys_fields(const Lex_table_name &table_name, List_iterator<Create_field> it(alter_info->create_list); while (Create_field *f= it++) { - if (!row_start && f->flags & VERS_SYS_START_FLAG) + if (!row_start && f->flags() & VERS_SYS_START_FLAG) row_start= f; - else if (!row_end && f->flags & VERS_SYS_END_FLAG) + else if (!row_end && f->flags() & VERS_SYS_END_FLAG) row_end= f; } @@ -7725,7 +7725,7 @@ bool Table_period_info::check_field(const Create_field* f, my_error(ER_WRONG_FIELD_SPEC, MYF(0), f->field_name.str); res= true; } - else if (f->vcol_info || f->flags & VERS_SYSTEM_FIELD) + else if (f->vcol_info || f->flags() & VERS_SYSTEM_FIELD) { my_error(ER_PERIOD_FIELD_WRONG_ATTRIBUTES, MYF(0), f->field_name.str, "GENERATED ALWAYS AS"); @@ -7808,7 +7808,7 @@ Table_scope_and_contents_source_st::fix_period_fields(THD *thd, if (period.start.streq(f->field_name) || period.end.streq(f->field_name)) { f->period= &period_info; - f->flags|= NOT_NULL_FLAG; + f->add_flags(NOT_NULL_FLAG); } } return false; |