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
209b6f9a
Commit
209b6f9a
authored
Sep 13, 2010
by
Michael Widenius
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
64244a34
456422a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
5 deletions
+63
-5
storage/maria/ma_recovery.c
storage/maria/ma_recovery.c
+63
-5
No files found.
storage/maria/ma_recovery.c
View file @
209b6f9a
...
...
@@ -554,6 +554,11 @@ static int display_and_apply_record(const LOG_DESC *log_desc,
DBUG_ASSERT
(
"one more hook to write"
==
0
);
return
1
;
}
if
(
rec
->
type
==
LOGREC_DEBUG_INFO
)
{
/* Query already printed by display_record_position() */
return
0
;
}
if
((
error
=
(
*
log_desc
->
record_execute_in_redo_phase
)(
rec
)))
eprint
(
tracef
,
"Got error %d when executing record %s"
,
my_errno
,
log_desc
->
name
);
...
...
@@ -692,6 +697,45 @@ prototype_redo_exec_hook(INCOMPLETE_LOG)
}
static
my_bool
create_database_if_not_exists
(
const
char
*
name
)
{
char
dirname
[
FN_REFLEN
];
size_t
length
;
MY_STAT
stat_info
;
DBUG_ENTER
(
"create_database_if_not_exists"
);
dirname_part
(
dirname
,
name
,
&
length
);
if
(
!
length
)
{
/* Skip files without directores */
DBUG_RETURN
(
0
);
}
/*
Safety; Don't create files with hard path;
Should never happen with MariaDB
If hard path, then error will be detected when trying to create index file
*/
if
(
test_if_hard_path
(
dirname
))
DBUG_RETURN
(
0
);
if
(
my_stat
(
dirname
,
&
stat_info
,
MYF
(
0
)))
DBUG_RETURN
(
0
);
tprint
(
tracef
,
"Creating not existing database '%s'
\n
"
,
dirname
);
if
(
my_mkdir
(
dirname
,
0777
,
MYF
(
MY_WME
)))
{
eprint
(
tracef
,
"***WARNING: Can't create not existing database '%s'"
,
dirname
);
DBUG_RETURN
(
1
);
}
DBUG_RETURN
(
0
);
}
prototype_redo_exec_hook
(
REDO_CREATE_TABLE
)
{
File
dfile
=
-
1
,
kfile
=
-
1
;
...
...
@@ -703,11 +747,12 @@ prototype_redo_exec_hook(REDO_CREATE_TABLE)
int
error
=
1
,
create_mode
=
O_RDWR
|
O_TRUNC
,
i
;
MARIA_HA
*
info
=
NULL
;
uint
kfile_size_before_extension
,
keystart
;
DBUG_ENTER
(
"exec_REDO_LOGREC_REDO_CREATE_TABLE"
);
if
(
skip_DDLs
)
{
tprint
(
tracef
,
"we skip DDLs
\n
"
);
return
0
;
DBUG_RETURN
(
0
)
;
}
enlarge_buffer
(
rec
);
if
(
log_record_buffer
.
str
==
NULL
||
...
...
@@ -810,6 +855,8 @@ prototype_redo_exec_hook(REDO_CREATE_TABLE)
name
);
goto
end
;
}
if
(
create_database_if_not_exists
(
name
))
goto
end
;
fn_format
(
filename
,
name
,
""
,
MARIA_NAME_IEXT
,
(
MY_UNPACK_FILENAME
|
(
flags
&
HA_DONT_TOUCH_DATA
)
?
MY_RETURN_REAL_PATH
:
0
)
|
...
...
@@ -863,7 +910,7 @@ end:
error
|=
my_close
(
kfile
,
MYF
(
MY_WME
));
if
(
info
!=
NULL
)
error
|=
maria_close
(
info
);
return
error
;
DBUG_RETURN
(
error
)
;
}
...
...
@@ -872,10 +919,12 @@ prototype_redo_exec_hook(REDO_RENAME_TABLE)
char
*
old_name
,
*
new_name
;
int
error
=
1
;
MARIA_HA
*
info
=
NULL
;
DBUG_ENTER
(
"exec_REDO_LOGREC_REDO_RENAME_TABLE"
);
if
(
skip_DDLs
)
{
tprint
(
tracef
,
"we skip DDLs
\n
"
);
return
0
;
DBUG_RETURN
(
0
)
;
}
enlarge_buffer
(
rec
);
if
(
log_record_buffer
.
str
==
NULL
||
...
...
@@ -1050,7 +1099,7 @@ end:
tprint
(
tracef
,
"
\n
"
);
if
(
info
!=
NULL
)
error
|=
maria_close
(
info
);
return
error
;
DBUG_RETURN
(
error
)
;
}
...
...
@@ -1252,6 +1301,7 @@ static int new_table(uint16 sid, const char *name, LSN lsn_of_file_id)
MARIA_HA
*
info
;
MARIA_SHARE
*
share
;
my_off_t
dfile_len
,
kfile_len
;
DBUG_ENTER
(
"new_table"
);
checkpoint_useful
=
TRUE
;
if
((
name
==
NULL
)
||
(
name
[
0
]
==
0
))
...
...
@@ -1288,6 +1338,12 @@ static int new_table(uint16 sid, const char *name, LSN lsn_of_file_id)
*/
if
(
close_one_table
(
share
->
open_file_name
.
str
,
lsn_of_file_id
))
goto
end
;
/*
We should not try to get length of data/index files as the files
are not on disk yet.
*/
_ma_tmp_disable_logging_for_table
(
info
,
FALSE
);
goto
set_lsn_of_file_id
;
}
if
(
!
share
->
base
.
born_transactional
)
{
...
...
@@ -1356,6 +1412,8 @@ static int new_table(uint16 sid, const char *name, LSN lsn_of_file_id)
/* Recovery will fix this, no error */
ALERT_USER
();
}
set_lsn_of_file_id:
/*
This LSN serves in this situation; assume log is:
FILE_ID(6->"t2") REDO_INSERT(6) FILE_ID(6->"t1") CHECKPOINT(6->"t1")
...
...
@@ -1383,7 +1441,7 @@ end:
if
(
error
==
-
1
)
error
=
0
;
}
return
error
;
DBUG_RETURN
(
error
)
;
}
/*
...
...
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