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
65dcf7ed
Commit
65dcf7ed
authored
Oct 06, 2018
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dict_index_t::instant_metadata(): Construct a metadata record
parent
fcc3ccdd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
17 deletions
+22
-17
storage/innobase/handler/handler0alter.cc
storage/innobase/handler/handler0alter.cc
+15
-17
storage/innobase/include/dict0mem.h
storage/innobase/include/dict0mem.h
+7
-0
No files found.
storage/innobase/handler/handler0alter.cc
View file @
65dcf7ed
...
...
@@ -4717,34 +4717,32 @@ innobase_drop_virtual_try(
/** Construct the metadata record for instant ALTER TABLE.
@param[in] row dummy or default values for existing columns
@param[in] index clustered index
@param[in,out] heap memory heap for allocations
@return metadata record */
static
dtuple_t
*
instant_metadata
(
const
dtuple_t
&
row
,
const
dict_index_t
&
index
,
mem_heap_t
*
heap
)
inline
dtuple_t
*
dict_index_t
::
instant_metadata
(
const
dtuple_t
&
row
,
mem_heap_t
*
heap
)
const
{
ut_ad
(
i
ndex
.
i
s_primary
());
ut_ad
(
is_primary
());
dtuple_t
*
entry
;
if
(
!
index
.
table
->
instant
)
{
entry
=
row_build_index_entry
(
&
row
,
NULL
,
&
index
,
heap
);
if
(
!
table
->
instant
)
{
entry
=
row_build_index_entry
(
&
row
,
NULL
,
this
,
heap
);
entry
->
info_bits
=
REC_INFO_METADATA_ADD
;
return
entry
;
}
entry
=
dtuple_create
(
heap
,
index
.
n_fields
+
1
);
entry
->
n_fields_cmp
=
index
.
n_uniq
;
entry
=
dtuple_create
(
heap
,
n_fields
+
1
);
entry
->
n_fields_cmp
=
n_uniq
;
entry
->
info_bits
=
REC_INFO_METADATA_ALTER
;
const
dict_field_t
*
field
=
index
.
fields
;
const
dict_field_t
*
field
=
fields
;
for
(
uint
i
=
0
;
i
<=
index
.
n_fields
;
i
++
,
field
++
)
{
for
(
uint
i
=
0
;
i
<=
n_fields
;
i
++
,
field
++
)
{
dfield_t
*
dfield
=
dtuple_get_nth_field
(
entry
,
i
);
if
(
i
==
index
.
first_user_field
())
{
index
.
table
->
serialise_columns
(
heap
,
dfield
);
if
(
i
==
first_user_field
())
{
table
->
serialise_columns
(
heap
,
dfield
);
dfield
->
type
.
metadata_blob_init
();
field
--
;
continue
;
...
...
@@ -4772,7 +4770,7 @@ static dtuple_t* instant_metadata(
}
if
(
dfield_is_ext
(
dfield
))
{
ut_ad
(
i
>
index
.
first_user_field
());
ut_ad
(
i
>
first_user_field
());
ut_ad
(
!
field
->
prefix_len
);
ut_ad
(
dfield
->
len
>=
FIELD_REF_SIZE
);
dfield_set_len
(
dfield
,
dfield
->
len
-
FIELD_REF_SIZE
);
...
...
@@ -4783,7 +4781,7 @@ static dtuple_t* instant_metadata(
}
ut_ad
(
field
->
col
->
ord_part
);
ut_ad
(
i
<
index
.
n_uniq
);
ut_ad
(
i
<
n_uniq
);
ulint
len
=
dtype_get_at_most_n_mbchars
(
field
->
col
->
prtype
,
...
...
@@ -4974,7 +4972,7 @@ static bool innobase_instant_try(
row_ins_clust_index_entry_low() searches for the insert position. */
memset
(
roll_ptr
,
0
,
sizeof
roll_ptr
);
dtuple_t
*
entry
=
in
stant_metadata
(
*
row
,
*
index
,
ctx
->
heap
);
dtuple_t
*
entry
=
in
dex
->
instant_metadata
(
*
row
,
ctx
->
heap
);
mtr_t
mtr
;
mtr
.
start
();
index
->
set_modified
(
mtr
);
...
...
storage/innobase/include/dict0mem.h
View file @
65dcf7ed
...
...
@@ -1127,6 +1127,13 @@ struct dict_index_t {
@param[in] clustered index definition after instant ALTER TABLE */
inline
void
instant_add_field
(
const
dict_index_t
&
instant
);
/** Construct the metadata record for instant ALTER TABLE.
@param[in] row dummy or default values for existing columns
@param[in,out] heap memory heap for allocations
@return metadata record */
inline
dtuple_t
*
instant_metadata
(
const
dtuple_t
&
row
,
mem_heap_t
*
heap
)
const
;
/** 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