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
a47464d1
Commit
a47464d1
authored
May 29, 2019
by
Sujatha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-11094: Blackhole table updates on slave fail when row annotation is enabled
Post push fix. Simplified the earlier fixes.
parent
b3473961
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
19 deletions
+21
-19
storage/blackhole/ha_blackhole.cc
storage/blackhole/ha_blackhole.cc
+21
-19
No files found.
storage/blackhole/ha_blackhole.cc
View file @
a47464d1
...
...
@@ -25,15 +25,23 @@
#include "ha_blackhole.h"
#include "sql_class.h" // THD, SYSTEM_THREAD_SLAVE_SQL
/**
Checks if the param 'thd' is pointing to slave applier thread and row based
replication is in use.
A row event will have its thd->query() == NULL except in cases where
replicate_annotate_row_events is enabled. In the later case the thd->query()
will be pointing to the query, received through replicated annotate event
from master.
@param thd pointer to a THD instance
@return TRUE if thread is slave applier and row based replication is in use
*/
static
bool
is_row_based_replication
(
THD
*
thd
)
{
/*
A row event which has its thd->query() == NULL or a row event which has
replicate_annotate_row_events enabled. In the later case the thd->query()
will be pointing to the query, received through replicated annotate event
from master.
*/
return
((
thd
->
query
()
==
NULL
)
||
thd
->
variables
.
binlog_annotate_row_events
);
return
thd
->
system_thread
==
SYSTEM_THREAD_SLAVE_SQL
&&
(
thd
->
query
()
==
NULL
||
thd
->
variables
.
binlog_annotate_row_events
);
}
/* Static declarations for handlerton */
...
...
@@ -119,8 +127,7 @@ int ha_blackhole::update_row(const uchar *old_data, uchar *new_data)
{
DBUG_ENTER
(
"ha_blackhole::update_row"
);
THD
*
thd
=
ha_thd
();
if
(
thd
->
system_thread
==
SYSTEM_THREAD_SLAVE_SQL
&&
is_row_based_replication
(
thd
))
if
(
is_row_based_replication
(
thd
))
DBUG_RETURN
(
0
);
DBUG_RETURN
(
HA_ERR_WRONG_COMMAND
);
}
...
...
@@ -129,8 +136,7 @@ int ha_blackhole::delete_row(const uchar *buf)
{
DBUG_ENTER
(
"ha_blackhole::delete_row"
);
THD
*
thd
=
ha_thd
();
if
(
thd
->
system_thread
==
SYSTEM_THREAD_SLAVE_SQL
&&
is_row_based_replication
(
thd
))
if
(
is_row_based_replication
(
thd
))
DBUG_RETURN
(
0
);
DBUG_RETURN
(
HA_ERR_WRONG_COMMAND
);
}
...
...
@@ -147,8 +153,7 @@ int ha_blackhole::rnd_next(uchar *buf)
int
rc
;
DBUG_ENTER
(
"ha_blackhole::rnd_next"
);
THD
*
thd
=
ha_thd
();
if
(
thd
->
system_thread
==
SYSTEM_THREAD_SLAVE_SQL
&&
is_row_based_replication
(
thd
))
if
(
is_row_based_replication
(
thd
))
rc
=
0
;
else
rc
=
HA_ERR_END_OF_FILE
;
...
...
@@ -233,8 +238,7 @@ int ha_blackhole::index_read_map(uchar * buf, const uchar * key,
int
rc
;
DBUG_ENTER
(
"ha_blackhole::index_read"
);
THD
*
thd
=
ha_thd
();
if
(
thd
->
system_thread
==
SYSTEM_THREAD_SLAVE_SQL
&&
is_row_based_replication
(
thd
))
if
(
is_row_based_replication
(
thd
))
rc
=
0
;
else
rc
=
HA_ERR_END_OF_FILE
;
...
...
@@ -249,8 +253,7 @@ int ha_blackhole::index_read_idx_map(uchar * buf, uint idx, const uchar * key,
int
rc
;
DBUG_ENTER
(
"ha_blackhole::index_read_idx"
);
THD
*
thd
=
ha_thd
();
if
(
thd
->
system_thread
==
SYSTEM_THREAD_SLAVE_SQL
&&
is_row_based_replication
(
thd
))
if
(
is_row_based_replication
(
thd
))
rc
=
0
;
else
rc
=
HA_ERR_END_OF_FILE
;
...
...
@@ -264,8 +267,7 @@ int ha_blackhole::index_read_last_map(uchar * buf, const uchar * key,
int
rc
;
DBUG_ENTER
(
"ha_blackhole::index_read_last"
);
THD
*
thd
=
ha_thd
();
if
(
thd
->
system_thread
==
SYSTEM_THREAD_SLAVE_SQL
&&
is_row_based_replication
(
thd
))
if
(
is_row_based_replication
(
thd
))
rc
=
0
;
else
rc
=
HA_ERR_END_OF_FILE
;
...
...
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