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
ebafe5a2
Commit
ebafe5a2
authored
Aug 31, 2020
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup: Avoid repeated calls to dict_col_t::is_virtual()
parent
4a165f37
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
23 deletions
+16
-23
storage/innobase/handler/ha_innodb.cc
storage/innobase/handler/ha_innodb.cc
+4
-5
storage/innobase/row/row0merge.cc
storage/innobase/row/row0merge.cc
+12
-18
No files found.
storage/innobase/handler/ha_innodb.cc
View file @
ebafe5a2
...
...
@@ -5775,14 +5775,13 @@ innobase_vcol_build_templ(
mysql_row_templ_t
*
templ
,
ulint
col_no
)
{
if
(
dict_col_is_virtual
(
col
))
{
templ
->
is_virtual
=
true
;
templ
->
col_no
=
col_no
;
templ
->
col_no
=
col_no
;
templ
->
is_virtual
=
col
->
is_virtual
();
if
(
templ
->
is_virtual
)
{
templ
->
clust_rec_field_no
=
ULINT_UNDEFINED
;
templ
->
rec_field_no
=
col
->
ind
;
}
else
{
templ
->
is_virtual
=
false
;
templ
->
col_no
=
col_no
;
templ
->
clust_rec_field_no
=
dict_col_get_clust_pos
(
col
,
clust_index
);
ut_a
(
templ
->
clust_rec_field_no
!=
ULINT_UNDEFINED
);
...
...
storage/innobase/row/row0merge.cc
View file @
ebafe5a2
...
...
@@ -554,23 +554,16 @@ row_merge_buf_add(
for
(
i
=
0
;
i
<
n_fields
;
i
++
,
field
++
,
ifield
++
)
{
ulint
len
;
const
dict_col_t
*
col
;
ulint
col_no
;
ulint
fixed_len
;
const
dfield_t
*
row_field
;
col
=
ifield
->
col
;
const
dict_v_col_t
*
v_col
=
NULL
;
if
(
dict_col_is_virtual
(
col
))
{
v_col
=
reinterpret_cast
<
const
dict_v_col_t
*>
(
col
);
}
col_no
=
dict_col_get_no
(
col
);
const
dict_col_t
*
const
col
=
ifield
->
col
;
const
dict_v_col_t
*
const
v_col
=
col
->
is_virtual
()
?
reinterpret_cast
<
const
dict_v_col_t
*>
(
col
)
:
NULL
;
/* Process the Doc ID column */
if
(
*
doc_id
>
0
&&
col_no
==
index
->
table
->
fts
->
doc_col
&&
!
dict_col_is_virtual
(
col
))
{
if
(
!
v_col
&&
*
doc_id
&&
col
->
ind
==
index
->
table
->
fts
->
doc_col
)
{
fts_write_doc_id
((
byte
*
)
&
write_doc_id
,
*
doc_id
);
/* Note: field->data now points to a value on the
...
...
@@ -589,7 +582,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
(
v_col
)
{
dict_index_t
*
clust_index
=
dict_table_get_first_index
(
new_table
);
...
...
@@ -614,7 +607,8 @@ row_merge_buf_add(
}
dfield_copy
(
field
,
row_field
);
}
else
{
row_field
=
dtuple_get_nth_field
(
row
,
col_no
);
row_field
=
dtuple_get_nth_field
(
row
,
col
->
ind
);
dfield_copy
(
field
,
row_field
);
}
...
...
@@ -720,7 +714,7 @@ row_merge_buf_add(
}
else
if
(
!
ext
)
{
}
else
if
(
dict_index_is_clust
(
index
))
{
/* Flag externally stored fields. */
const
byte
*
buf
=
row_ext_lookup
(
ext
,
col
_no
,
const
byte
*
buf
=
row_ext_lookup
(
ext
,
col
->
ind
,
&
len
);
if
(
UNIV_LIKELY_NULL
(
buf
))
{
ut_a
(
buf
!=
field_ref_zero
);
...
...
@@ -731,9 +725,9 @@ row_merge_buf_add(
len
=
dfield_get_len
(
field
);
}
}
}
else
if
(
!
dict_col_is_virtual
(
col
)
)
{
}
else
if
(
!
v_col
)
{
/* Only non-virtual column are stored externally */
const
byte
*
buf
=
row_ext_lookup
(
ext
,
col
_no
,
const
byte
*
buf
=
row_ext_lookup
(
ext
,
col
->
ind
,
&
len
);
if
(
UNIV_LIKELY_NULL
(
buf
))
{
ut_a
(
buf
!=
field_ref_zero
);
...
...
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