File tree Expand file tree Collapse file tree 6 files changed +13
-23
lines changed Expand file tree Collapse file tree 6 files changed +13
-23
lines changed Original file line number Diff line number Diff line change @@ -3044,9 +3044,7 @@ dict_index_build_internal_clust(
3044
3044
3045
3045
/* Add to new_index non-system columns of table not yet included
3046
3046
there */
3047
- ulint n_sys_cols = dict_table_get_n_sys_cols (table);
3048
- for (i = 0 ; i + n_sys_cols < (ulint) table->n_cols ; i++) {
3049
-
3047
+ for (i = 0 ; i + DATA_N_SYS_COLS < ulint (table->n_cols ); i++) {
3050
3048
dict_col_t * col = dict_table_get_nth_col (table, i);
3051
3049
ut_ad (col->mtype != DATA_SYS);
3052
3050
@@ -6422,15 +6420,14 @@ dict_table_schema_check(
6422
6420
return (DB_TABLE_NOT_FOUND);
6423
6421
}
6424
6422
6425
- ulint n_sys_cols = dict_table_get_n_sys_cols (table);
6426
- if ((ulint) table->n_def - n_sys_cols != req_schema->n_cols ) {
6423
+ if (ulint (table->n_def ) - DATA_N_SYS_COLS != req_schema->n_cols ) {
6427
6424
/* the table has a different number of columns than required */
6428
6425
snprintf (errstr, errstr_sz,
6429
6426
" %s has " ULINTPF " columns but should have "
6430
6427
ULINTPF " ." ,
6431
6428
ut_format_name (req_schema->table_name , buf,
6432
6429
sizeof buf),
6433
- table->n_def - n_sys_cols ,
6430
+ ulint ( table->n_def ) - DATA_N_SYS_COLS ,
6434
6431
req_schema->n_cols );
6435
6432
6436
6433
return (DB_ERROR);
Original file line number Diff line number Diff line change @@ -136,8 +136,7 @@ dict_mem_table_create(
136
136
table->name .m_name = mem_strdup (name);
137
137
table->is_system_db = dict_mem_table_is_system (table->name .m_name );
138
138
table->space = (unsigned int ) space;
139
- table->n_t_cols = (unsigned int ) (n_cols +
140
- dict_table_get_n_sys_cols (table));
139
+ table->n_t_cols = unsigned (n_cols + DATA_N_SYS_COLS);
141
140
table->n_v_cols = (unsigned int ) (n_v_cols);
142
141
table->n_cols = table->n_t_cols - table->n_v_cols ;
143
142
Original file line number Diff line number Diff line change @@ -3939,7 +3939,7 @@ innobase_add_virtual_try(
3939
3939
3940
3940
n_v_col += ctx->num_to_add_vcol ;
3941
3941
3942
- n_col -= dict_table_get_n_sys_cols (user_table) ;
3942
+ n_col -= DATA_N_SYS_COLS ;
3943
3943
3944
3944
n_v_col -= ctx->num_to_drop_vcol ;
3945
3945
@@ -4173,7 +4173,7 @@ innobase_drop_virtual_try(
4173
4173
4174
4174
n_v_col -= ctx->num_to_drop_vcol ;
4175
4175
4176
- n_col -= dict_table_get_n_sys_cols (user_table) ;
4176
+ n_col -= DATA_N_SYS_COLS ;
4177
4177
4178
4178
ulint new_n = dict_table_encode_n_col (n_col, n_v_col)
4179
4179
+ ((user_table->flags & DICT_TF_COMPACT) << 31 );
Original file line number Diff line number Diff line change 1
1
/*****************************************************************************
2
2
3
3
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
4
- Copyright (c) 2017, 2018 , MariaDB Corporation.
4
+ Copyright (c) 2017, 2019 , MariaDB Corporation.
5
5
6
6
This program is free software; you can redistribute it and/or modify it under
7
7
the terms of the GNU General Public License as published by the Free Software
@@ -183,8 +183,6 @@ be less than 256 */
183
183
for shorter VARCHARs MySQL uses only 1 byte */
184
184
#define DATA_VIRTUAL 8192U /* Virtual column */
185
185
186
- /** Get the number of system columns in a table. */
187
- #define dict_table_get_n_sys_cols (table ) DATA_N_SYS_COLS
188
186
/** Check whether locking is disabled (never). */
189
187
#define dict_table_is_locking_disabled (table ) false
190
188
Original file line number Diff line number Diff line change @@ -879,13 +879,11 @@ dict_table_get_sys_col(
879
879
ulint sys) /* !< in: DATA_ROW_ID, ... */
880
880
MY_ATTRIBUTE((nonnull, warn_unused_result));
881
881
#else /* UNIV_DEBUG */
882
- #define dict_table_get_nth_col (table, pos ) \
883
- ((table)->cols + (pos))
882
+ #define dict_table_get_nth_col (table, pos ) &(table)->cols[pos]
884
883
#define dict_table_get_sys_col (table, sys ) \
885
- ((table)->cols + (table)->n_cols + (sys) \
886
- - (dict_table_get_n_sys_cols(table)))
884
+ &(table)->cols[(table)->n_cols + (sys) - DATA_N_SYS_COLS]
887
885
/* Get nth virtual columns */
888
- #define dict_table_get_nth_v_col (table, pos ) (( table)->v_cols + ( pos))
886
+ #define dict_table_get_nth_v_col (table, pos ) &( table)->v_cols[ pos]
889
887
#endif /* UNIV_DEBUG */
890
888
/* *******************************************************************/ /* *
891
889
Gets the given system column number of a table.
Original file line number Diff line number Diff line change @@ -475,13 +475,11 @@ dict_table_get_sys_col(
475
475
{
476
476
dict_col_t* col;
477
477
478
- ut_ad(table);
479
- ut_ad(sys < dict_table_get_n_sys_cols(table));
478
+ ut_ad(sys < DATA_N_SYS_COLS);
480
479
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
481
480
482
481
col = dict_table_get_nth_col(table, table->n_cols
483
- - dict_table_get_n_sys_cols(table)
484
- + sys);
482
+ + (sys - DATA_N_SYS_COLS));
485
483
ut_ad(col->mtype == DATA_SYS);
486
484
ut_ad(col->prtype == (sys | DATA_NOT_NULL));
487
485
@@ -501,7 +499,7 @@ dict_table_get_sys_col_no(
501
499
{
502
500
ut_ad(sys < DATA_N_SYS_COLS);
503
501
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
504
- return( table->n_cols - dict_table_get_n_sys_cols(table) + sys );
502
+ return table->n_cols + (sys - DATA_N_SYS_COLS );
505
503
}
506
504
507
505
/********************************************************************//**
You can’t perform that action at this time.
0 commit comments