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
4f1375e3
Commit
4f1375e3
authored
Oct 05, 2017
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not delete the last user record when deleting the 'default row'
parent
817b2394
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
7 deletions
+17
-7
storage/innobase/btr/btr0cur.cc
storage/innobase/btr/btr0cur.cc
+17
-7
No files found.
storage/innobase/btr/btr0cur.cc
View file @
4f1375e3
...
@@ -5289,10 +5289,15 @@ btr_cur_optimistic_delete_func(
...
@@ -5289,10 +5289,15 @@ btr_cur_optimistic_delete_func(
rec
=
btr_cur_get_rec
(
cursor
);
rec
=
btr_cur_get_rec
(
cursor
);
if
(
UNIV_UNLIKELY
(
page_is_root
(
block
->
frame
)
if
(
UNIV_UNLIKELY
(
page_is_root
(
block
->
frame
)
&&
page_get_n_recs
(
block
->
frame
)
&&
page_get_n_recs
(
block
->
frame
)
==
1
==
1
+
cursor
->
index
->
is_instant
()))
{
+
(
cursor
->
index
->
is_instant
()
&&
!
rec_is_default_row
(
rec
,
cursor
->
index
))))
{
/* The whole index (and table) becomes logically empty.
/* The whole index (and table) becomes logically empty.
Empty the whole page, including the 'default row' record. */
Empty the whole page. That is, if we are deleting the
only user record, also delete the 'default row' record
if one exists (it exists if and only if is_instant()).
If we are deleting the 'default row' record and the
table becomes empty, clean up the whole page. */
dict_index_t
*
index
=
cursor
->
index
;
dict_index_t
*
index
=
cursor
->
index
;
ut_ad
(
!
index
->
is_instant
()
ut_ad
(
!
index
->
is_instant
()
||
rec_is_default_row
(
||
rec_is_default_row
(
...
@@ -5519,10 +5524,15 @@ btr_cur_pessimistic_delete(
...
@@ -5519,10 +5524,15 @@ btr_cur_pessimistic_delete(
if
(
page_get_n_recs
(
page
)
<
2
)
{
if
(
page_get_n_recs
(
page
)
<
2
)
{
goto
discard_page
;
goto
discard_page
;
}
}
}
else
if
(
page_get_n_recs
(
page
)
==
1
+
index
->
is_instant
())
{
}
else
if
(
page_get_n_recs
(
page
)
==
1
/* The whole index (and table) becomes
+
(
index
->
is_instant
()
logically empty. Empty the whole page,
&&
!
rec_is_default_row
(
rec
,
index
)))
{
including any 'default row'. */
/* The whole index (and table) becomes logically empty.
Empty the whole page. That is, if we are deleting the
only user record, also delete the 'default row' record
if one exists (it exists if and only if is_instant()).
If we are deleting the 'default row' record and the
table becomes empty, clean up the whole page. */
ut_ad
(
!
index
->
is_instant
()
ut_ad
(
!
index
->
is_instant
()
||
rec_is_default_row
(
||
rec_is_default_row
(
page_rec_get_next_const
(
page_rec_get_next_const
(
...
...
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