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
00bd52b1
Commit
00bd52b1
authored
Jun 18, 2020
by
Monty
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added THD::binlog_table_should_be_logged() to simplify some code
- Added missing test for binlog_filter to ALTER TABLE
parent
1a49c5eb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
15 deletions
+21
-15
sql/sql_class.cc
sql/sql_class.cc
+17
-5
sql/sql_class.h
sql/sql_class.h
+1
-0
sql/sql_insert.cc
sql/sql_insert.cc
+2
-8
sql/sql_table.cc
sql/sql_table.cc
+1
-2
No files found.
sql/sql_class.cc
View file @
00bd52b1
...
...
@@ -5964,11 +5964,8 @@ int THD::decide_logging_format(TABLE_LIST *tables)
}
#endif
/* WITH_WSREP */
if
((
WSREP_EMULATE_BINLOG_NNULL
(
this
)
||
(
mysql_bin_log
.
is_open
()
&&
(
variables
.
option_bits
&
OPTION_BIN_LOG
)))
&&
!
(
wsrep_binlog_format
()
==
BINLOG_FORMAT_STMT
&&
!
binlog_filter
->
db_ok
(
db
.
str
)))
if
(
WSREP_EMULATE_BINLOG_NNULL
(
this
)
||
binlog_table_should_be_logged
(
&
db
))
{
if
(
is_bulk_op
())
{
...
...
@@ -6492,6 +6489,21 @@ exit:;
}
#ifndef MYSQL_CLIENT
/**
Check if we should log a table DDL to the binlog
@@return true yes
@@return false no
*/
bool
THD
::
binlog_table_should_be_logged
(
const
LEX_CSTRING
*
db
)
{
return
(
mysql_bin_log
.
is_open
()
&&
(
variables
.
option_bits
&
OPTION_BIN_LOG
)
&&
(
wsrep_binlog_format
()
!=
BINLOG_FORMAT_STMT
||
binlog_filter
->
db_ok
(
db
->
str
)));
}
/*
Template member function for ensuring that there is an rows log
event of the apropriate type before proceeding.
...
...
sql/sql_class.h
View file @
00bd52b1
...
...
@@ -2699,6 +2699,7 @@ class THD: public THD_count, /* this must be first */
{
binlog_table_maps
=
0
;
}
bool
binlog_table_should_be_logged
(
const
LEX_CSTRING
*
db
);
#endif
/* MYSQL_CLIENT */
...
...
sql/sql_insert.cc
View file @
00bd52b1
...
...
@@ -4802,10 +4802,7 @@ bool binlog_create_table(THD *thd, TABLE *table)
if
(
thd
->
variables
.
binlog_format
==
BINLOG_FORMAT_ROW
&&
table
->
s
->
tmp_table
)
return
0
;
if
(
!
mysql_bin_log
.
is_open
()
||
!
(
thd
->
variables
.
option_bits
&
OPTION_BIN_LOG
)
||
(
thd
->
wsrep_binlog_format
()
==
BINLOG_FORMAT_STMT
&&
!
binlog_filter
->
db_ok
(
table
->
s
->
db
.
str
)))
if
(
!
thd
->
binlog_table_should_be_logged
(
&
table
->
s
->
db
))
return
0
;
/*
...
...
@@ -4834,10 +4831,7 @@ bool binlog_drop_table(THD *thd, TABLE *table)
/* Don't log temporary tables in row format */
if
(
!
table
->
s
->
table_creation_was_logged
)
return
0
;
if
(
!
mysql_bin_log
.
is_open
()
||
!
(
thd
->
variables
.
option_bits
&
OPTION_BIN_LOG
)
||
(
thd
->
wsrep_binlog_format
()
==
BINLOG_FORMAT_STMT
&&
!
binlog_filter
->
db_ok
(
table
->
s
->
db
.
str
)))
if
(
!
thd
->
binlog_table_should_be_logged
(
&
table
->
s
->
db
))
return
0
;
query
.
append
(
"DROP "
);
...
...
sql/sql_table.cc
View file @
00bd52b1
...
...
@@ -10708,8 +10708,7 @@ do_continue:;
if
((
table
->
file
->
partition_ht
()
->
flags
&
HTON_TABLE_MAY_NOT_EXIST_ON_SLAVE
)
&&
(
table
->
file
->
partition_ht
()
!=
new_table
->
file
->
partition_ht
())
&&
(
mysql_bin_log
.
is_open
()
&&
(
thd
->
variables
.
option_bits
&
OPTION_BIN_LOG
)))
thd
->
binlog_table_should_be_logged
(
&
new_table
->
s
->
db
))
{
/*
We new_table is marked as internal temp table, but we want to have
...
...
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