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
2b80f4b7
Commit
2b80f4b7
authored
Oct 01, 2018
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify the construction of the metadata record
parent
ecbfdb31
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
67 deletions
+24
-67
storage/innobase/include/dict0mem.h
storage/innobase/include/dict0mem.h
+0
-57
storage/innobase/row/row0row.cc
storage/innobase/row/row0row.cc
+24
-10
No files found.
storage/innobase/include/dict0mem.h
View file @
2b80f4b7
...
...
@@ -613,17 +613,6 @@ struct dict_col_t{
/** @return whether NULL is an allowed value for this column */
bool
is_nullable
()
const
{
return
!
(
prtype
&
DATA_NOT_NULL
);
}
/** Construct dfield for the data tuple.
@param[out] dfield data field of the tuple
@param[out] heap memory heap */
inline
void
construct_dropped_field
(
dfield_t
*
dfield
,
mem_heap_t
*
heap
)
const
;
inline
void
construct_dropped_default_field
(
dfield_t
*
dfield
,
mem_heap_t
*
heap
)
const
;
/** @return whether table of this system field is TRX_ID-based */
bool
vers_native
()
const
{
...
...
@@ -1177,52 +1166,6 @@ inline void dict_col_t::detach(const dict_index_t& index)
}
}
inline
void
dict_col_t
::
construct_dropped_default_field
(
dfield_t
*
dfield
,
mem_heap_t
*
heap
)
const
{
dfield
->
type
.
prtype
=
DATA_BINARY_TYPE
;
if
(
prtype
&
DATA_NOT_NULL
)
{
dfield
->
type
.
prtype
|=
DATA_NOT_NULL
;
}
dfield_set_data
(
dfield
,
field_ref_zero
,
len
);
if
(
len
>
0
)
{
dfield
->
type
.
mtype
=
DATA_FIXBINARY
;
}
else
{
dfield
->
type
.
mtype
=
DATA_BINARY
;
}
}
/** Construct dfield for the data tuple.
@param[out] dfield data field of the tuple
@param[out] heap memory heap */
inline
void
dict_col_t
::
construct_dropped_field
(
dfield_t
*
dfield
,
mem_heap_t
*
heap
)
const
{
dfield
->
type
.
prtype
=
DATA_NOT_NULL
;
if
(
!
(
prtype
&
DATA_NOT_NULL
))
{
dfield
->
data
=
0x00
;
dfield
->
len
=
UNIV_SQL_NULL
;
dfield
->
type
.
prtype
=
DATA_BINARY_TYPE
;
}
else
if
(
len
>
0
)
{
dfield
->
data
=
mem_heap_zalloc
(
heap
,
len
);
dfield
->
len
=
len
;
}
else
{
dfield
->
data
=
0x00
;
dfield
->
len
=
0
;
}
if
(
len
>
0
)
{
dfield
->
type
.
mtype
=
DATA_FIXBINARY
;
}
else
{
dfield
->
type
.
mtype
=
DATA_BINARY
;
}
}
/** The status of online index creation */
enum
online_index_status
{
/** the index is complete and ready for access */
...
...
storage/innobase/row/row0row.cc
View file @
2b80f4b7
...
...
@@ -55,16 +55,16 @@ Created 4/20/1996 Heikki Tuuri
dtuple_t
*
row_build_clust_default_entry
(
const
dtuple_t
*
row
,
dict_index_t
*
clust_
index
,
dict_index_t
*
index
,
mem_heap_t
*
heap
)
{
ut_a
(
dict_index_is_clust
(
clust_index
));
ut_ad
(
index
->
is_primary
());
ut_ad
(
index
->
is_instant
());
ulint
entry_n_fields
=
dict_index_get_n_fields
(
clust_index
)
+
1
;
ulint
entry_n_fields
=
index
->
n_fields
+
1
;
dtuple_t
*
entry
=
dtuple_create
(
heap
,
entry_n_fields
);
dtuple_set_n_fields_cmp
(
entry
,
dict_index_get_n_unique_in_tree
(
clust_index
));
dtuple_set_n_fields_cmp
(
entry
,
index
->
n_uniq
);
for
(
ulint
field_no
=
0
,
ind_field_no
=
0
;
field_no
<
entry_n_fields
;
field_no
++
)
{
...
...
@@ -77,7 +77,7 @@ row_build_clust_default_entry(
dfield
=
dtuple_get_nth_field
(
entry
,
field_no
);
if
(
field_no
==
clust_
index
->
first_user_field
())
{
if
(
field_no
==
index
->
first_user_field
())
{
dfield_set_data
(
dfield
,
mem_heap_zalloc
(
heap
,
BTR_EXTERN_FIELD_REF_SIZE
),
...
...
@@ -87,11 +87,18 @@ row_build_clust_default_entry(
continue
;
}
ind_field
=
dict_index_get_nth_field
(
clust_
index
,
ind_field_no
++
);
ind_field
=
dict_index_get_nth_field
(
index
,
ind_field_no
++
);
col
=
ind_field
->
col
;
ut_ad
(
!
col
->
is_virtual
());
if
(
col
->
is_dropped
())
{
col
->
construct_dropped_default_field
(
dfield
,
heap
);
dict_col_copy_type
(
col
,
&
dfield
->
type
);
if
(
col
->
is_nullable
())
{
dfield_set_null
(
dfield
);
}
else
{
dfield_set_data
(
dfield
,
field_ref_zero
,
col
->
len
);
}
continue
;
}
else
{
col_no
=
dict_col_get_no
(
col
);
...
...
@@ -336,9 +343,16 @@ row_build_index_entry_low(
}
if
(
col
->
is_dropped
())
{
ut_ad
(
dict_index_is_clust
(
index
));
ut_ad
(
index
->
is_primary
());
ut_ad
(
index
->
is_instant
());
ut_ad
(
!
col
->
is_virtual
());
col
->
construct_dropped_field
(
dfield
,
heap
);
dict_col_copy_type
(
col
,
&
dfield
->
type
);
if
(
col
->
is_nullable
())
{
dfield_set_null
(
dfield
);
}
else
{
dfield_set_data
(
dfield
,
field_ref_zero
,
col
->
len
);
}
continue
;
}
else
{
col_no
=
dict_col_get_no
(
col
);
...
...
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