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
a6ac4b23
Commit
a6ac4b23
authored
Nov 09, 2012
by
Annamalai Gurusami
Browse files
Options
Browse Files
Download
Plain Diff
Merging from mysql-5.1 to mysql-5.5.
parents
7f5089aa
80948e84
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
74 additions
and
5 deletions
+74
-5
storage/innobase/fil/fil0fil.c
storage/innobase/fil/fil0fil.c
+26
-1
storage/innobase/include/fil0fil.h
storage/innobase/include/fil0fil.h
+15
-0
storage/innobase/log/log0recv.c
storage/innobase/log/log0recv.c
+11
-4
storage/innobase/row/row0merge.c
storage/innobase/row/row0merge.c
+22
-0
No files found.
storage/innobase/fil/fil0fil.c
View file @
a6ac4b23
...
...
@@ -2702,7 +2702,7 @@ fil_rename_tablespace(
mutex_exit
(
&
fil_system
->
mutex
);
#ifndef UNIV_HOTBACKUP
if
(
success
)
{
if
(
success
&&
!
recv_recovery_on
)
{
mtr_t
mtr
;
mtr_start
(
&
mtr
);
...
...
@@ -4947,3 +4947,28 @@ fil_close(void)
fil_system
=
NULL
;
}
/****************************************************************//**
Generate redo logs for swapping two .ibd files */
UNIV_INTERN
void
fil_mtr_rename_log
(
/*===============*/
ulint
old_space_id
,
/*!< in: tablespace id of the old
table. */
const
char
*
old_name
,
/*!< in: old table name */
ulint
new_space_id
,
/*!< in: tablespace id of the new
table */
const
char
*
new_name
,
/*!< in: new table name */
const
char
*
tmp_name
)
/*!< in: temp table name used while
swapping */
{
mtr_t
mtr
;
mtr_start
(
&
mtr
);
fil_op_write_log
(
MLOG_FILE_RENAME
,
old_space_id
,
0
,
0
,
old_name
,
tmp_name
,
&
mtr
);
fil_op_write_log
(
MLOG_FILE_RENAME
,
new_space_id
,
0
,
0
,
new_name
,
old_name
,
&
mtr
);
mtr_commit
(
&
mtr
);
}
storage/innobase/include/fil0fil.h
View file @
a6ac4b23
...
...
@@ -734,6 +734,21 @@ fil_tablespace_is_being_deleted(
/*============================*/
ulint
id
);
/*!< in: space id */
/****************************************************************//**
Generate redo logs for swapping two .ibd files */
UNIV_INTERN
void
fil_mtr_rename_log
(
/*===============*/
ulint
old_space_id
,
/*!< in: tablespace id of the old
table. */
const
char
*
old_name
,
/*!< in: old table name */
ulint
new_space_id
,
/*!< in: tablespace id of the new
table */
const
char
*
new_name
,
/*!< in: new table name */
const
char
*
tmp_name
);
/*!< in: temp table name used while
swapping */
typedef
struct
fil_space_struct
fil_space_t
;
#endif
storage/innobase/log/log0recv.c
View file @
a6ac4b23
...
...
@@ -965,8 +965,11 @@ recv_parse_or_apply_log_rec_body(
not NULL, then the log record is
applied to the page, and the log
record should be complete then */
mtr_t
*
mtr
)
/*!< in: mtr or NULL; should be non-NULL
mtr_t
*
mtr
,
/*!< in: mtr or NULL; should be non-NULL
if and only if block is non-NULL */
ulint
space_id
)
/*!< in: tablespace id obtained by
parsing initial log record */
{
dict_index_t
*
index
=
NULL
;
page_t
*
page
;
...
...
@@ -1238,8 +1241,11 @@ recv_parse_or_apply_log_rec_body(
ut_ad
(
!
page
||
page_type
!=
FIL_PAGE_TYPE_ALLOCATED
);
ptr
=
mlog_parse_string
(
ptr
,
end_ptr
,
page
,
page_zip
);
break
;
case
MLOG_FILE_CREATE
:
case
MLOG_FILE_RENAME
:
ptr
=
fil_op_log_parse_or_replay
(
ptr
,
end_ptr
,
type
,
space_id
,
0
);
break
;
case
MLOG_FILE_CREATE
:
case
MLOG_FILE_DELETE
:
case
MLOG_FILE_CREATE2
:
ptr
=
fil_op_log_parse_or_replay
(
ptr
,
end_ptr
,
type
,
0
,
0
);
...
...
@@ -1611,7 +1617,8 @@ recv_recover_page_func(
recv_parse_or_apply_log_rec_body
(
recv
->
type
,
buf
,
buf
+
recv
->
len
,
block
,
&
mtr
);
block
,
&
mtr
,
recv_addr
->
space
);
end_lsn
=
recv
->
start_lsn
+
recv
->
len
;
mach_write_to_8
(
FIL_PAGE_LSN
+
page
,
end_lsn
);
...
...
@@ -2078,7 +2085,7 @@ recv_parse_log_rec(
#endif
/* UNIV_LOG_LSN_DEBUG */
new_ptr
=
recv_parse_or_apply_log_rec_body
(
*
type
,
new_ptr
,
end_ptr
,
NULL
,
NULL
);
NULL
,
NULL
,
*
space
);
if
(
UNIV_UNLIKELY
(
new_ptr
==
NULL
))
{
return
(
0
);
...
...
storage/innobase/row/row0merge.c
View file @
a6ac4b23
...
...
@@ -2494,6 +2494,28 @@ row_merge_rename_tables(
goto
err_exit
;
}
/* Generate the redo logs for file operations */
fil_mtr_rename_log
(
old_table
->
space
,
old_name
,
new_table
->
space
,
new_table
->
name
,
tmp_name
);
/* What if the redo logs are flushed to disk here? This is
tested with following crash point */
DBUG_EXECUTE_IF
(
"bug14669848_precommit"
,
log_buffer_flush_to_disk
();
DBUG_SUICIDE
(););
/* File operations cannot be rolled back. So, before proceeding
with file operations, commit the dictionary changes.*/
trx_commit_for_mysql
(
trx
);
/* If server crashes here, the dictionary in InnoDB and MySQL
will differ. The .ibd files and the .frm files must be swapped
manually by the administrator. No loss of data. */
DBUG_EXECUTE_IF
(
"bug14669848"
,
DBUG_SUICIDE
(););
/* Ensure that the redo logs are flushed to disk. The config
innodb_flush_log_at_trx_commit must not affect this. */
log_buffer_flush_to_disk
();
/* The following calls will also rename the .ibd data files if
the tables are stored in a single-table tablespace */
...
...
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