Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
3fb6b0f3
Commit
3fb6b0f3
authored
Sep 21, 2018
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor cleanup of dict_col_t
dict_col_t::is_added(): The new name for is_instant().
parent
1725d3b9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
32 deletions
+23
-32
storage/innobase/btr/btr0cur.cc
storage/innobase/btr/btr0cur.cc
+1
-1
storage/innobase/data/data0data.cc
storage/innobase/data/data0data.cc
+1
-1
storage/innobase/dict/dict0mem.cc
storage/innobase/dict/dict0mem.cc
+7
-7
storage/innobase/handler/handler0alter.cc
storage/innobase/handler/handler0alter.cc
+2
-2
storage/innobase/include/dict0dict.ic
storage/innobase/include/dict0dict.ic
+2
-1
storage/innobase/include/dict0mem.h
storage/innobase/include/dict0mem.h
+10
-20
No files found.
storage/innobase/btr/btr0cur.cc
View file @
3fb6b0f3
...
...
@@ -561,7 +561,7 @@ btr_cur_instant_init_add_column(
ulint
len
;
const
byte
*
data
=
rec_get_nth_field
(
rec
,
offsets
,
i
,
&
len
);
dict_col_t
*
col
=
index
->
fields
[
i
].
col
;
ut_ad
(
!
col
->
is_
instant_ad
d
());
ut_ad
(
!
col
->
is_
adde
d
());
ut_ad
(
!
col
->
def_val
.
data
);
col
->
def_val
.
len
=
len
;
switch
(
len
)
{
...
...
storage/innobase/data/data0data.cc
View file @
3fb6b0f3
...
...
@@ -65,7 +65,7 @@ void dtuple_t::trim(const dict_index_t& index)
continue
;
}
ut_ad
(
col
->
is_
instant_ad
d
());
ut_ad
(
col
->
is_
adde
d
());
ulint
len
=
dfield_get_len
(
dfield
);
if
(
len
!=
col
->
def_val
.
len
)
{
break
;
...
...
storage/innobase/dict/dict0mem.cc
View file @
3fb6b0f3
...
...
@@ -713,9 +713,9 @@ dict_mem_fill_column_struct(
dtype_get_mblen
(
mtype
,
prtype
,
&
mbminlen
,
&
mbmaxlen
);
column
->
mbminlen
=
mbminlen
;
column
->
mbmaxlen
=
mbmaxlen
;
column
->
dropped
=
false
;
column
->
def_val
.
data
=
NULL
;
column
->
def_val
.
len
=
UNIV_SQL_DEFAULT
;
column
->
dropped
=
false
;
}
/**********************************************************************//**
...
...
@@ -1229,7 +1229,8 @@ void dict_index_t::reconstruct_fields()
fields
=
temp_fields
;
}
/** Remove the instant fields from the index. */
/** Remove instant ALTER TABLE metadata.
Protected by index root page x-latch or table X-lock. */
void
dict_index_t
::
remove_instant
()
{
DBUG_ASSERT
(
is_primary
());
...
...
@@ -1275,7 +1276,7 @@ void dict_index_t::remove_instant()
table
,
dict_col_get_no
(
field
.
col
));
temp_field
.
col
=
&
table
->
cols
[
field
.
col
->
ind
];
if
(
temp_field
.
col
->
is_
instant_ad
d
())
{
if
(
temp_field
.
col
->
is_
adde
d
())
{
temp_field
.
col
->
remove_instant
();
}
...
...
@@ -1516,7 +1517,6 @@ void dict_table_t::construct_dropped_columns(const byte* data)
field_data
+=
INSTANT_FIELD_LEN
;
}
dropped_cols
=
static_cast
<
dict_col_t
*>
(
mem_heap_zalloc
(
heap
,
n_dropped_cols
*
sizeof
(
dict_col_t
)));
...
...
@@ -1524,7 +1524,7 @@ void dict_table_t::construct_dropped_columns(const byte* data)
for
(
ulint
i
=
0
;
i
<
n_dropped_cols
;
i
++
)
{
dict_col_t
&
drop_col
=
dropped_cols
[
i
];
bool
is_fixed
=
false
;
drop_col
.
set_dropped
()
;
drop_col
.
dropped
=
true
;
while
(
j
<
num_non_pk_fields
)
{
if
(
non_pk_col_map
[
j
]
==
0
)
{
...
...
@@ -1574,7 +1574,7 @@ void dict_table_t::fill_dropped_column(
dict_col_t
&
drop_col
=
temp_drop_cols
[
j
++
];
dict_col_t
col
=
cols
[
i
];
drop_col
.
set_dropped
()
;
drop_col
.
dropped
=
true
;
drop_col
.
ind
=
dict_col_get_clust_pos
(
&
cols
[
i
],
dict_table_get_first_index
(
this
));
...
...
@@ -1653,7 +1653,7 @@ void dict_table_t::instant_op_column(
/* Copy the new default values to this->heap. */
for
(
unsigned
i
=
n_cols
;
i
<
table
.
n_cols
;
i
++
)
{
dict_col_t
&
c
=
cols
[
i
-
DATA_N_SYS_COLS
];
DBUG_ASSERT
(
c
.
is_
instant_ad
d
());
DBUG_ASSERT
(
c
.
is_
adde
d
());
if
(
c
.
def_val
.
len
==
0
)
{
c
.
def_val
.
data
=
field_ref_zero
;
}
else
if
(
const
void
*&
d
=
c
.
def_val
.
data
)
{
...
...
storage/innobase/handler/handler0alter.cc
View file @
3fb6b0f3
...
...
@@ -4481,7 +4481,7 @@ innobase_op_instant_try(
dfield_t
*
d
=
dtuple_get_nth_field
(
row
,
i
);
if
(
col
->
is_
instant_ad
d
())
{
if
(
col
->
is_
adde
d
())
{
dfield_set_data
(
d
,
col
->
def_val
.
data
,
col
->
def_val
.
len
);
}
else
if
((
*
af
)
->
real_maybe_null
())
{
...
...
@@ -5601,7 +5601,7 @@ prepare_inplace_alter_table_dict(
DBUG_ASSERT
(
!
strcmp
((
*
af
)
->
field_name
.
str
,
dict_table_get_col_name
(
ctx
->
new_table
,
i
)));
DBUG_ASSERT
(
!
col
->
is_
instant_ad
d
());
DBUG_ASSERT
(
!
col
->
is_
adde
d
());
if
(
new_field
->
field
)
{
#if 0
...
...
storage/innobase/include/dict0dict.ic
View file @
3fb6b0f3
...
...
@@ -490,7 +490,8 @@ dict_table_get_nth_v_col(
ut_ad(table);
ut_ad(pos < table->n_v_def);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
ut_ad(!table->v_cols[pos].m_col.is_instant_add());
ut_ad(!table->v_cols[pos].m_col.is_added());
ut_ad(!table->v_cols[pos].m_col.is_dropped());
return &table->v_cols[pos];
}
...
...
storage/innobase/include/dict0mem.h
View file @
3fb6b0f3
...
...
@@ -588,8 +588,8 @@ struct dict_col_t{
3072 (REC_VERSION_56_MAX_INDEX_COL_LEN)
bytes. */
/** Whether the column
is delet
ed. */
bool
dropped
;
/** Whether the column
has been instantly dropp
ed. */
unsigned
dropped
:
1
;
/** Detach the column from an index.
@param[in] index index to be detached from */
...
...
@@ -644,18 +644,21 @@ struct dict_col_t{
}
/** @return whether this is an instantly-added column */
bool
is_
instant_ad
d
()
const
bool
is_
adde
d
()
const
{
DBUG_ASSERT
(
def_val
.
len
!=
UNIV_SQL_DEFAULT
||
!
def_val
.
data
);
return
def_val
.
len
!=
UNIV_SQL_DEFAULT
;
}
/** @return whether the column was instantly dropped */
bool
is_dropped
()
const
{
return
dropped
;
}
/** Get the default value of an instantly-added column.
@param[out] len value length (in bytes), or UNIV_SQL_NULL
@return default value
@retval NULL if the default value is SQL NULL (len=UNIV_SQL_NULL) */
const
byte
*
instant_value
(
ulint
*
len
)
const
{
DBUG_ASSERT
(
is_
instant_ad
d
());
DBUG_ASSERT
(
is_
adde
d
());
*
len
=
def_val
.
len
;
return
static_cast
<
const
byte
*>
(
def_val
.
data
);
}
...
...
@@ -663,22 +666,10 @@ struct dict_col_t{
/** Remove the 'instant ADD' status of the column */
void
remove_instant
()
{
DBUG_ASSERT
(
is_
instant_ad
d
());
DBUG_ASSERT
(
is_
adde
d
());
def_val
.
len
=
UNIV_SQL_DEFAULT
;
def_val
.
data
=
NULL
;
}
/** @return whether the column is dropped */
bool
is_dropped
()
const
{
return
dropped
;
}
/** Set the dropped flag. */
void
set_dropped
()
{
dropped
=
true
;
}
};
/** Index information put in a list of virtual column structure. Index
...
...
@@ -1129,8 +1120,7 @@ struct dict_index_t {
for
(
ulint
i
=
n_core_fields
;
i
<
n_prefix
;
i
++
)
{
const
dict_col_t
*
col
=
fields
[
i
].
col
;
if
(
col
->
is_dropped
()
||
col
->
is_instant_add
())
{
if
(
col
->
is_dropped
()
||
col
->
is_added
())
{
n
++
;
continue
;
}
...
...
@@ -1204,7 +1194,7 @@ struct dict_index_t {
@param[in] clustered index definition after instant ADD COLUMN */
void
instant_add_field
(
const
dict_index_t
&
instant
);
/** Remove instant
fields from the clustered index
.
/** Remove instant
ALTER TABLE metadata
.
Protected by index root page x-latch or table X-lock. */
void
remove_instant
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment