summaryrefslogtreecommitdiff
path: root/sql/log_event.cc
diff options
context:
space:
mode:
authorHe Zhenxing <zhenxing.he@sun.com>2009-05-31 17:15:35 +0800
committerHe Zhenxing <zhenxing.he@sun.com>2009-05-31 17:15:35 +0800
commite14191885f292b93bd1a8204ac84c402931bdd18 (patch)
tree1bd4923e71cde548ab559bf934eca7955bc635b7 /sql/log_event.cc
parente1fb88f2cc6ac8350319a5c88810779573f381b3 (diff)
parentabf5f8dac2a0840687dc99816cbd68fb8c515e50 (diff)
downloadmariadb-git-e14191885f292b93bd1a8204ac84c402931bdd18.tar.gz
Merge BUG#41948
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r--sql/log_event.cc34
1 files changed, 8 insertions, 26 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 2d4a5c3a98d..ac34bcea577 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -2316,19 +2316,16 @@ Query_log_event::Query_log_event()
query_length - size of the `query_arg' array
using_trans - there is a modified transactional table
suppress_use - suppress the generation of 'USE' statements
- killed_status_arg - an optional with default to THD::KILLED_NO_VALUE
- if the value is different from the default, the arg
- is set to the current thd->killed value.
- A caller might need to masquerade thd->killed with
- THD::NOT_KILLED.
+ errcode - the error code of the query
+
DESCRIPTION
Creates an event for binlogging
- The value for local `killed_status' can be supplied by caller.
+ The value for `errcode' should be supplied by caller.
*/
Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg,
ulong query_length, bool using_trans,
- bool suppress_use,
- THD::killed_state killed_status_arg)
+ bool suppress_use, int errcode)
+
:Log_event(thd_arg,
(thd_arg->thread_specific_used ? LOG_EVENT_THREAD_SPECIFIC_F :
0) |
@@ -2349,22 +2346,7 @@ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg,
{
time_t end_time;
- if (killed_status_arg == THD::KILLED_NO_VALUE)
- killed_status_arg= thd_arg->killed;
- error_code=
- (killed_status_arg == THD::NOT_KILLED) ?
- (thd_arg->is_error() ? thd_arg->main_da.sql_errno() : 0) :
- ((thd_arg->system_thread & SYSTEM_THREAD_DELAYED_INSERT) ? 0 :
- thd_arg->killed_errno());
-
- /* thd_arg->main_da.sql_errno() might be ER_SERVER_SHUTDOWN or
- ER_QUERY_INTERRUPTED, So here we need to make sure that
- error_code is not set to these errors when specified NOT_KILLED
- by the caller
- */
- if ((killed_status_arg == THD::NOT_KILLED) &&
- (error_code == ER_SERVER_SHUTDOWN || error_code == ER_QUERY_INTERRUPTED))
- error_code= 0;
+ error_code= errcode;
time(&end_time);
exec_time = (ulong) (end_time - thd_arg->start_time);
@@ -6622,9 +6604,9 @@ Execute_load_query_log_event(THD *thd_arg, const char* query_arg,
uint fn_pos_end_arg,
enum_load_dup_handling dup_handling_arg,
bool using_trans, bool suppress_use,
- THD::killed_state killed_err_arg):
+ int errcode):
Query_log_event(thd_arg, query_arg, query_length_arg, using_trans,
- suppress_use, killed_err_arg),
+ suppress_use, errcode),
file_id(thd_arg->file_id), fn_pos_start(fn_pos_start_arg),
fn_pos_end(fn_pos_end_arg), dup_handling(dup_handling_arg)
{