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
2afb55b2
Commit
2afb55b2
authored
Sep 19, 2018
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify and fix dtuple_convert_big_rec()
parent
f6c455e2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
27 deletions
+20
-27
storage/innobase/data/data0data.cc
storage/innobase/data/data0data.cc
+20
-27
No files found.
storage/innobase/data/data0data.cc
View file @
2afb55b2
...
...
@@ -603,7 +603,6 @@ dtuple_convert_big_rec(
mem_heap_t
*
heap
;
big_rec_t
*
vector
;
dfield_t
*
dfield
;
dict_field_t
*
ifield
;
ulint
size
;
ulint
n_fields
;
ulint
local_len
;
...
...
@@ -613,6 +612,8 @@ dtuple_convert_big_rec(
return
(
NULL
);
}
ut_ad
(
index
->
n_uniq
>
0
);
if
(
!
dict_table_has_atomic_blobs
(
index
->
table
))
{
/* up to MySQL 5.1: store a 768-byte prefix locally */
local_len
=
BTR_EXTERN_FIELD_REF_SIZE
...
...
@@ -643,39 +644,30 @@ dtuple_convert_big_rec(
stored externally */
n_fields
=
0
;
ulint
longest_i
;
bool
drop_column_blob
=
true
;
const
bool
ext_metadata
=
entry
->
is_alter_metadata
();
if
(
entry
->
is_alter_metadata
())
{
longest_i
=
index
->
n_uniq
+
DATA_ROLL_PTR
;
dfield
=
dtuple_get_nth_field
(
entry
,
longest_i
);
dfield
->
data
=
index
->
table
->
construct_metadata_blob
(
heap
,
&
dfield
->
len
);
goto
ext_write
;
}
while
(
page_zip_rec_needs_ext
(
rec_get_converted_size
(
index
,
entry
,
*
n_ext
),
dict_table_is_comp
(
index
->
table
),
dict_index_get_n_fields
(
index
),
dict_table_page_size
(
index
->
table
))
||
UNIV_UNLIKELY
(
ext_metadata
&&
drop_column_blob
))
{
ulint
i
;
ulint
longest
=
0
;
ulint
longest_i
=
ULINT_MAX
;
byte
*
data
;
ulint
field_no
=
0
;
for
(
i
=
dict_index_get_n_unique_in_tree
(
index
);
i
<
dtuple_get_n_fields
(
entry
);
i
++
)
{
ulint
savings
;
dict_table_page_size
(
index
->
table
)))
{
longest_i
=
0
;
for
(
ulint
i
=
index
->
n_uniq
+
2
,
longest
=
0
;
i
<
entry
->
n_fields
;
i
++
)
{
ulint
savings
;
dfield
=
dtuple_get_nth_field
(
entry
,
i
);
if
(
UNIV_UNLIKELY
(
ext_metadata
&&
i
==
unsigned
(
index
->
n_uniq
+
DATA_ROLL_PTR
)))
{
longest_i
=
i
;
dfield
->
data
=
index
->
table
->
construct_metadata_blob
(
heap
,
&
dfield
->
len
);
drop_column_blob
=
false
;
goto
ext_write
;
}
ifield
=
dict_index_get_nth_field
(
index
,
field_no
++
);
const
dict_field_t
*
ifield
=
dict_index_get_nth_field
(
index
,
i
);
/* Skip fixed-length, NULL, externally stored,
or short columns */
...
...
@@ -717,7 +709,7 @@ dtuple_convert_big_rec(
continue
;
}
if
(
!
longest
)
{
if
(
!
longest
_i
)
{
/* Cannot shorten more */
mem_heap_free
(
heap
);
...
...
@@ -742,7 +734,8 @@ dtuple_convert_big_rec(
+
local_prefix_len
));
/* Allocate the locally stored part of the column. */
data
=
static_cast
<
byte
*>
(
mem_heap_alloc
(
heap
,
local_len
));
byte
*
data
=
static_cast
<
byte
*>
(
mem_heap_alloc
(
heap
,
local_len
));
/* Copy the local prefix. */
memcpy
(
data
,
dfield_get_data
(
dfield
),
local_prefix_len
);
...
...
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