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
188b0b99
Commit
188b0b99
authored
Oct 12, 2020
by
Monty
Committed by
Sergei Golubchik
May 19, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename all external ddl_log function to start with ddl_log_ prefix
Rename deactivate_ddl_log_entry to ddl_log_increment_phase
parent
02b6cef4
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
95 additions
and
95 deletions
+95
-95
libmysqld/lib_sql.cc
libmysqld/lib_sql.cc
+1
-1
sql/ddl_log.cc
sql/ddl_log.cc
+44
-44
sql/ddl_log.h
sql/ddl_log.h
+8
-8
sql/ha_partition.cc
sql/ha_partition.cc
+13
-13
sql/mysqld.cc
sql/mysqld.cc
+3
-3
sql/sql_partition.cc
sql/sql_partition.cc
+13
-13
sql/sql_partition_admin.cc
sql/sql_partition_admin.cc
+9
-9
sql/sql_table.cc
sql/sql_table.cc
+4
-4
No files found.
libmysqld/lib_sql.cc
View file @
188b0b99
...
...
@@ -641,7 +641,7 @@ int init_embedded_server(int argc, char **argv, char **groups)
}
}
execute_ddl_log
_recovery
();
ddl_log_execute
_recovery
();
mysql_embedded_init
=
1
;
return
0
;
}
...
...
sql/ddl_log.cc
View file @
188b0b99
...
...
@@ -146,9 +146,9 @@ static bool write_ddl_log_file_entry(uint entry_no)
*/
static
bool
sync_ddl_log
_file
()
static
bool
ddl_log_sync
_file
()
{
DBUG_ENTER
(
"
sync_ddl_log
_file"
);
DBUG_ENTER
(
"
ddl_log_sync
_file"
);
DBUG_RETURN
(
mysql_file_sync
(
global_ddl_log
.
file_id
,
MYF
(
MY_WME
)));
}
...
...
@@ -179,7 +179,7 @@ static bool write_ddl_log_header()
sql_print_error
(
"Error writing ddl log header"
);
DBUG_RETURN
(
TRUE
);
}
DBUG_RETURN
(
sync_ddl_log
_file
());
DBUG_RETURN
(
ddl_log_sync
_file
());
}
...
...
@@ -408,9 +408,9 @@ static bool init_ddl_log()
@retval FALSE Success
*/
static
bool
sync_ddl_log
_no_lock
()
static
bool
ddl_log_sync
_no_lock
()
{
DBUG_ENTER
(
"
sync_ddl_log
_no_lock"
);
DBUG_ENTER
(
"
ddl_log_sync
_no_lock"
);
mysql_mutex_assert_owner
(
&
LOCK_gdl
);
if
((
!
global_ddl_log
.
recovery_phase
)
&&
...
...
@@ -418,7 +418,7 @@ static bool sync_ddl_log_no_lock()
{
DBUG_RETURN
(
TRUE
);
}
DBUG_RETURN
(
sync_ddl_log
_file
());
DBUG_RETURN
(
ddl_log_sync
_file
());
}
...
...
@@ -449,10 +449,10 @@ static bool sync_ddl_log_no_lock()
@retval FALSE Success
*/
static
bool
d
eactivate_ddl_log_entry
_no_lock
(
uint
entry_no
)
static
bool
d
dl_log_increment_phase
_no_lock
(
uint
entry_no
)
{
uchar
*
file_entry_buf
=
(
uchar
*
)
global_ddl_log
.
file_entry_buf
;
DBUG_ENTER
(
"d
eactivate_ddl_log_entry
_no_lock"
);
DBUG_ENTER
(
"d
dl_log_increment_phase
_no_lock"
);
mysql_mutex_assert_owner
(
&
LOCK_gdl
);
if
(
!
read_ddl_log_file_entry
(
entry_no
))
...
...
@@ -585,9 +585,9 @@ static int execute_ddl_log_action(THD *thd, DDL_LOG_ENTRY *ddl_log_entry)
break
;
}
}
if
((
d
eactivate_ddl_log_entry
_no_lock
(
ddl_log_entry
->
entry_pos
)))
if
((
d
dl_log_increment_phase
_no_lock
(
ddl_log_entry
->
entry_pos
)))
break
;
(
void
)
sync_ddl_log
_no_lock
();
(
void
)
ddl_log_sync
_no_lock
();
error
=
0
;
if
(
ddl_log_entry
->
action_type
==
DDL_LOG_DELETE_ACTION
)
break
;
...
...
@@ -621,9 +621,9 @@ static int execute_ddl_log_action(THD *thd, DDL_LOG_ENTRY *ddl_log_entry)
ddl_log_entry
->
name
))
break
;
}
if
((
d
eactivate_ddl_log_entry
_no_lock
(
ddl_log_entry
->
entry_pos
)))
if
((
d
dl_log_increment_phase
_no_lock
(
ddl_log_entry
->
entry_pos
)))
break
;
(
void
)
sync_ddl_log
_no_lock
();
(
void
)
ddl_log_sync
_no_lock
();
error
=
FALSE
;
break
;
}
...
...
@@ -646,7 +646,7 @@ static int execute_ddl_log_action(THD *thd, DDL_LOG_ENTRY *ddl_log_entry)
file_entry_buf
[
DDL_LOG_PHASE_POS
]
--
;
if
(
write_ddl_log_file_entry
(
ddl_log_entry
->
entry_pos
))
break
;
if
(
sync_ddl_log
_no_lock
())
if
(
ddl_log_sync
_no_lock
())
break
;
/* fall through */
case
EXCH_PHASE_FROM_TO_NAME
:
...
...
@@ -657,7 +657,7 @@ static int execute_ddl_log_action(THD *thd, DDL_LOG_ENTRY *ddl_log_entry)
file_entry_buf
[
DDL_LOG_PHASE_POS
]
--
;
if
(
write_ddl_log_file_entry
(
ddl_log_entry
->
entry_pos
))
break
;
if
(
sync_ddl_log
_no_lock
())
if
(
ddl_log_sync
_no_lock
())
break
;
/* fall through */
case
EXCH_PHASE_NAME_TO_TEMP
:
...
...
@@ -668,7 +668,7 @@ static int execute_ddl_log_action(THD *thd, DDL_LOG_ENTRY *ddl_log_entry)
file_entry_buf
[
DDL_LOG_ENTRY_TYPE_POS
]
=
DDL_IGNORE_LOG_ENTRY_CODE
;
if
(
write_ddl_log_file_entry
(
ddl_log_entry
->
entry_pos
))
break
;
if
(
sync_ddl_log
_no_lock
())
if
(
ddl_log_sync
_no_lock
())
break
;
error
=
FALSE
;
break
;
...
...
@@ -752,11 +752,11 @@ static bool get_free_ddl_log_entry(DDL_LOG_MEMORY_ENTRY **active_entry,
@retval FALSE Success
*/
static
bool
execute_ddl_log
_entry_no_lock
(
THD
*
thd
,
uint
first_entry
)
static
bool
ddl_log_execute
_entry_no_lock
(
THD
*
thd
,
uint
first_entry
)
{
DDL_LOG_ENTRY
ddl_log_entry
;
uint
read_entry
=
first_entry
;
DBUG_ENTER
(
"
execute_ddl_log
_entry_no_lock"
);
DBUG_ENTER
(
"
ddl_log_execute
_entry_no_lock"
);
mysql_mutex_assert_owner
(
&
LOCK_gdl
);
do
...
...
@@ -803,11 +803,11 @@ static bool execute_ddl_log_entry_no_lock(THD *thd, uint first_entry)
@retval FALSE Success
*/
bool
write_ddl_log
_entry
(
DDL_LOG_ENTRY
*
ddl_log_entry
,
bool
ddl_log_write
_entry
(
DDL_LOG_ENTRY
*
ddl_log_entry
,
DDL_LOG_MEMORY_ENTRY
**
active_entry
)
{
bool
error
,
write_header
;
DBUG_ENTER
(
"
write_ddl_log
_entry"
);
DBUG_ENTER
(
"
ddl_log_write
_entry"
);
mysql_mutex_assert_owner
(
&
LOCK_gdl
);
if
(
init_ddl_log
())
...
...
@@ -840,12 +840,12 @@ bool write_ddl_log_entry(DDL_LOG_ENTRY *ddl_log_entry,
}
if
(
write_header
&&
likely
(
!
error
))
{
(
void
)
sync_ddl_log
_no_lock
();
(
void
)
ddl_log_sync
_no_lock
();
if
(
write_ddl_log_header
())
error
=
TRUE
;
}
if
(
unlikely
(
error
))
release_ddl_log
_memory_entry
(
*
active_entry
);
ddl_log_release
_memory_entry
(
*
active_entry
);
DBUG_RETURN
(
error
);
}
...
...
@@ -876,13 +876,13 @@ bool write_ddl_log_entry(DDL_LOG_ENTRY *ddl_log_entry,
@retval FALSE Success
*/
bool
write_execute_ddl_log
_entry
(
uint
first_entry
,
bool
ddl_log_write_execute
_entry
(
uint
first_entry
,
bool
complete
,
DDL_LOG_MEMORY_ENTRY
**
active_entry
)
{
bool
write_header
=
FALSE
;
char
*
file_entry_buf
=
(
char
*
)
global_ddl_log
.
file_entry_buf
;
DBUG_ENTER
(
"
write_execute_ddl_log
_entry"
);
DBUG_ENTER
(
"
ddl_log_write_execute
_entry"
);
mysql_mutex_assert_owner
(
&
LOCK_gdl
);
if
(
init_ddl_log
())
...
...
@@ -897,7 +897,7 @@ bool write_execute_ddl_log_entry(uint first_entry,
any log entries before, we are only here to write the execute
entry to indicate it is done.
*/
(
void
)
sync_ddl_log
_no_lock
();
(
void
)
ddl_log_sync
_no_lock
();
file_entry_buf
[
DDL_LOG_ENTRY_TYPE_POS
]
=
(
char
)
DDL_LOG_EXECUTE_CODE
;
}
else
...
...
@@ -919,15 +919,15 @@ bool write_execute_ddl_log_entry(uint first_entry,
if
(
write_ddl_log_file_entry
((
*
active_entry
)
->
entry_pos
))
{
sql_print_error
(
"Error writing execute entry in ddl log"
);
release_ddl_log
_memory_entry
(
*
active_entry
);
ddl_log_release
_memory_entry
(
*
active_entry
);
DBUG_RETURN
(
TRUE
);
}
(
void
)
sync_ddl_log
_no_lock
();
(
void
)
ddl_log_sync
_no_lock
();
if
(
write_header
)
{
if
(
write_ddl_log_header
())
{
release_ddl_log
_memory_entry
(
*
active_entry
);
ddl_log_release
_memory_entry
(
*
active_entry
);
DBUG_RETURN
(
TRUE
);
}
}
...
...
@@ -938,7 +938,7 @@ bool write_execute_ddl_log_entry(uint first_entry,
/**
Deactivate an individual entry.
@details see d
eactivate_ddl_log_entry
_no_lock.
@details see d
dl_log_increment_phase
_no_lock.
@param entry_no Entry position of record to change
...
...
@@ -947,13 +947,13 @@ bool write_execute_ddl_log_entry(uint first_entry,
@retval FALSE Success
*/
bool
d
eactivate_ddl_log_entry
(
uint
entry_no
)
bool
d
dl_log_increment_phase
(
uint
entry_no
)
{
bool
error
;
DBUG_ENTER
(
"d
eactivate_ddl_log_entry
"
);
DBUG_ENTER
(
"d
dl_log_increment_phase
"
);
mysql_mutex_lock
(
&
LOCK_gdl
);
error
=
d
eactivate_ddl_log_entry
_no_lock
(
entry_no
);
error
=
d
dl_log_increment_phase
_no_lock
(
entry_no
);
mysql_mutex_unlock
(
&
LOCK_gdl
);
DBUG_RETURN
(
error
);
}
...
...
@@ -967,13 +967,13 @@ bool deactivate_ddl_log_entry(uint entry_no)
@retval FALSE Success
*/
bool
sync_ddl_log
()
bool
ddl_log_sync
()
{
bool
error
;
DBUG_ENTER
(
"
sync_ddl_log
"
);
DBUG_ENTER
(
"
ddl_log_sync
"
);
mysql_mutex_lock
(
&
LOCK_gdl
);
error
=
sync_ddl_log
_no_lock
();
error
=
ddl_log_sync
_no_lock
();
mysql_mutex_unlock
(
&
LOCK_gdl
);
DBUG_RETURN
(
error
);
...
...
@@ -985,12 +985,12 @@ bool sync_ddl_log()
@param log_memory_entry Log memory entry to release
*/
void
release_ddl_log
_memory_entry
(
DDL_LOG_MEMORY_ENTRY
*
log_entry
)
void
ddl_log_release
_memory_entry
(
DDL_LOG_MEMORY_ENTRY
*
log_entry
)
{
DDL_LOG_MEMORY_ENTRY
*
first_free
=
global_ddl_log
.
first_free
;
DDL_LOG_MEMORY_ENTRY
*
next_log_entry
=
log_entry
->
next_log_entry
;
DDL_LOG_MEMORY_ENTRY
*
prev_log_entry
=
log_entry
->
prev_log_entry
;
DBUG_ENTER
(
"
release_ddl_log
_memory_entry"
);
DBUG_ENTER
(
"
ddl_log_release
_memory_entry"
);
mysql_mutex_assert_owner
(
&
LOCK_gdl
);
global_ddl_log
.
first_free
=
log_entry
;
...
...
@@ -1018,13 +1018,13 @@ void release_ddl_log_memory_entry(DDL_LOG_MEMORY_ENTRY *log_entry)
@retval FALSE Success
*/
bool
execute_ddl_log
_entry
(
THD
*
thd
,
uint
first_entry
)
bool
ddl_log_execute
_entry
(
THD
*
thd
,
uint
first_entry
)
{
bool
error
;
DBUG_ENTER
(
"
execute_ddl_log
_entry"
);
DBUG_ENTER
(
"
ddl_log_execute
_entry"
);
mysql_mutex_lock
(
&
LOCK_gdl
);
error
=
execute_ddl_log
_entry_no_lock
(
thd
,
first_entry
);
error
=
ddl_log_execute
_entry_no_lock
(
thd
,
first_entry
);
mysql_mutex_unlock
(
&
LOCK_gdl
);
DBUG_RETURN
(
error
);
}
...
...
@@ -1050,14 +1050,14 @@ static void close_ddl_log()
Execute the ddl log at recovery of MySQL Server.
*/
void
execute_ddl_log
_recovery
()
void
ddl_log_execute
_recovery
()
{
uint
num_entries
,
i
;
THD
*
thd
,
*
original_thd
;
DDL_LOG_ENTRY
ddl_log_entry
;
char
file_name
[
FN_REFLEN
];
static
char
recover_query_string
[]
=
"INTERNAL DDL LOG RECOVER IN PROGRESS"
;
DBUG_ENTER
(
"
execute_ddl_log
_recovery"
);
DBUG_ENTER
(
"
ddl_log_execute
_recovery"
);
/*
Initialise global_ddl_log struct
...
...
@@ -1092,7 +1092,7 @@ void execute_ddl_log_recovery()
}
if
(
ddl_log_entry
.
entry_type
==
DDL_LOG_EXECUTE_CODE
)
{
if
(
execute_ddl_log
_entry_no_lock
(
thd
,
ddl_log_entry
.
next_entry
))
if
(
ddl_log_execute
_entry_no_lock
(
thd
,
ddl_log_entry
.
next_entry
))
{
/* Real unpleasant scenario but we continue anyways. */
continue
;
...
...
@@ -1115,11 +1115,11 @@ void execute_ddl_log_recovery()
Release all memory allocated to the ddl log.
*/
void
release_ddl_log
()
void
ddl_log_release
()
{
DDL_LOG_MEMORY_ENTRY
*
free_list
;
DDL_LOG_MEMORY_ENTRY
*
used_list
;
DBUG_ENTER
(
"
release_ddl_log
"
);
DBUG_ENTER
(
"
ddl_log_release
"
);
if
(
!
global_ddl_log
.
do_release
)
DBUG_VOID_RETURN
;
...
...
sql/ddl_log.h
View file @
188b0b99
...
...
@@ -95,17 +95,17 @@ typedef struct st_ddl_log_memory_entry
}
DDL_LOG_MEMORY_ENTRY
;
bool
write_ddl_log
_entry
(
DDL_LOG_ENTRY
*
ddl_log_entry
,
bool
ddl_log_write
_entry
(
DDL_LOG_ENTRY
*
ddl_log_entry
,
DDL_LOG_MEMORY_ENTRY
**
active_entry
);
bool
write_execute_ddl_log
_entry
(
uint
first_entry
,
bool
ddl_log_write_execute
_entry
(
uint
first_entry
,
bool
complete
,
DDL_LOG_MEMORY_ENTRY
**
active_entry
);
bool
d
eactivate_ddl_log_entry
(
uint
entry_no
);
void
release_ddl_log
_memory_entry
(
DDL_LOG_MEMORY_ENTRY
*
log_entry
);
bool
sync_ddl_log
();
void
release_ddl_log
();
void
execute_ddl_log
_recovery
();
bool
execute_ddl_log
_entry
(
THD
*
thd
,
uint
first_entry
);
bool
d
dl_log_increment_phase
(
uint
entry_no
);
void
ddl_log_release
_memory_entry
(
DDL_LOG_MEMORY_ENTRY
*
log_entry
);
bool
ddl_log_sync
();
void
ddl_log_release
();
void
ddl_log_execute
_recovery
();
bool
ddl_log_execute
_entry
(
THD
*
thd
,
uint
first_entry
);
extern
mysql_mutex_t
LOCK_gdl
;
#endif
/* DDL_LOG_INCLUDED */
sql/ha_partition.cc
View file @
188b0b99
...
...
@@ -914,7 +914,7 @@ int ha_partition::drop_partitions(const char *path)
DBUG_PRINT
(
"info"
,
(
"Drop subpartition %s"
,
part_name_buff
));
if
(
unlikely
((
ret_error
=
file
->
delete_table
(
part_name_buff
))))
error
=
ret_error
;
if
(
unlikely
(
d
eactivate_ddl_log_entry
(
sub_elem
->
log_entry
->
if
(
unlikely
(
d
dl_log_increment_phase
(
sub_elem
->
log_entry
->
entry_pos
)))
error
=
1
;
}
while
(
++
j
<
num_subparts
);
...
...
@@ -931,7 +931,7 @@ int ha_partition::drop_partitions(const char *path)
DBUG_PRINT
(
"info"
,
(
"Drop partition %s"
,
part_name_buff
));
if
(
unlikely
((
ret_error
=
file
->
delete_table
(
part_name_buff
))))
error
=
ret_error
;
if
(
unlikely
(
d
eactivate_ddl_log_entry
(
part_elem
->
log_entry
->
if
(
unlikely
(
d
dl_log_increment_phase
(
part_elem
->
log_entry
->
entry_pos
)))
error
=
1
;
}
...
...
@@ -942,7 +942,7 @@ int ha_partition::drop_partitions(const char *path)
part_elem
->
part_state
=
PART_IS_DROPPED
;
}
}
while
(
++
i
<
num_parts
);
(
void
)
sync_ddl_log
();
(
void
)
ddl_log_sync
();
DBUG_RETURN
(
error
);
}
...
...
@@ -1023,7 +1023,7 @@ int ha_partition::rename_partitions(const char *path)
DBUG_PRINT
(
"info"
,
(
"Delete subpartition %s"
,
norm_name_buff
));
if
(
unlikely
((
ret_error
=
file
->
delete_table
(
norm_name_buff
))))
error
=
ret_error
;
else
if
(
unlikely
(
d
eactivate_ddl_log_entry
(
sub_elem
->
log_entry
->
else
if
(
unlikely
(
d
dl_log_increment_phase
(
sub_elem
->
log_entry
->
entry_pos
)))
error
=
1
;
else
...
...
@@ -1044,7 +1044,7 @@ int ha_partition::rename_partitions(const char *path)
DBUG_PRINT
(
"info"
,
(
"Delete partition %s"
,
norm_name_buff
));
if
(
unlikely
((
ret_error
=
file
->
delete_table
(
norm_name_buff
))))
error
=
ret_error
;
else
if
(
unlikely
(
d
eactivate_ddl_log_entry
(
part_elem
->
log_entry
->
else
if
(
unlikely
(
d
dl_log_increment_phase
(
part_elem
->
log_entry
->
entry_pos
)))
error
=
1
;
else
...
...
@@ -1052,7 +1052,7 @@ int ha_partition::rename_partitions(const char *path)
}
}
}
while
(
++
i
<
temp_partitions
);
(
void
)
sync_ddl_log
();
(
void
)
ddl_log_sync
();
}
i
=
0
;
do
...
...
@@ -1105,10 +1105,10 @@ int ha_partition::rename_partitions(const char *path)
DBUG_PRINT
(
"info"
,
(
"Delete subpartition %s"
,
norm_name_buff
));
if
(
unlikely
((
ret_error
=
file
->
delete_table
(
norm_name_buff
))))
error
=
ret_error
;
else
if
(
unlikely
(
d
eactivate_ddl_log_entry
(
sub_elem
->
log_entry
->
else
if
(
unlikely
(
d
dl_log_increment_phase
(
sub_elem
->
log_entry
->
entry_pos
)))
error
=
1
;
(
void
)
sync_ddl_log
();
(
void
)
ddl_log_sync
();
}
file
=
m_new_file
[
part
];
if
(
unlikely
((
ret_error
=
...
...
@@ -1123,7 +1123,7 @@ int ha_partition::rename_partitions(const char *path)
if
(
unlikely
((
ret_error
=
file
->
ha_rename_table
(
part_name_buff
,
norm_name_buff
))))
error
=
ret_error
;
else
if
(
unlikely
(
d
eactivate_ddl_log_entry
(
sub_elem
->
log_entry
->
else
if
(
unlikely
(
d
dl_log_increment_phase
(
sub_elem
->
log_entry
->
entry_pos
)))
error
=
1
;
else
...
...
@@ -1152,10 +1152,10 @@ int ha_partition::rename_partitions(const char *path)
DBUG_PRINT
(
"info"
,
(
"Delete partition %s"
,
norm_name_buff
));
if
(
unlikely
((
ret_error
=
file
->
delete_table
(
norm_name_buff
))))
error
=
ret_error
;
else
if
(
unlikely
(
d
eactivate_ddl_log_entry
(
part_elem
->
log_entry
->
else
if
(
unlikely
(
d
dl_log_increment_phase
(
part_elem
->
log_entry
->
entry_pos
)))
error
=
1
;
(
void
)
sync_ddl_log
();
(
void
)
ddl_log_sync
();
}
file
=
m_new_file
[
i
];
DBUG_PRINT
(
"info"
,
(
"Rename partition from %s to %s"
,
...
...
@@ -1163,7 +1163,7 @@ int ha_partition::rename_partitions(const char *path)
if
(
unlikely
((
ret_error
=
file
->
ha_rename_table
(
part_name_buff
,
norm_name_buff
))))
error
=
ret_error
;
else
if
(
unlikely
(
d
eactivate_ddl_log_entry
(
part_elem
->
log_entry
->
else
if
(
unlikely
(
d
dl_log_increment_phase
(
part_elem
->
log_entry
->
entry_pos
)))
error
=
1
;
else
...
...
@@ -1172,7 +1172,7 @@ int ha_partition::rename_partitions(const char *path)
}
}
}
while
(
++
i
<
num_parts
);
(
void
)
sync_ddl_log
();
(
void
)
ddl_log_sync
();
DBUG_RETURN
(
error
);
}
...
...
sql/mysqld.cc
View file @
188b0b99
...
...
@@ -30,7 +30,7 @@
#include "parse_file.h" // File_parser_dummy_hook
#include "sql_db.h" // my_dboptions_cache_free
// my_dboptions_cache_init
#include "sql_table.h" //
release_ddl_log, execute_ddl_log
_recovery
#include "sql_table.h" //
ddl_log_release, ddl_log_execute
_recovery
#include "sql_connect.h" // free_max_user_conn, init_max_user_conn,
// handle_one_connection
#include "thread_cache.h"
...
...
@@ -1890,7 +1890,7 @@ static void clean_up(bool print_message)
my_bitmap_free
(
&
slave_error_mask
);
#endif
stop_handle_manager
();
release_ddl_log
();
ddl_log_release
();
logger
.
cleanup_base
();
...
...
@@ -5680,7 +5680,7 @@ int mysqld_main(int argc, char **argv)
initialize_information_schema_acl
();
execute_ddl_log
_recovery
();
ddl_log_execute
_recovery
();
/*
Change EVENTS_ORIGINAL to EVENTS_OFF (the default value) as there is no
...
...
sql/sql_partition.cc
View file @
188b0b99
...
...
@@ -6168,7 +6168,7 @@ static void release_part_info_log_entries(DDL_LOG_MEMORY_ENTRY *log_entry)
while
(
log_entry
)
{
release_ddl_log
_memory_entry
(
log_entry
);
ddl_log_release
_memory_entry
(
log_entry
);
log_entry
=
log_entry
->
next_active_log_entry
;
}
DBUG_VOID_RETURN
;
...
...
@@ -6212,7 +6212,7 @@ static bool write_log_replace_delete_frm(ALTER_PARTITION_PARAM_TYPE *lpt,
ddl_log_entry
.
name
=
to_path
;
if
(
replace_flag
)
ddl_log_entry
.
from_name
=
from_path
;
if
(
write_ddl_log
_entry
(
&
ddl_log_entry
,
&
log_entry
))
if
(
ddl_log_write
_entry
(
&
ddl_log_entry
,
&
log_entry
))
{
DBUG_RETURN
(
TRUE
);
}
...
...
@@ -6289,7 +6289,7 @@ static bool write_log_changed_partitions(ALTER_PARTITION_PARAM_TYPE *lpt,
ddl_log_entry
.
action_type
=
DDL_LOG_REPLACE_ACTION
;
else
ddl_log_entry
.
action_type
=
DDL_LOG_RENAME_ACTION
;
if
(
write_ddl_log
_entry
(
&
ddl_log_entry
,
&
log_entry
))
if
(
ddl_log_write
_entry
(
&
ddl_log_entry
,
&
log_entry
))
{
DBUG_RETURN
(
TRUE
);
}
...
...
@@ -6316,7 +6316,7 @@ static bool write_log_changed_partitions(ALTER_PARTITION_PARAM_TYPE *lpt,
ddl_log_entry
.
action_type
=
DDL_LOG_REPLACE_ACTION
;
else
ddl_log_entry
.
action_type
=
DDL_LOG_RENAME_ACTION
;
if
(
write_ddl_log
_entry
(
&
ddl_log_entry
,
&
log_entry
))
if
(
ddl_log_write
_entry
(
&
ddl_log_entry
,
&
log_entry
))
{
DBUG_RETURN
(
TRUE
);
}
...
...
@@ -6392,7 +6392,7 @@ static bool write_log_dropped_partitions(ALTER_PARTITION_PARAM_TYPE *lpt,
sub_elem
->
partition_name
,
name_variant
))
DBUG_RETURN
(
TRUE
);
ddl_log_entry
.
name
=
tmp_path
;
if
(
write_ddl_log
_entry
(
&
ddl_log_entry
,
&
log_entry
))
if
(
ddl_log_write
_entry
(
&
ddl_log_entry
,
&
log_entry
))
{
DBUG_RETURN
(
TRUE
);
}
...
...
@@ -6411,7 +6411,7 @@ static bool write_log_dropped_partitions(ALTER_PARTITION_PARAM_TYPE *lpt,
TRUE
))
DBUG_RETURN
(
TRUE
);
ddl_log_entry
.
name
=
tmp_path
;
if
(
write_ddl_log
_entry
(
&
ddl_log_entry
,
&
log_entry
))
if
(
ddl_log_write
_entry
(
&
ddl_log_entry
,
&
log_entry
))
{
DBUG_RETURN
(
TRUE
);
}
...
...
@@ -6473,7 +6473,7 @@ static bool write_log_drop_shadow_frm(ALTER_PARTITION_PARAM_TYPE *lpt)
(
const
char
*
)
shadow_path
,
FALSE
))
goto
error
;
log_entry
=
part_info
->
first_log_entry
;
if
(
write_execute_ddl_log
_entry
(
log_entry
->
entry_pos
,
if
(
ddl_log_write_execute
_entry
(
log_entry
->
entry_pos
,
FALSE
,
&
exec_log_entry
))
goto
error
;
mysql_mutex_unlock
(
&
LOCK_gdl
);
...
...
@@ -6520,7 +6520,7 @@ static bool write_log_rename_frm(ALTER_PARTITION_PARAM_TYPE *lpt)
goto
error
;
log_entry
=
part_info
->
first_log_entry
;
part_info
->
frm_log_entry
=
log_entry
;
if
(
write_execute_ddl_log
_entry
(
log_entry
->
entry_pos
,
if
(
ddl_log_write_execute
_entry
(
log_entry
->
entry_pos
,
FALSE
,
&
exec_log_entry
))
goto
error
;
release_part_info_log_entries
(
old_first_log_entry
);
...
...
@@ -6575,7 +6575,7 @@ static bool write_log_drop_partition(ALTER_PARTITION_PARAM_TYPE *lpt)
goto
error
;
log_entry
=
part_info
->
first_log_entry
;
part_info
->
frm_log_entry
=
log_entry
;
if
(
write_execute_ddl_log
_entry
(
log_entry
->
entry_pos
,
if
(
ddl_log_write_execute
_entry
(
log_entry
->
entry_pos
,
FALSE
,
&
exec_log_entry
))
goto
error
;
release_part_info_log_entries
(
old_first_log_entry
);
...
...
@@ -6634,7 +6634,7 @@ static bool write_log_add_change_partition(ALTER_PARTITION_PARAM_TYPE *lpt)
goto
error
;
log_entry
=
part_info
->
first_log_entry
;
if
(
write_execute_ddl_log
_entry
(
log_entry
->
entry_pos
,
if
(
ddl_log_write_execute
_entry
(
log_entry
->
entry_pos
,
FALSE
,
/* Reuse the old execute ddl_log_entry */
&
exec_log_entry
))
...
...
@@ -6704,7 +6704,7 @@ static bool write_log_final_change_partition(ALTER_PARTITION_PARAM_TYPE *lpt)
log_entry
=
part_info
->
first_log_entry
;
part_info
->
frm_log_entry
=
log_entry
;
/* Overwrite the revert execute log entry with this retry execute entry */
if
(
write_execute_ddl_log
_entry
(
log_entry
->
entry_pos
,
if
(
ddl_log_write_execute
_entry
(
log_entry
->
entry_pos
,
FALSE
,
&
exec_log_entry
))
goto
error
;
release_part_info_log_entries
(
old_first_log_entry
);
...
...
@@ -6741,7 +6741,7 @@ static void write_log_completed(ALTER_PARTITION_PARAM_TYPE *lpt,
DBUG_ASSERT
(
log_entry
);
mysql_mutex_lock
(
&
LOCK_gdl
);
if
(
write_execute_ddl_log
_entry
(
0UL
,
TRUE
,
&
log_entry
))
if
(
ddl_log_write_execute
_entry
(
0UL
,
TRUE
,
&
log_entry
))
{
/*
Failed to write, Bad...
...
...
@@ -6891,7 +6891,7 @@ static void handle_alter_part_error(ALTER_PARTITION_PARAM_TYPE *lpt,
}
if
(
part_info
->
first_log_entry
&&
execute_ddl_log
_entry
(
thd
,
part_info
->
first_log_entry
->
entry_pos
))
ddl_log_execute
_entry
(
thd
,
part_info
->
first_log_entry
->
entry_pos
))
{
/*
We couldn't recover from error, most likely manual interaction
...
...
sql/sql_partition_admin.cc
View file @
188b0b99
...
...
@@ -372,12 +372,12 @@ static bool exchange_name_with_ddl_log(THD *thd,
*/
DBUG_EXECUTE_IF
(
"exchange_partition_fail_1"
,
goto
err_no_action_written
;);
DBUG_EXECUTE_IF
(
"exchange_partition_abort_1"
,
DBUG_SUICIDE
(););
if
(
unlikely
(
write_ddl_log
_entry
(
&
exchange_entry
,
&
log_entry
)))
if
(
unlikely
(
ddl_log_write
_entry
(
&
exchange_entry
,
&
log_entry
)))
goto
err_no_action_written
;
DBUG_EXECUTE_IF
(
"exchange_partition_fail_2"
,
goto
err_no_execute_written
;);
DBUG_EXECUTE_IF
(
"exchange_partition_abort_2"
,
DBUG_SUICIDE
(););
if
(
unlikely
(
write_execute_ddl_log
_entry
(
log_entry
->
entry_pos
,
FALSE
,
if
(
unlikely
(
ddl_log_write_execute
_entry
(
log_entry
->
entry_pos
,
FALSE
,
&
exec_log_entry
)))
goto
err_no_execute_written
;
/* ddl_log is written and synced */
...
...
@@ -404,7 +404,7 @@ static bool exchange_name_with_ddl_log(THD *thd,
}
DBUG_EXECUTE_IF
(
"exchange_partition_fail_4"
,
goto
err_rename
;);
DBUG_EXECUTE_IF
(
"exchange_partition_abort_4"
,
DBUG_SUICIDE
(););
if
(
unlikely
(
d
eactivate_ddl_log_entry
(
log_entry
->
entry_pos
)))
if
(
unlikely
(
d
dl_log_increment_phase
(
log_entry
->
entry_pos
)))
goto
err_rename
;
/* call rename table from partition to table */
...
...
@@ -421,7 +421,7 @@ static bool exchange_name_with_ddl_log(THD *thd,
}
DBUG_EXECUTE_IF
(
"exchange_partition_fail_6"
,
goto
err_rename
;);
DBUG_EXECUTE_IF
(
"exchange_partition_abort_6"
,
DBUG_SUICIDE
(););
if
(
unlikely
(
d
eactivate_ddl_log_entry
(
log_entry
->
entry_pos
)))
if
(
unlikely
(
d
dl_log_increment_phase
(
log_entry
->
entry_pos
)))
goto
err_rename
;
/* call rename table from tmp-nam to partition */
...
...
@@ -438,7 +438,7 @@ static bool exchange_name_with_ddl_log(THD *thd,
}
DBUG_EXECUTE_IF
(
"exchange_partition_fail_8"
,
goto
err_rename
;);
DBUG_EXECUTE_IF
(
"exchange_partition_abort_8"
,
DBUG_SUICIDE
(););
if
(
unlikely
(
d
eactivate_ddl_log_entry
(
log_entry
->
entry_pos
)))
if
(
unlikely
(
d
dl_log_increment_phase
(
log_entry
->
entry_pos
)))
goto
err_rename
;
/* The exchange is complete and ddl_log is deactivated */
...
...
@@ -454,15 +454,15 @@ static bool exchange_name_with_ddl_log(THD *thd,
will log to the error log about the failures...
*/
/* execute the ddl log entry to revert the renames */
(
void
)
execute_ddl_log
_entry
(
current_thd
,
log_entry
->
entry_pos
);
(
void
)
ddl_log_execute
_entry
(
current_thd
,
log_entry
->
entry_pos
);
mysql_mutex_lock
(
&
LOCK_gdl
);
/* mark the execute log entry done */
(
void
)
write_execute_ddl_log
_entry
(
0
,
TRUE
,
&
exec_log_entry
);
(
void
)
ddl_log_write_execute
_entry
(
0
,
TRUE
,
&
exec_log_entry
);
/* release the execute log entry */
(
void
)
release_ddl_log
_memory_entry
(
exec_log_entry
);
(
void
)
ddl_log_release
_memory_entry
(
exec_log_entry
);
err_no_execute_written:
/* release the action log entry */
(
void
)
release_ddl_log
_memory_entry
(
log_entry
);
(
void
)
ddl_log_release
_memory_entry
(
log_entry
);
err_no_action_written:
mysql_mutex_unlock
(
&
LOCK_gdl
);
delete
file
;
...
...
sql/sql_table.cc
View file @
188b0b99
...
...
@@ -768,8 +768,8 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags)
#ifdef WITH_PARTITION_STORAGE_ENGINE
lpt
->
table
->
file
->
ha_create_partitioning_metadata
(
path
,
shadow_path
,
CHF_DELETE_FLAG
)
||
d
eactivate_ddl_log_entry
(
part_info
->
frm_log_entry
->
entry_pos
)
||
(
sync_ddl_log
(),
FALSE
)
||
d
dl_log_increment_phase
(
part_info
->
frm_log_entry
->
entry_pos
)
||
(
ddl_log_sync
(),
FALSE
)
||
mysql_file_rename
(
key_file_frm
,
shadow_frm_name
,
frm_name
,
MYF
(
MY_WME
))
||
lpt
->
table
->
file
->
ha_create_partitioning_metadata
(
path
,
shadow_path
,
...
...
@@ -816,9 +816,9 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags)
err:
#ifdef WITH_PARTITION_STORAGE_ENGINE
d
eactivate_ddl_log_entry
(
part_info
->
frm_log_entry
->
entry_pos
);
d
dl_log_increment_phase
(
part_info
->
frm_log_entry
->
entry_pos
);
part_info
->
frm_log_entry
=
NULL
;
(
void
)
sync_ddl_log
();
(
void
)
ddl_log_sync
();
#endif
;
}
...
...
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