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
6e82d5b4
Commit
6e82d5b4
authored
Oct 04, 2017
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
When rolling back the initial instant ADD COLUMN, restore the root page to non-instant format
parent
3b229393
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
6 deletions
+40
-6
storage/innobase/include/page0page.ic
storage/innobase/include/page0page.ic
+1
-0
storage/innobase/row/row0uins.cc
storage/innobase/row/row0uins.cc
+39
-6
No files found.
storage/innobase/include/page0page.ic
View file @
6e82d5b4
...
...
@@ -1138,6 +1138,7 @@ page_set_instant(page_t* page, unsigned n, mtr_t* mtr)
ut_ad(n > 0);
ut_ad(n < 1U << 10);
uint16_t i = page_header_get_field(page, PAGE_INSTANT);
ut_ad(i <= PAGE_NO_DIRECTION);
i |= n << 6;
mlog_write_ulint(PAGE_HEADER + PAGE_INSTANT + page, i,
MLOG_2BYTES, mtr);
...
...
storage/innobase/row/row0uins.cc
View file @
6e82d5b4
...
...
@@ -78,6 +78,7 @@ row_undo_ins_remove_clust_rec(
mtr
.
start
();
if
(
index
->
table
->
is_temporary
())
{
ut_ad
(
node
->
rec_type
==
TRX_UNDO_INSERT_REC
);
mtr
.
set_log_mode
(
MTR_LOG_NO_REDO
);
}
else
{
mtr
.
set_named_space
(
index
->
space
);
...
...
@@ -122,9 +123,9 @@ row_undo_ins_remove_clust_rec(
switch
(
node
->
table
->
id
)
{
case
DICT_INDEXES_ID
:
ut_ad
(
!
online
);
ut_ad
(
node
->
trx
->
dict_operation_lock_mode
==
RW_X_LATCH
);
ut_ad
(
node
->
rec_type
==
TRX_UNDO_INSERT_REC
);
dict_drop_index_tree
(
btr_pcur_get_rec
(
&
node
->
pcur
),
&
(
node
->
pcur
),
&
mtr
);
...
...
@@ -145,6 +146,7 @@ row_undo_ins_remove_clust_rec(
been rolled back. */
ut_ad
(
!
online
);
ut_ad
(
node
->
trx
->
dict_operation_lock_mode
==
RW_X_LATCH
);
ut_ad
(
node
->
rec_type
==
TRX_UNDO_INSERT_REC
);
const
rec_t
*
rec
=
btr_pcur_get_rec
(
&
node
->
pcur
);
if
(
rec_get_n_fields_old
(
rec
)
!=
DICT_NUM_FIELDS__SYS_COLUMNS
)
{
...
...
@@ -254,6 +256,27 @@ row_undo_ins_remove_clust_rec(
func_exit:
btr_pcur_commit_specify_mtr
(
&
node
->
pcur
,
&
mtr
);
if
(
err
==
DB_SUCCESS
&&
node
->
rec_type
==
TRX_UNDO_INSERT_DEFAULT
)
{
/* When rolling back the very first instant ADD COLUMN
operation, reset the root page to the basic state. */
ut_ad
(
!
index
->
table
->
is_temporary
());
mtr
.
start
();
if
(
page_t
*
root
=
btr_root_get
(
index
,
&
mtr
))
{
byte
*
page_type
=
root
+
FIL_PAGE_TYPE
;
ut_ad
(
mach_read_from_2
(
page_type
)
==
FIL_PAGE_TYPE_INSTANT
||
mach_read_from_2
(
page_type
)
==
FIL_PAGE_INDEX
);
mtr
.
set_named_space
(
index
->
space
);
mlog_write_ulint
(
page_type
,
FIL_PAGE_INDEX
,
MLOG_2BYTES
,
&
mtr
);
byte
*
instant
=
PAGE_INSTANT
+
PAGE_HEADER
+
root
;
mlog_write_ulint
(
instant
,
page_ptr_get_direction
(
instant
+
1
),
MLOG_2BYTES
,
&
mtr
);
}
mtr
.
commit
();
}
return
(
err
);
}
...
...
@@ -567,6 +590,11 @@ row_undo_ins(
node
->
index
=
dict_table_get_first_index
(
node
->
table
);
ut_ad
(
dict_index_is_clust
(
node
->
index
));
switch
(
node
->
rec_type
)
{
default:
ut_ad
(
!
"wrong undo record type"
);
case
TRX_UNDO_INSERT_REC
:
/* Skip the clustered index (the first index) */
node
->
index
=
dict_table_get_next_index
(
node
->
index
);
...
...
@@ -574,11 +602,16 @@ row_undo_ins(
err
=
row_undo_ins_remove_sec_rec
(
node
,
thr
);
if
(
err
==
DB_SUCCESS
)
{
if
(
err
!=
DB_SUCCESS
)
{
break
;
}
/* fall through */
case
TRX_UNDO_INSERT_DEFAULT
:
log_free_check
();
if
(
node
->
table
->
id
==
DICT_INDEXES_ID
)
{
ut_ad
(
node
->
rec_type
==
TRX_UNDO_INSERT_REC
);
if
(
!
dict_locked
)
{
mutex_enter
(
&
dict_sys
->
mutex
);
...
...
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