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
b7364399
Commit
b7364399
authored
May 10, 2006
by
marko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
branches/zip: btr_compress(): Do not modify the node pointer until the
records have successfully been copied.
parent
6748a82b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
22 deletions
+20
-22
btr/btr0btr.c
btr/btr0btr.c
+20
-22
No files found.
btr/btr0btr.c
View file @
b7364399
...
...
@@ -2247,27 +2247,6 @@ btr_compress(
/* Remove the page from the level list */
btr_level_list_remove
(
tree
,
page
,
mtr
);
if
(
is_left
)
{
btr_node_ptr_delete
(
tree
,
page
,
mtr
);
}
else
{
mem_heap_t
*
heap
=
NULL
;
ulint
offsets_
[
REC_OFFS_NORMAL_SIZE
];
*
offsets_
=
(
sizeof
offsets_
)
/
sizeof
*
offsets_
;
/* Replace the address of the old child node (= page) with the
address of the merge page to the right */
btr_node_ptr_set_child_page_no
(
node_ptr
,
buf_block_get_page_zip
(
buf_block_align
(
node_ptr
)),
rec_get_offsets
(
node_ptr
,
cursor
->
index
,
offsets_
,
ULINT_UNDEFINED
,
&
heap
),
right_page_no
,
mtr
);
if
(
UNIV_LIKELY_NULL
(
heap
))
{
mem_heap_free
(
heap
);
}
btr_node_ptr_delete
(
tree
,
merge_page
,
mtr
);
}
/* Move records to the merge page */
if
(
is_left
)
{
rec_t
*
orig_pred
=
page_rec_get_prev
(
...
...
@@ -2280,10 +2259,15 @@ btr_compress(
return
(
FALSE
);
}
btr_node_ptr_delete
(
tree
,
page
,
mtr
);
lock_update_merge_left
(
merge_page
,
orig_pred
,
page
);
}
else
{
rec_t
*
orig_succ
=
page_rec_get_next
(
mem_heap_t
*
heap
=
NULL
;
ulint
offsets_
[
REC_OFFS_NORMAL_SIZE
];
rec_t
*
orig_succ
=
page_rec_get_next
(
page_get_infimum_rec
(
merge_page
));
*
offsets_
=
(
sizeof
offsets_
)
/
sizeof
*
offsets_
;
if
(
UNIV_UNLIKELY
(
!
page_copy_rec_list_end
(
merge_page
,
buf_block_get_page_zip
(
buf_block_align
(
merge_page
)),
...
...
@@ -2292,6 +2276,20 @@ btr_compress(
return
(
FALSE
);
}
/* Replace the address of the old child node (= page) with the
address of the merge page to the right */
btr_node_ptr_set_child_page_no
(
node_ptr
,
buf_block_get_page_zip
(
buf_block_align
(
node_ptr
)),
rec_get_offsets
(
node_ptr
,
cursor
->
index
,
offsets_
,
ULINT_UNDEFINED
,
&
heap
),
right_page_no
,
mtr
);
if
(
UNIV_LIKELY_NULL
(
heap
))
{
mem_heap_free
(
heap
);
}
btr_node_ptr_delete
(
tree
,
merge_page
,
mtr
);
lock_update_merge_right
(
orig_succ
,
page
);
}
...
...
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