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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
2cfb1047
Commit
2cfb1047
authored
Jun 25, 2014
by
John Esmet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FT-93 Add a stronger sanity check, fix a bug where we wouldn't properly
update the total size when convering to dbt format.
parent
8cde040c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
ft/pivotkeys.cc
ft/pivotkeys.cc
+10
-0
No files found.
ft/pivotkeys.cc
View file @
2cfb1047
...
...
@@ -201,6 +201,7 @@ void ftnode_pivot_keys::_convert_to_fixed_format() {
_dbt_keys
=
nullptr
;
invariant
(
_fixed_format
());
sanity_check
();
}
void
ftnode_pivot_keys
::
_convert_to_dbt_format
()
{
...
...
@@ -211,13 +212,17 @@ void ftnode_pivot_keys::_convert_to_dbt_format() {
for
(
int
i
=
0
;
i
<
_num_pivots
;
i
++
)
{
toku_memdup_dbt
(
&
_dbt_keys
[
i
],
_fixed_key
(
i
),
_fixed_keylen
);
}
// pivots sizes are not aligned up dbt format
_total_size
=
_num_pivots
*
_fixed_keylen
;
// destroy the fixed key format
toku_free
(
_fixed_keys
);
_fixed_keys
=
nullptr
;
_fixed_keylen
=
0
;
_fixed_keylen_aligned
=
0
;
invariant
(
!
_fixed_format
());
sanity_check
();
}
void
ftnode_pivot_keys
::
deserialize_from_rbuf
(
struct
rbuf
*
rb
,
int
n
)
{
...
...
@@ -475,5 +480,10 @@ void ftnode_pivot_keys::sanity_check() const {
invariant
(
_num_pivots
*
_fixed_keylen_aligned
==
_total_size
);
}
else
{
invariant
(
_num_pivots
==
0
||
_dbt_keys
!=
nullptr
);
size_t
size
=
0
;
for
(
int
i
=
0
;
i
<
_num_pivots
;
i
++
)
{
size
+=
_dbt_keys
[
i
].
size
;
}
invariant
(
size
==
_total_size
);
}
}
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