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
7aec6cce
Commit
7aec6cce
authored
Feb 04, 2009
by
Davi Arnaut
Browse files
Options
Browse Files
Download
Plain Diff
Merge from upstream 5.1-bugteam
parents
bc03c9ef
be1b03fd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
16 deletions
+76
-16
mysql-test/suite/rpl_ndb/t/disabled.def
mysql-test/suite/rpl_ndb/t/disabled.def
+0
-3
sql/log_event.cc
sql/log_event.cc
+76
-13
No files found.
mysql-test/suite/rpl_ndb/t/disabled.def
View file @
7aec6cce
...
@@ -10,7 +10,4 @@
...
@@ -10,7 +10,4 @@
#
#
##############################################################################
##############################################################################
rpl_ndb_circular : Bug#41183 rpl_ndb_circular, rpl_ndb_circular_simplex need maintenance, crash
rpl_ndb_circular_simplex : Bug#41183 rpl_ndb_circular, rpl_ndb_circular_simplex need maintenance, crash
# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open
# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open
sql/log_event.cc
View file @
7aec6cce
...
@@ -53,6 +53,8 @@
...
@@ -53,6 +53,8 @@
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
static
int
rows_event_stmt_cleanup
(
Relay_log_info
const
*
rli
,
THD
*
thd
);
static
const
char
*
HA_ERR
(
int
i
)
static
const
char
*
HA_ERR
(
int
i
)
{
{
switch
(
i
)
{
switch
(
i
)
{
...
@@ -2894,7 +2896,37 @@ int Query_log_event::do_apply_event(Relay_log_info const *rli,
...
@@ -2894,7 +2896,37 @@ int Query_log_event::do_apply_event(Relay_log_info const *rli,
DBUG_PRINT
(
"info"
,
(
"log_pos: %lu"
,
(
ulong
)
log_pos
));
DBUG_PRINT
(
"info"
,
(
"log_pos: %lu"
,
(
ulong
)
log_pos
));
clear_all_errors
(
thd
,
const_cast
<
Relay_log_info
*>
(
rli
));
clear_all_errors
(
thd
,
const_cast
<
Relay_log_info
*>
(
rli
));
const_cast
<
Relay_log_info
*>
(
rli
)
->
clear_tables_to_lock
();
if
(
strcmp
(
"COMMIT"
,
query
)
==
0
&&
rli
->
tables_to_lock
)
{
/*
Cleaning-up the last statement context:
the terminal event of the current statement flagged with
STMT_END_F got filtered out in ndb circular replication.
*/
int
error
;
char
llbuff
[
22
];
if
((
error
=
rows_event_stmt_cleanup
(
const_cast
<
Relay_log_info
*>
(
rli
),
thd
)))
{
const_cast
<
Relay_log_info
*>
(
rli
)
->
report
(
ERROR_LEVEL
,
error
,
"Error in cleaning up after an event preceeding the commit; "
"the group log file/position: %s %s"
,
const_cast
<
Relay_log_info
*>
(
rli
)
->
group_master_log_name
,
llstr
(
const_cast
<
Relay_log_info
*>
(
rli
)
->
group_master_log_pos
,
llbuff
));
}
/*
Executing a part of rli->stmt_done() logics that does not deal
with group position change. The part is redundant now but is
future-change-proof addon, e.g if COMMIT handling will start checking
invariants like IN_STMT flag must be off at committing the transaction.
*/
const_cast
<
Relay_log_info
*>
(
rli
)
->
inc_event_relay_log_pos
();
const_cast
<
Relay_log_info
*>
(
rli
)
->
clear_flag
(
Relay_log_info
::
IN_STMT
);
}
else
{
const_cast
<
Relay_log_info
*>
(
rli
)
->
clear_tables_to_lock
();
}
/*
/*
Note: We do not need to execute reset_one_shot_variables() if this
Note: We do not need to execute reset_one_shot_variables() if this
...
@@ -7403,16 +7435,20 @@ Rows_log_event::do_shall_skip(Relay_log_info *rli)
...
@@ -7403,16 +7435,20 @@ Rows_log_event::do_shall_skip(Relay_log_info *rli)
return
Log_event
::
do_shall_skip
(
rli
);
return
Log_event
::
do_shall_skip
(
rli
);
}
}
int
/**
Rows_log_event
::
do_update_pos
(
Relay_log_info
*
rli
)
The function is called at Rows_log_event statement commit time,
{
normally from Rows_log_event::do_update_pos() and possibly from
DBUG_ENTER
(
"Rows_log_event::do_update_pos"
);
Query_log_event::do_apply_event() of the COMMIT.
int
error
=
0
;
The function commits the last statement for engines, binlog and
releases resources have been allocated for the statement.
DBUG_PRINT
(
"info"
,
(
"flags: %s"
,
get_flags
(
STMT_END_F
)
?
"STMT_END_F "
:
""
));
@retval 0 Ok.
@retval non-zero Error at the commit.
*/
if
(
get_flags
(
STMT_END_F
))
static
int
rows_event_stmt_cleanup
(
Relay_log_info
const
*
rli
,
THD
*
thd
)
{
int
error
;
{
{
/*
/*
This is the end of a statement or transaction, so close (and
This is the end of a statement or transaction, so close (and
...
@@ -7454,14 +7490,39 @@ Rows_log_event::do_update_pos(Relay_log_info *rli)
...
@@ -7454,14 +7490,39 @@ Rows_log_event::do_update_pos(Relay_log_info *rli)
thd
->
reset_current_stmt_binlog_row_based
();
thd
->
reset_current_stmt_binlog_row_based
();
rli
->
cleanup_context
(
thd
,
0
);
const_cast
<
Relay_log_info
*>
(
rli
)
->
cleanup_context
(
thd
,
0
);
if
(
error
==
0
)
}
return
error
;
}
/**
The method either increments the relay log position or
commits the current statement and increments the master group
possition if the event is STMT_END_F flagged and
the statement corresponds to the autocommit query (i.e replicated
without wrapping in BEGIN/COMMIT)
@retval 0 Success
@retval non-zero Error in the statement commit
*/
int
Rows_log_event
::
do_update_pos
(
Relay_log_info
*
rli
)
{
DBUG_ENTER
(
"Rows_log_event::do_update_pos"
);
int
error
=
0
;
DBUG_PRINT
(
"info"
,
(
"flags: %s"
,
get_flags
(
STMT_END_F
)
?
"STMT_END_F "
:
""
));
if
(
get_flags
(
STMT_END_F
))
{
if
((
error
=
rows_event_stmt_cleanup
(
rli
,
thd
))
==
0
)
{
{
/*
/*
Indicate that a statement is finished.
Indicate that a statement is finished.
Step the group log position if we are not in a transaction,
Step the group log position if we are not in a transaction,
otherwise increase the event log position.
otherwise increase the event log position.
*/
*/
rli
->
stmt_done
(
log_pos
,
when
);
rli
->
stmt_done
(
log_pos
,
when
);
/*
/*
...
@@ -7475,11 +7536,13 @@ Rows_log_event::do_update_pos(Relay_log_info *rli)
...
@@ -7475,11 +7536,13 @@ Rows_log_event::do_update_pos(Relay_log_info *rli)
thd
->
clear_error
();
thd
->
clear_error
();
}
}
else
else
{
rli
->
report
(
ERROR_LEVEL
,
error
,
rli
->
report
(
ERROR_LEVEL
,
error
,
"Error in %s event: commit of row events failed, "
"Error in %s event: commit of row events failed, "
"table `%s`.`%s`"
,
"table `%s`.`%s`"
,
get_type_str
(),
m_table
->
s
->
db
.
str
,
get_type_str
(),
m_table
->
s
->
db
.
str
,
m_table
->
s
->
table_name
.
str
);
m_table
->
s
->
table_name
.
str
);
}
}
}
else
else
{
{
...
...
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