Skip to content

Commit

Permalink
Replace dict_col_is_virtual(col) with col->is_virtual()
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed May 12, 2018
1 parent ba43914 commit c57e983
Show file tree
Hide file tree
Showing 14 changed files with 36 additions and 38 deletions.
2 changes: 1 addition & 1 deletion storage/innobase/dict/dict0crea.cc
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ dict_create_sys_columns_tuple(
v_col_no = column->ind;
} else {
column = dict_table_get_nth_col(table, i);
ut_ad(!dict_col_is_virtual(column));
ut_ad(!column->is_virtual());
}

sys_columns = dict_sys->sys_columns;
Expand Down
10 changes: 5 additions & 5 deletions storage/innobase/dict/dict0dict.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2592,7 +2592,7 @@ dict_index_remove_from_cache_low(

for (ulint i = 0; i < dict_index_get_n_fields(index); i++) {
col = dict_index_get_nth_col(index, i);
if (dict_col_is_virtual(col)) {
if (col->is_virtual()) {
vcol = reinterpret_cast<const dict_v_col_t*>(
col);

Expand Down Expand Up @@ -2745,7 +2745,7 @@ dict_index_add_col(
dict_field_t* field;
const char* col_name;

if (dict_col_is_virtual(col)) {
if (col->is_virtual()) {
dict_v_col_t* v_col = reinterpret_cast<dict_v_col_t*>(col);

/* When v_col->v_indexes==NULL,
Expand Down Expand Up @@ -3136,7 +3136,7 @@ dict_index_build_internal_non_clust(

field = dict_index_get_nth_field(new_index, i);

if (dict_col_is_virtual(field->col)) {
if (field->col->is_virtual()) {
continue;
}

Expand Down Expand Up @@ -4323,7 +4323,7 @@ dict_foreign_push_index_error(
const char* col_name;
field = dict_index_get_nth_field(err_index, err_col);

col_name = dict_col_is_virtual(field->col)
col_name = field->col->is_virtual()
? "(null)"
: dict_table_get_col_name(
table, dict_col_get_no(field->col));
Expand Down Expand Up @@ -6888,7 +6888,7 @@ dict_foreign_qualify_index(
return(false);
}

if (dict_col_is_virtual(field->col)) {
if (field->col->is_virtual()) {
for (ulint j = 0; j < table->n_v_def; j++) {
col_name = dict_table_get_v_col_name(table, j);
if (innobase_strcasecmp(field->name,col_name) == 0) {
Expand Down
2 changes: 1 addition & 1 deletion storage/innobase/dict/dict0mem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ dict_mem_table_col_rename_low(
/* if is_virtual and that in field->col does
not match, continue */
if ((!is_virtual) !=
(!dict_col_is_virtual(field->col))) {
(!field->col->is_virtual())) {
continue;
}

Expand Down
2 changes: 1 addition & 1 deletion storage/innobase/handler/ha_innodb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5650,7 +5650,7 @@ innobase_vcol_build_templ(
mysql_row_templ_t* templ,
ulint col_no)
{
if (dict_col_is_virtual(col)) {
if (col->is_virtual()) {
templ->is_virtual = true;
templ->col_no = col_no;
templ->clust_rec_field_no = ULINT_UNDEFINED;
Expand Down
8 changes: 4 additions & 4 deletions storage/innobase/handler/handler0alter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2714,7 +2714,7 @@ innobase_fts_check_doc_id_index(
&& field->col->mtype == DATA_INT
&& field->col->len == 8
&& field->col->prtype & DATA_NOT_NULL
&& !dict_col_is_virtual(field->col)) {
&& !field->col->is_virtual()) {
if (fts_doc_col_no) {
*fts_doc_col_no = dict_col_get_no(field->col);
}
Expand Down Expand Up @@ -7350,15 +7350,15 @@ check_col_exists_in_indexes(
const dict_col_t* idx_col
= dict_index_get_nth_col(index, i);

if (is_v && dict_col_is_virtual(idx_col)) {
if (is_v && idx_col->is_virtual()) {
const dict_v_col_t* v_col = reinterpret_cast<
const dict_v_col_t*>(idx_col);
if (v_col->v_pos == col_no) {
return(true);
}
}

if (!is_v && !dict_col_is_virtual(idx_col)
if (!is_v && !idx_col->is_virtual()
&& dict_col_get_no(idx_col) == col_no) {
return(true);
}
Expand Down Expand Up @@ -8641,7 +8641,7 @@ get_col_list_to_be_dropped(
const dict_col_t* idx_col
= dict_index_get_nth_col(index, col);

if (dict_col_is_virtual(idx_col)) {
if (idx_col->is_virtual()) {
const dict_v_col_t* v_col
= reinterpret_cast<
const dict_v_col_t*>(idx_col);
Expand Down
2 changes: 1 addition & 1 deletion storage/innobase/handler/i_s.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6866,7 +6866,7 @@ i_s_dict_fill_sys_columns(

OK(field_store_string(fields[SYS_COLUMN_NAME], col_name));

if (dict_col_is_virtual(column)) {
if (column->is_virtual()) {
ulint pos = dict_create_v_col_pos(nth_v_col, column->ind);
OK(fields[SYS_COLUMN_POSITION]->store(pos, true));
} else {
Expand Down
1 change: 0 additions & 1 deletion storage/innobase/include/dict0dict.h
Original file line number Diff line number Diff line change
Expand Up @@ -1882,7 +1882,6 @@ dict_index_node_ptr_max_size(
/*=========================*/
const dict_index_t* index) /*!< in: index */
MY_ATTRIBUTE((warn_unused_result));
#define dict_col_is_virtual(col) (col)->is_virtual()

/** encode number of columns and number of virtual columns in one
4 bytes value. We could do this because the number of columns in
Expand Down
15 changes: 7 additions & 8 deletions storage/innobase/row/row0ins.cc
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ row_ins_cascade_calc_update_vec(
&& dict_table_is_fts_column(
table->fts->indexes,
dict_col_get_no(col),
dict_col_is_virtual(col))
col->is_virtual())
!= ULINT_UNDEFINED) {
affects_fulltext = true;
}
Expand Down Expand Up @@ -1300,9 +1300,9 @@ row_ins_foreign_check_on_constraint(
if (!affects_fulltext
&& table->fts && dict_table_is_fts_column(
table->fts->indexes,
dict_index_get_nth_col_no(index, i),
dict_col_is_virtual(
dict_index_get_nth_col(index, i)))
dict_index_get_nth_col(index, i)->ind,
dict_index_get_nth_col(index, i)
->is_virtual())
!= ULINT_UNDEFINED) {
affects_fulltext = true;
}
Expand All @@ -1329,9 +1329,8 @@ row_ins_foreign_check_on_constraint(
for (ulint i = 0; i < foreign->n_fields; i++) {
if (dict_table_is_fts_column(
table->fts->indexes,
dict_index_get_nth_col_no(index, i),
dict_col_is_virtual(
dict_index_get_nth_col(index, i)))
dict_index_get_nth_col(index, i)->ind,
dict_index_get_nth_col(index, i)->is_virtual())
!= ULINT_UNDEFINED) {
affects_fulltext = true;
break;
Expand Down Expand Up @@ -3446,7 +3445,7 @@ row_ins_index_entry_set_vals(
col = ind_field->col;
}

if (dict_col_is_virtual(col)) {
if (col->is_virtual()) {
const dict_v_col_t* v_col
= reinterpret_cast<const dict_v_col_t*>(col);
ut_ad(dtuple_get_n_fields(row)
Expand Down
8 changes: 4 additions & 4 deletions storage/innobase/row/row0merge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ row_merge_buf_add(

col = ifield->col;
const dict_v_col_t* v_col = NULL;
if (dict_col_is_virtual(col)) {
if (col->is_virtual()) {
v_col = reinterpret_cast<const dict_v_col_t*>(col);
}

Expand All @@ -581,7 +581,7 @@ row_merge_buf_add(
/* Process the Doc ID column */
if (*doc_id > 0
&& col_no == index->table->fts->doc_col
&& !dict_col_is_virtual(col)) {
&& !col->is_virtual()) {
fts_write_doc_id((byte*) &write_doc_id, *doc_id);

/* Note: field->data now points to a value on the
Expand All @@ -600,7 +600,7 @@ row_merge_buf_add(
field->type.len = ifield->col->len;
} else {
/* Use callback to get the virtual column value */
if (dict_col_is_virtual(col)) {
if (col->is_virtual()) {
dict_index_t* clust_index
= dict_table_get_first_index(new_table);

Expand Down Expand Up @@ -732,7 +732,7 @@ row_merge_buf_add(
len = dfield_get_len(field);
}
}
} else if (!dict_col_is_virtual(col)) {
} else if (!col->is_virtual()) {
/* Only non-virtual column are stored externally */
const byte* buf = row_ext_lookup(ext, col_no,
&len);
Expand Down
2 changes: 1 addition & 1 deletion storage/innobase/row/row0row.cc
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ row_build_index_entry_low(

compile_time_assert(DATA_MISSING == 0);

if (dict_col_is_virtual(col)) {
if (col->is_virtual()) {
const dict_v_col_t* v_col
= reinterpret_cast<const dict_v_col_t*>(col);

Expand Down
4 changes: 2 additions & 2 deletions storage/innobase/row/row0sel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ row_sel_sec_rec_is_for_clust_rec(
ifield = dict_index_get_nth_field(sec_index, i);
col = dict_field_get_col(ifield);

is_virtual = dict_col_is_virtual(col);
is_virtual = col->is_virtual();

/* For virtual column, its value will need to be
reconstructed from base column in cluster index */
Expand Down Expand Up @@ -4011,7 +4011,7 @@ row_sel_fill_vrow(
field = dict_index_get_nth_field(index, i);
col = dict_field_get_col(field);

if (dict_col_is_virtual(col)) {
if (col->is_virtual()) {
const byte* data;
ulint len;

Expand Down
6 changes: 3 additions & 3 deletions storage/innobase/row/row0upd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1361,7 +1361,7 @@ row_upd_index_replace_new_col_vals_index_pos(

field = dict_index_get_nth_field(index, i);
col = dict_field_get_col(field);
if (dict_col_is_virtual(col)) {
if (col->is_virtual()) {
const dict_v_col_t* vcol = reinterpret_cast<
const dict_v_col_t*>(
col);
Expand Down Expand Up @@ -1415,7 +1415,7 @@ row_upd_index_replace_new_col_vals(

field = dict_index_get_nth_field(index, i);
col = dict_field_get_col(field);
if (dict_col_is_virtual(col)) {
if (col->is_virtual()) {
const dict_v_col_t* vcol = reinterpret_cast<
const dict_v_col_t*>(
col);
Expand Down Expand Up @@ -1720,7 +1720,7 @@ row_upd_changes_ord_field_binary_func(
ind_field = dict_index_get_nth_field(index, i);
col = dict_field_get_col(ind_field);
col_no = dict_col_get_no(col);
is_virtual = dict_col_is_virtual(col);
is_virtual = col->is_virtual();

if (is_virtual) {
vcol = reinterpret_cast<const dict_v_col_t*>(col);
Expand Down
10 changes: 5 additions & 5 deletions storage/innobase/row/row0vers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ row_vers_non_virtual_fields_equal(

for (const dict_field_t* ifield = index->fields; ifield != end;
ifield++) {
if (!dict_col_is_virtual(ifield->col)
if (!ifield->col->is_virtual()
&& cmp_dfield_dfield(a++, b++)) {
return false;
}
Expand Down Expand Up @@ -438,7 +438,7 @@ row_vers_build_clust_v_col(
const dict_field_t* ind_field = dict_index_get_nth_field(
index, i);

if (dict_col_is_virtual(ind_field->col)) {
if (ind_field->col->is_virtual()) {
const dict_v_col_t* col;

col = reinterpret_cast<const dict_v_col_t*>(
Expand Down Expand Up @@ -537,7 +537,7 @@ row_vers_build_cur_vrow_low(
= dict_index_get_nth_field(index, i);
const dict_col_t* col = ind_field->col;

if (!dict_col_is_virtual(col)) {
if (!col->is_virtual()) {
continue;
}

Expand Down Expand Up @@ -621,7 +621,7 @@ row_vers_vc_matches_cluster(
for (const dict_field_t *ifield = index->fields,
*const end = &index->fields[index->n_fields];
ifield != end; ifield++, a++, b++) {
if (!dict_col_is_virtual(ifield->col)) {
if (!ifield->col->is_virtual()) {
if (cmp_dfield_dfield(a, b)) {
return false;
}
Expand Down Expand Up @@ -685,7 +685,7 @@ row_vers_vc_matches_cluster(
const dict_col_t* col = ind_field->col;
field1 = dtuple_get_nth_field(ientry, i);

if (!dict_col_is_virtual(col)) {
if (!col->is_virtual()) {
continue;
}

Expand Down
2 changes: 1 addition & 1 deletion storage/innobase/trx/trx0rec.cc
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ trx_undo_read_v_idx_low(
if (index->id == id) {
const dict_col_t* col = dict_index_get_nth_col(
index, pos);
ut_ad(dict_col_is_virtual(col));
ut_ad(col->is_virtual());
const dict_v_col_t* vcol = reinterpret_cast<
const dict_v_col_t*>(col);
*col_pos = vcol->v_pos;
Expand Down

0 comments on commit c57e983

Please sign in to comment.