summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2019-08-14 10:26:18 +0400
committerAlexander Barkov <bar@mariadb.com>2019-08-14 13:33:01 +0400
commite86010f909fb6b8c4ffd9d6df92991ac079e67e7 (patch)
treee30f0335d75b480ffe1f546c4b0f86b530c4558c /storage
parentfa21952e25e3defef172e1f2074e3e2d5b091f5c (diff)
downloadmariadb-git-e86010f909fb6b8c4ffd9d6df92991ac079e67e7.tar.gz
MDEV-20342 Turn Field::flags from a member to a method
Diffstat (limited to 'storage')
-rw-r--r--storage/archive/ha_archive.cc2
-rw-r--r--storage/connect/ha_connect.cc8
-rw-r--r--storage/connect/tabutil.cpp4
-rw-r--r--storage/csv/ha_tina.cc2
-rw-r--r--storage/heap/ha_heap.cc4
-rw-r--r--storage/innobase/handler/ha_innodb.cc4
-rw-r--r--storage/innobase/handler/handler0alter.cc32
-rw-r--r--storage/maria/ha_maria.cc9
-rw-r--r--storage/mroonga/ha_mroonga.cpp8
-rw-r--r--storage/myisam/ha_myisam.cc11
-rw-r--r--storage/oqgraph/ha_oqgraph.cc10
-rw-r--r--storage/spider/ha_spider.cc2
-rw-r--r--storage/spider/spd_db_mysql.cc2
-rw-r--r--storage/tokudb/ha_tokudb.cc6
-rw-r--r--storage/tokudb/ha_tokudb_alter_56.cc11
-rw-r--r--storage/tokudb/ha_tokudb_update.cc2
-rw-r--r--storage/tokudb/hatoku_cmp.cc12
17 files changed, 61 insertions, 68 deletions
diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc
index 0b352589fe3..401b11dcc35 100644
--- a/storage/archive/ha_archive.cc
+++ b/storage/archive/ha_archive.cc
@@ -772,7 +772,7 @@ int ha_archive::create(const char *name, TABLE *table_arg,
{
Field *field= key_part->field;
- if (!(field->flags & AUTO_INCREMENT_FLAG))
+ if (!(field->flags() & AUTO_INCREMENT_FLAG))
{
error= HA_WRONG_CREATE_OPTION;
DBUG_PRINT("ha_archive", ("Index error in creating archive table"));
diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc
index 9427bf3175b..ba7f0661101 100644
--- a/storage/connect/ha_connect.cc
+++ b/storage/connect/ha_connect.cc
@@ -1613,10 +1613,10 @@ void *ha_connect::GetColumnOption(PGLOBAL g, void *field, PCOLINFO pcf)
break;
} // endswitch type
- if (fp->flags & UNSIGNED_FLAG)
+ if (fp->is_unsigned())
pcf->Flags |= U_UNSIGNED;
- if (fp->flags & ZEROFILL_FLAG)
+ if (fp->is_zerofill())
pcf->Flags |= U_ZEROFILL;
// This is used to skip null bit
@@ -6497,14 +6497,14 @@ int ha_connect::create(const char *name, TABLE *table_arg,
if (fp->vcol_info && !fp->stored_in_db)
continue; // This is a virtual column
- if (fp->flags & AUTO_INCREMENT_FLAG) {
+ if (fp->flags() & AUTO_INCREMENT_FLAG) {
strcpy(g->Message, "Auto_increment is not supported yet");
my_message(ER_UNKNOWN_ERROR, g->Message, MYF(0));
rc= HA_ERR_INTERNAL_ERROR;
DBUG_RETURN(rc);
} // endif flags
- if (fp->flags & (BLOB_FLAG | ENUM_FLAG | SET_FLAG)) {
+ if (fp->flags() & (BLOB_FLAG | ENUM_FLAG | SET_FLAG)) {
sprintf(g->Message, "Unsupported type for column %s",
fp->field_name.str);
my_message(ER_UNKNOWN_ERROR, g->Message, MYF(0));
diff --git a/storage/connect/tabutil.cpp b/storage/connect/tabutil.cpp
index b82e98204dd..3680b7557e5 100644
--- a/storage/connect/tabutil.cpp
+++ b/storage/connect/tabutil.cpp
@@ -212,9 +212,9 @@ PQRYRES TabColumns(PGLOBAL g, THD *thd, const char *db,
crp = crp->Next; // Data_Type
crp->Kdata->SetValue(type, i);
- if (fp->flags & ZEROFILL_FLAG)
+ if (fp->is_zerofill())
crp->Nulls[i] = 'Z';
- else if (fp->flags & UNSIGNED_FLAG)
+ else if (fp->is_unsigned())
crp->Nulls[i] = 'U';
else // X means TEXT field
crp->Nulls[i] = (v == 'X') ? 'V' : v;
diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc
index e67a43a3c1b..ac57bc91b23 100644
--- a/storage/csv/ha_tina.cc
+++ b/storage/csv/ha_tina.cc
@@ -834,7 +834,7 @@ int ha_tina::find_current_row(uchar *buf)
if (!is_enum)
goto err;
}
- if ((*field)->flags & BLOB_FLAG)
+ if ((*field)->flags() & BLOB_FLAG)
{
Field_blob *blob= *(Field_blob**) field;
uchar *src, *tgt;
diff --git a/storage/heap/ha_heap.cc b/storage/heap/ha_heap.cc
index b03c9dfd002..c9865e1f676 100644
--- a/storage/heap/ha_heap.cc
+++ b/storage/heap/ha_heap.cc
@@ -664,7 +664,7 @@ heap_prepare_hp_create_info(TABLE *table_arg, bool internal_table,
seg->length= (uint) key_part->length;
seg->flag= key_part->key_part_flag;
- if (field->flags & (ENUM_FLAG | SET_FLAG))
+ if (field->flags() & (ENUM_FLAG | SET_FLAG))
seg->charset= &my_charset_bin;
else
seg->charset= field->charset_for_protocol();
@@ -678,7 +678,7 @@ heap_prepare_hp_create_info(TABLE *table_arg, bool internal_table,
seg->null_bit= 0;
seg->null_pos= 0;
}
- if (field->flags & AUTO_INCREMENT_FLAG &&
+ if (field->flags() & AUTO_INCREMENT_FLAG &&
table_arg->found_next_number_field &&
key == share->next_number_index)
{
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index f94e4fdbfb0..2ef5c9db8eb 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -6706,7 +6706,7 @@ get_innobase_type_from_mysql_type(
DBUG_ASSERT((ulint)MYSQL_TYPE_FLOAT < 256);
DBUG_ASSERT((ulint)MYSQL_TYPE_DECIMAL < 256);
- if (field->flags & UNSIGNED_FLAG) {
+ if (field->is_unsigned()) {
*unsigned_flag = DATA_UNSIGNED;
} else {
@@ -10788,7 +10788,7 @@ create_table_info_t::create_table_def()
vers_row = DATA_VERS_START;
} else if (i == m_form->s->vers.end_fieldno) {
vers_row = DATA_VERS_END;
- } else if (!(field->flags
+ } else if (!(field->flags()
& VERS_UPDATE_UNVERSIONED_FLAG)) {
vers_row = DATA_VERSIONED;
}
diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
index 19c35c66885..0b69ad72702 100644
--- a/storage/innobase/handler/handler0alter.cc
+++ b/storage/innobase/handler/handler0alter.cc
@@ -1431,7 +1431,7 @@ check_v_col_in_order(
continue;
}
- if (field->flags & FIELD_IS_DROPPED) {
+ if (field->flags() & FIELD_IS_DROPPED) {
continue;
}
@@ -1857,7 +1857,7 @@ innobase_fts_check_doc_id_col(
} else if (field->type() != MYSQL_TYPE_LONGLONG
|| field->pack_length() != 8
|| field->real_maybe_null()
- || !(field->flags & UNSIGNED_FLAG)
+ || !field->is_unsigned()
|| !field->stored_in_db()) {
err = ER_INNODB_FT_WRONG_DOCID_COLUMN;
} else {
@@ -2176,10 +2176,10 @@ ha_innobase::check_if_supported_inplace_alter(
DBUG_ASSERT((MTYP_TYPENR(key_part->field->unireg_check)
== Field::NEXT_NUMBER)
- == !!(key_part->field->flags
+ == !!(key_part->field->flags()
& AUTO_INCREMENT_FLAG));
- if (key_part->field->flags & AUTO_INCREMENT_FLAG) {
+ if (key_part->field->flags() & AUTO_INCREMENT_FLAG) {
/* We cannot assign AUTO_INCREMENT values
during online or instant ALTER. */
DBUG_ASSERT(key_part->field == altered_table
@@ -2244,7 +2244,7 @@ ha_innobase::check_if_supported_inplace_alter(
renaming the FTS_DOC_ID. */
for (Field** fp = table->field; *fp; fp++) {
- if (!((*fp)->flags
+ if (!((*fp)->flags()
& (FIELD_IS_RENAMED | FIELD_IS_DROPPED))) {
continue;
}
@@ -4232,7 +4232,7 @@ innobase_check_foreigns(
const Create_field* new_field;
ut_ad(!(*fp)->real_maybe_null()
- == !!((*fp)->flags & NOT_NULL_FLAG));
+ == !!((*fp)->flags() & NOT_NULL_FLAG));
while ((new_field = cf_it++)) {
if (new_field->field == *fp) {
@@ -4240,7 +4240,7 @@ innobase_check_foreigns(
}
}
- if (!new_field || (new_field->flags & NOT_NULL_FLAG)) {
+ if (!new_field || (new_field->flags() & NOT_NULL_FLAG)) {
if (innobase_check_foreigns_low(
user_table, drop_fk, n_drop_fk,
(*fp)->field_name.str, !new_field)) {
@@ -4991,7 +4991,7 @@ prepare_inplace_drop_virtual(
ctx->num_to_drop_vcol = 0;
for (i = 0; table->field[i]; i++) {
const Field* field = table->field[i];
- if (field->flags & FIELD_IS_DROPPED && !field->stored_in_db()) {
+ if (field->flags() & FIELD_IS_DROPPED && !field->stored_in_db()) {
ctx->num_to_drop_vcol++;
}
}
@@ -5005,7 +5005,7 @@ prepare_inplace_drop_virtual(
for (i = 0; table->field[i]; i++) {
Field *field = table->field[i];
- if (!(field->flags & FIELD_IS_DROPPED) || field->stored_in_db()) {
+ if (!(field->flags() & FIELD_IS_DROPPED) || field->stored_in_db()) {
continue;
}
@@ -6378,7 +6378,7 @@ new_clustered_failed:
} else if (i ==
altered_table->s->vers.end_fieldno) {
field_type |= DATA_VERS_END;
- } else if (!(field->flags
+ } else if (!(field->flags()
& VERS_UPDATE_UNVERSIONED_FLAG)) {
field_type |= DATA_VERSIONED;
}
@@ -7575,7 +7575,7 @@ err_exit_no_heap:
ha_alter_info->alter_info->create_list);
for (Field** fp = table->field; *fp; fp++) {
- if (!((*fp)->flags & FIELD_IS_RENAMED)) {
+ if (!((*fp)->flags() & FIELD_IS_RENAMED)) {
continue;
}
@@ -8115,9 +8115,9 @@ err_exit:
DBUG_ASSERT((MTYP_TYPENR(field->unireg_check)
== Field::NEXT_NUMBER)
- == !!(field->flags & AUTO_INCREMENT_FLAG));
+ == !!(field->flags() & AUTO_INCREMENT_FLAG));
- if (field->flags & AUTO_INCREMENT_FLAG) {
+ if (field->flags() & AUTO_INCREMENT_FLAG) {
if (add_autoinc_col_no != ULINT_UNDEFINED) {
/* This should have been blocked earlier. */
ut_ad(0);
@@ -9011,7 +9011,7 @@ innobase_rename_columns_try(
for (Field** fp = table->field; *fp; fp++, i++) {
const bool is_virtual = !(*fp)->stored_in_db();
- if (!((*fp)->flags & FIELD_IS_RENAMED)) {
+ if (!((*fp)->flags() & FIELD_IS_RENAMED)) {
goto processed_field;
}
@@ -9061,7 +9061,7 @@ static void get_type(const Field& f, ulint& prtype, ulint& mtype, ulint& len)
prtype |= DATA_VERS_START;
} else if (&f == f.table->field[f.table->s->vers.end_fieldno]) {
prtype |= DATA_VERS_END;
- } else if (!(f.flags & VERS_UPDATE_UNVERSIONED_FLAG)) {
+ } else if (!(f.flags() & VERS_UPDATE_UNVERSIONED_FLAG)) {
prtype |= DATA_VERSIONED;
}
}
@@ -9282,7 +9282,7 @@ innobase_rename_or_enlarge_columns_cache(
col->mbmaxlen = is_string
? (*af)->charset()->mbmaxlen : 0;
- if ((*fp)->flags & FIELD_IS_RENAMED) {
+ if ((*fp)->flags() & FIELD_IS_RENAMED) {
dict_mem_table_col_rename(
user_table, col_n,
cf->field->field_name.str,
diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc
index d07d30330a0..22366c62178 100644
--- a/storage/maria/ha_maria.cc
+++ b/storage/maria/ha_maria.cc
@@ -573,7 +573,7 @@ static int table2maria(TABLE *table_arg, data_file_type row_type,
/* No blobs here */
if (j == 0)
keydef[i].flag|= HA_PACK_KEY;
- if (!(field->flags & ZEROFILL_FLAG) &&
+ if (!(field->is_zerofill()) &&
(field->type() == MYSQL_TYPE_STRING ||
field->type() == MYSQL_TYPE_VAR_STRING ||
((int) (pos->key_part[j].length - field->decimals())) >= 4))
@@ -653,20 +653,19 @@ static int table2maria(TABLE *table_arg, data_file_type row_type,
if (!found)
break;
- if (found->flags & BLOB_FLAG)
+ if (found->flags() & BLOB_FLAG)
recinfo_pos->type= FIELD_BLOB;
else if (found->type() == MYSQL_TYPE_TIMESTAMP)
recinfo_pos->type= FIELD_NORMAL;
else if (found->type() == MYSQL_TYPE_VARCHAR)
recinfo_pos->type= FIELD_VARCHAR;
else if (!(options & HA_OPTION_PACK_RECORD) ||
- (found->zero_pack() && (found->flags & PRI_KEY_FLAG)))
+ (found->zero_pack() && (found->flags() & PRI_KEY_FLAG)))
recinfo_pos->type= FIELD_NORMAL;
else if (found->zero_pack())
recinfo_pos->type= FIELD_SKIP_ZERO;
else
- recinfo_pos->type= ((length <= 3 ||
- (found->flags & ZEROFILL_FLAG)) ?
+ recinfo_pos->type= ((length <= 3 || found->is_zerofill()) ?
FIELD_NORMAL :
found->type() == MYSQL_TYPE_STRING ||
found->type() == MYSQL_TYPE_VAR_STRING ?
diff --git a/storage/mroonga/ha_mroonga.cpp b/storage/mroonga/ha_mroonga.cpp
index 085ccf55b09..1ffdeb0e36f 100644
--- a/storage/mroonga/ha_mroonga.cpp
+++ b/storage/mroonga/ha_mroonga.cpp
@@ -4497,7 +4497,7 @@ void ha_mroonga::wrapper_overwrite_index_bits()
{
Field *field = key_part->field;
if (field->key_length() == key_part->length &&
- !(field->flags & BLOB_FLAG))
+ !(field->flags() & BLOB_FLAG))
{
if (index_flags(i, j, 0) & HA_KEYREAD_ONLY)
{
@@ -4514,7 +4514,7 @@ void ha_mroonga::wrapper_overwrite_index_bits()
(table_option & HA_PRIMARY_KEY_IN_READ_INDEX))
{
if (field->key_length() == key_part->length &&
- !(field->flags & BLOB_FLAG))
+ !(field->flags() & BLOB_FLAG))
field->part_of_key = table_share->keys_in_use;
if (field->part_of_sortkey.is_set(i))
field->part_of_sortkey = table_share->keys_in_use;
@@ -14367,7 +14367,7 @@ bool ha_mroonga::storage_check_if_incompatible_data(
uint n = table_share->fields;
for (uint i = 0; i < n; i++) {
Field *field = table->field[i];
- if (field->flags & FIELD_IS_RENAMED) {
+ if (field->flags() & FIELD_IS_RENAMED) {
DBUG_RETURN(COMPATIBLE_DATA_NO);
}
}
@@ -15326,7 +15326,7 @@ bool ha_mroonga::storage_inplace_alter_table_rename_column(
for (uint i = 0; i < n_fields; i++) {
Field *field = table->field[i];
- if (!(field->flags & FIELD_IS_RENAMED)) {
+ if (!(field->flags() & FIELD_IS_RENAMED)) {
continue;
}
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index bc3fbf2dbd5..451b7f16c65 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -291,7 +291,7 @@ int table2myisam(TABLE *table_arg, MI_KEYDEF **keydef_out,
/* No blobs here */
if (j == 0)
keydef[i].flag|= HA_PACK_KEY;
- if (!(field->flags & ZEROFILL_FLAG) &&
+ if (!field->is_zerofill() &&
(field->type() == MYSQL_TYPE_STRING ||
field->type() == MYSQL_TYPE_VAR_STRING ||
((int) (pos->key_part[j].length - field->decimals())) >= 4))
@@ -376,7 +376,7 @@ int table2myisam(TABLE *table_arg, MI_KEYDEF **keydef_out,
if (!found)
break;
- if (found->flags & BLOB_FLAG)
+ if (found->flags() & BLOB_FLAG)
recinfo_pos->type= FIELD_BLOB;
else if (found->real_type() == MYSQL_TYPE_TIMESTAMP)
{
@@ -398,8 +398,7 @@ int table2myisam(TABLE *table_arg, MI_KEYDEF **keydef_out,
else if (found->zero_pack())
recinfo_pos->type= FIELD_SKIP_ZERO;
else
- recinfo_pos->type= ((length <= 3 ||
- (found->flags & ZEROFILL_FLAG)) ?
+ recinfo_pos->type= ((length <= 3 || found->is_zerofill()) ?
FIELD_NORMAL :
found->type() == MYSQL_TYPE_STRING ||
found->type() == MYSQL_TYPE_VAR_STRING ?
@@ -964,7 +963,7 @@ void ha_myisam::setup_vcols_for_repair(HA_CHECK *param)
{
uint vf_end= (*vf)->offset(table->record[0]) + (*vf)->pack_length_in_rec();
set_if_bigger(new_vreclength, vf_end);
- indexed_vcols|= ((*vf)->flags & PART_KEY_FLAG) != 0;
+ indexed_vcols|= ((*vf)->flags() & PART_KEY_FLAG) != 0;
}
}
if (!indexed_vcols)
@@ -2180,7 +2179,7 @@ int ha_myisam::create(const char *name, TABLE *table_arg,
DBUG_ENTER("ha_myisam::create");
for (i= 0; i < share->virtual_fields && !create_flags; i++)
- if (table_arg->vfield[i]->flags & PART_KEY_FLAG)
+ if (table_arg->vfield[i]->flags() & PART_KEY_FLAG)
create_flags|= HA_CREATE_RELIES_ON_SQL_LAYER;
for (i= 0; i < share->keys && !create_flags; i++)
if (table_arg->key_info[i].flags & HA_USES_PARSER)
diff --git a/storage/oqgraph/ha_oqgraph.cc b/storage/oqgraph/ha_oqgraph.cc
index 20ebd49bd5d..f2a91b51663 100644
--- a/storage/oqgraph/ha_oqgraph.cc
+++ b/storage/oqgraph/ha_oqgraph.cc
@@ -335,13 +335,13 @@ int ha_oqgraph::oqgraph_check_table_structure (TABLE *table_arg)
if (!badColumn) if (skel[i].coltype != MYSQL_TYPE_DOUBLE && (!isLatchColumn || !isStringLatch)) {
/* Check Is UNSIGNED */
- if ( (!((*field)->flags & UNSIGNED_FLAG ))) {
+ if (!(*field)->is_unsigned()) {
badColumn = true;
push_warning_printf( current_thd, Sql_condition::WARN_LEVEL_WARN, HA_WRONG_CREATE_OPTION, "Column %d must be UNSIGNED.", i);
}
}
/* Check THAT NOT NULL isn't set */
- if (!badColumn) if ((*field)->flags & NOT_NULL_FLAG) {
+ if (!badColumn) if ((*field)->flags() & NOT_NULL_FLAG) {
badColumn = true;
push_warning_printf( current_thd, Sql_condition::WARN_LEVEL_WARN, HA_WRONG_CREATE_OPTION, "Column %d must be NULL.", i);
}
@@ -658,7 +658,7 @@ int ha_oqgraph::open(const char *name, int mode, uint test_if_locked)
if (strcmp(options->origid, (*field)->field_name.str))
continue;
if ((*field)->cmp_type() != INT_RESULT ||
- !((*field)->flags & NOT_NULL_FLAG))
+ !((*field)->flags() & NOT_NULL_FLAG))
{
fprint_error("Column '%s.%s' (origid) is not a not-null integer type",
options->table_name, options->origid);
@@ -683,7 +683,7 @@ int ha_oqgraph::open(const char *name, int mode, uint test_if_locked)
if (strcmp(options->destid, (*field)->field_name.str))
continue;
if ((*field)->type() != origid->type() ||
- !((*field)->flags & NOT_NULL_FLAG))
+ !((*field)->flags() & NOT_NULL_FLAG))
{
fprint_error("Column '%s.%s' (destid) is not a not-null integer type or is a different type to origid attribute.",
options->table_name, options->destid);
@@ -715,7 +715,7 @@ int ha_oqgraph::open(const char *name, int mode, uint test_if_locked)
if (strcmp(options->weight, (*field)->field_name.str))
continue;
if ((*field)->result_type() != REAL_RESULT ||
- !((*field)->flags & NOT_NULL_FLAG))
+ !((*field)->flags() & NOT_NULL_FLAG))
{
fprint_error("Column '%s.%s' (weight) is not a not-null real type",
options->table_name, options->weight);
diff --git a/storage/spider/ha_spider.cc b/storage/spider/ha_spider.cc
index 5920f802c9e..888a9d79c0f 100644
--- a/storage/spider/ha_spider.cc
+++ b/storage/spider/ha_spider.cc
@@ -10356,7 +10356,7 @@ int ha_spider::direct_update_rows_init()
field = ((Item_field *)item)->field;
if (field->type() == FIELD_TYPE_TIMESTAMP &&
- field->flags & UNIQUE_KEY_FLAG)
+ field->flags() & UNIQUE_KEY_FLAG)
{
/*
Spider cannot perform direct update on unique timestamp fields.
diff --git a/storage/spider/spd_db_mysql.cc b/storage/spider/spd_db_mysql.cc
index 6b551804c87..a736883cd70 100644
--- a/storage/spider/spd_db_mysql.cc
+++ b/storage/spider/spd_db_mysql.cc
@@ -401,7 +401,7 @@ int spider_db_mbase_row::store_to_field(
field->reset();
} else {
field->set_notnull();
- if (field->flags & BLOB_FLAG)
+ if (field->flags() & BLOB_FLAG)
{
DBUG_PRINT("info", ("spider blob field"));
if (
diff --git a/storage/tokudb/ha_tokudb.cc b/storage/tokudb/ha_tokudb.cc
index c19a75d680d..877fec0bd2f 100644
--- a/storage/tokudb/ha_tokudb.cc
+++ b/storage/tokudb/ha_tokudb.cc
@@ -1269,7 +1269,7 @@ bool ha_tokudb::has_auto_increment_flag(uint* index) {
uint ai_index = 0;
for (uint i = 0; i < table_share->fields; i++, ai_index++) {
Field* field = table->field[i];
- if (field->flags & AUTO_INCREMENT_FLAG) {
+ if (field->flags() & AUTO_INCREMENT_FLAG) {
ai_found = true;
*index = ai_index;
break;
@@ -6933,7 +6933,7 @@ void ha_tokudb::trace_create_table_info(TABLE* form) {
i,
field->field_name.str,
field->type(),
- field->flags);
+ field->flags());
}
for (i = 0; i < form->s->keys; i++) {
KEY *key = &form->key_info[i];
@@ -6953,7 +6953,7 @@ void ha_tokudb::trace_create_table_info(TABLE* form) {
key_part->length,
field->field_name.str,
field->type(),
- field->flags);
+ field->flags());
}
}
}
diff --git a/storage/tokudb/ha_tokudb_alter_56.cc b/storage/tokudb/ha_tokudb_alter_56.cc
index 4bdf2cf7bda..899a85aff5f 100644
--- a/storage/tokudb/ha_tokudb_alter_56.cc
+++ b/storage/tokudb/ha_tokudb_alter_56.cc
@@ -1257,11 +1257,6 @@ int ha_tokudb::alter_table_expand_columns(
return error;
}
-// Return true if the field is an unsigned int
-static bool is_unsigned(Field *f) {
- return (f->flags & UNSIGNED_FLAG) != 0;
-}
-
// Return the starting offset in the value for a particular index (selected by
// idx) of a particular field (selected by expand_field_num)
// TODO: replace this?
@@ -1300,8 +1295,8 @@ int ha_tokudb::alter_table_expand_one_column(
uchar pad_char;
switch (old_field_type) {
case toku_type_int:
- assert_always(is_unsigned(old_field) == is_unsigned(new_field));
- if (is_unsigned(old_field))
+ assert_always(old_field->is_unsigned() == new_field->is_unsigned());
+ if (old_field->is_unsigned())
operation = UPDATE_OP_EXPAND_UINT;
else
operation = UPDATE_OP_EXPAND_INT;
@@ -1550,7 +1545,7 @@ static bool change_field_type_is_supported(Field* old_field,
if (is_int_type(old_type)) {
// int and unsigned int expansion
if (is_int_type(new_type) &&
- is_unsigned(old_field) == is_unsigned(new_field))
+ old_field->is_unsigned() == new_field->is_unsigned())
return change_fixed_length_is_supported(old_field, new_field, ctx);
else
return false;
diff --git a/storage/tokudb/ha_tokudb_update.cc b/storage/tokudb/ha_tokudb_update.cc
index fec0a42e063..5e6697c0093 100644
--- a/storage/tokudb/ha_tokudb_update.cc
+++ b/storage/tokudb/ha_tokudb_update.cc
@@ -364,7 +364,7 @@ static bool check_decr_floor_expression(Field* lhs_field, Item* item) {
return false;
if (!check_x_minus_1(lhs_field->field_name.str, arguments[2]))
return false;
- if (!(lhs_field->flags & UNSIGNED_FLAG))
+ if (!lhs_field->is_unsigned())
return false;
return true;
}
diff --git a/storage/tokudb/hatoku_cmp.cc b/storage/tokudb/hatoku_cmp.cc
index d4bfa4e5b27..46d88adb9df 100644
--- a/storage/tokudb/hatoku_cmp.cc
+++ b/storage/tokudb/hatoku_cmp.cc
@@ -1045,7 +1045,7 @@ static int create_toku_key_descriptor_for_key(KEY* key, uchar* buf) {
assert_always (num_bytes_in_field < 256);
*pos = (uchar)(num_bytes_in_field & 255);
pos++;
- *pos = (field->flags & UNSIGNED_FLAG) ? 1 : 0;
+ *pos = field->is_unsigned() ? 1 : 0;
pos++;
break;
//
@@ -3057,8 +3057,8 @@ static bool fields_are_same_type(Field* a, Field* b) {
case MYSQL_TYPE_LONGLONG:
// length, unsigned, auto increment
if (a->pack_length() != b->pack_length() ||
- (a->flags & UNSIGNED_FLAG) != (b->flags & UNSIGNED_FLAG) ||
- (a->flags & AUTO_INCREMENT_FLAG) != (b->flags & AUTO_INCREMENT_FLAG)) {
+ a->is_unsigned() != b->is_unsigned() ||
+ (a->flags() & AUTO_INCREMENT_FLAG) != (b->flags() & AUTO_INCREMENT_FLAG)) {
retval = false;
goto cleanup;
}
@@ -3067,8 +3067,8 @@ static bool fields_are_same_type(Field* a, Field* b) {
case MYSQL_TYPE_FLOAT:
// length, unsigned, auto increment
if (a->pack_length() != b->pack_length() ||
- (a->flags & UNSIGNED_FLAG) != (b->flags & UNSIGNED_FLAG) ||
- (a->flags & AUTO_INCREMENT_FLAG) != (b->flags & AUTO_INCREMENT_FLAG)) {
+ a->is_unsigned() != b->is_unsigned() ||
+ (a->flags() & AUTO_INCREMENT_FLAG) != (b->flags() & AUTO_INCREMENT_FLAG)) {
retval = false;
goto cleanup;
}
@@ -3076,7 +3076,7 @@ static bool fields_are_same_type(Field* a, Field* b) {
case MYSQL_TYPE_NEWDECIMAL:
// length, unsigned
if (a->pack_length() != b->pack_length() ||
- (a->flags & UNSIGNED_FLAG) != (b->flags & UNSIGNED_FLAG)) {
+ a->is_unsigned() != b->is_unsigned()) {
retval = false;
goto cleanup;
}