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
b896f60a
Commit
b896f60a
authored
Apr 03, 2019
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix -Wformat and -Wnonnull-compare for WSREP
parent
0dc442ac
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
24 additions
and
21 deletions
+24
-21
sql/log.cc
sql/log.cc
+3
-3
sql/service_wsrep.cc
sql/service_wsrep.cc
+1
-1
sql/sql_class.cc
sql/sql_class.cc
+16
-13
sql/sql_class.h
sql/sql_class.h
+1
-1
sql/sql_insert.cc
sql/sql_insert.cc
+1
-1
sql/sql_parse.cc
sql/sql_parse.cc
+1
-1
sql/wsrep_notify.cc
sql/wsrep_notify.cc
+1
-1
No files found.
sql/log.cc
View file @
b896f60a
...
...
@@ -5838,10 +5838,10 @@ int THD::binlog_write_table_map(TABLE *table, bool is_transactional,
/* Ensure that all events in a GTID group are in the same cache */
if
(
variables
.
option_bits
&
OPTION_GTID_BEGIN
)
is_transactional
=
1
;
/* Pre-conditions */
DBUG_ASSERT
(
is_current_stmt_binlog_format_row
());
DBUG_ASSERT
(
WSREP_EMULATE_BINLOG
(
this
)
||
mysql_bin_log
.
is_open
());
DBUG_ASSERT
(
WSREP_EMULATE_BINLOG
_NNULL
(
this
)
||
mysql_bin_log
.
is_open
());
DBUG_ASSERT
(
table
->
s
->
table_map_id
!=
ULONG_MAX
);
Table_map_log_event
...
...
@@ -10769,7 +10769,7 @@ bool wsrep_stmt_rollback_is_safe(THD* thd)
trx_cache
->
get_prev_position
()
<
thd
->
wsrep_sr
().
bytes_certified
()))
{
WSREP_DEBUG
(
"statement rollback is not safe for streaming replication"
" pre-stmt_pos: %llu, frag repl pos: %
l
u
\n
"
" pre-stmt_pos: %llu, frag repl pos: %
z
u
\n
"
"Thread: %llu, SQL: %s"
,
trx_cache
->
get_prev_position
(),
thd
->
wsrep_sr
().
bytes_certified
(),
...
...
sql/service_wsrep.cc
View file @
b896f60a
...
...
@@ -141,7 +141,7 @@ extern "C" void wsrep_handle_SR_rollback(THD *bf_thd,
DBUG_ASSERT
(
victim_thd
);
if
(
!
victim_thd
||
!
wsrep_on
(
bf_thd
))
return
;
WSREP_DEBUG
(
"handle rollback, for deadlock: thd %llu trx_id %
lu frags %l
u conf %s"
,
WSREP_DEBUG
(
"handle rollback, for deadlock: thd %llu trx_id %
"
PRIu64
" frags %z
u conf %s"
,
victim_thd
->
thread_id
,
victim_thd
->
wsrep_trx_id
(),
victim_thd
->
wsrep_sr
().
fragments_certified
(),
...
...
sql/sql_class.cc
View file @
b896f60a
...
...
@@ -1663,10 +1663,10 @@ THD::~THD()
THD is not deleted while they access it. The following mutex_lock
ensures that no one else is using this THD and it's now safe to delete
*/
if
(
WSREP
(
this
))
mysql_mutex_lock
(
&
LOCK_thd_data
);
if
(
WSREP
_NNULL
(
this
))
mysql_mutex_lock
(
&
LOCK_thd_data
);
mysql_mutex_lock
(
&
LOCK_thd_kill
);
mysql_mutex_unlock
(
&
LOCK_thd_kill
);
if
(
WSREP
(
this
))
mysql_mutex_unlock
(
&
LOCK_thd_data
);
if
(
WSREP
_NNULL
(
this
))
mysql_mutex_unlock
(
&
LOCK_thd_data
);
if
(
!
free_connection_done
)
free_connection
();
...
...
@@ -1858,7 +1858,7 @@ void THD::awake_no_mutex(killed_state state_to_set)
DBUG_PRINT
(
"enter"
,
(
"this: %p current_thd: %p state: %d"
,
this
,
current_thd
,
(
int
)
state_to_set
));
THD_CHECK_SENTRY
(
this
);
if
(
WSREP
(
this
))
mysql_mutex_assert_owner
(
&
LOCK_thd_data
);
if
(
WSREP
_NNULL
(
this
))
mysql_mutex_assert_owner
(
&
LOCK_thd_data
);
mysql_mutex_assert_owner
(
&
LOCK_thd_kill
);
print_aborted_warning
(
3
,
"KILLED"
);
...
...
@@ -6348,7 +6348,7 @@ int THD::decide_logging_format(TABLE_LIST *tables)
5. Error: Cannot modify table that uses a storage engine
limited to row-logging when binlog_format = STATEMENT
*/
if
(
IF_WSREP
((
!
WSREP
(
this
)
||
if
(
IF_WSREP
((
!
WSREP
_NNULL
(
this
)
||
wsrep_cs
().
mode
()
==
wsrep
::
client_state
::
m_local
),
1
))
{
my_error
((
error
=
ER_BINLOG_STMT_MODE_AND_ROW_ENGINE
),
MYF
(
0
),
""
);
...
...
@@ -6700,8 +6700,9 @@ int THD::binlog_write_row(TABLE* table, bool is_trans,
uchar
const
*
record
)
{
DBUG_ASSERT
(
is_current_stmt_binlog_format_row
()
&&
((
WSREP
(
this
)
&&
wsrep_emulate_bin_log
)
||
mysql_bin_log
.
is_open
()));
DBUG_ASSERT
(
is_current_stmt_binlog_format_row
());
DBUG_ASSERT
((
WSREP_NNULL
(
this
)
&&
wsrep_emulate_bin_log
)
||
mysql_bin_log
.
is_open
());
/*
Pack records into format for transfer. We are allocating more
memory than needed, but that doesn't matter.
...
...
@@ -6741,8 +6742,9 @@ int THD::binlog_update_row(TABLE* table, bool is_trans,
const
uchar
*
before_record
,
const
uchar
*
after_record
)
{
DBUG_ASSERT
(
is_current_stmt_binlog_format_row
()
&&
((
WSREP
(
this
)
&&
wsrep_emulate_bin_log
)
||
mysql_bin_log
.
is_open
()));
DBUG_ASSERT
(
is_current_stmt_binlog_format_row
());
DBUG_ASSERT
((
WSREP_NNULL
(
this
)
&&
wsrep_emulate_bin_log
)
||
mysql_bin_log
.
is_open
());
/**
Save a reference to the original read bitmaps
...
...
@@ -6820,8 +6822,9 @@ int THD::binlog_update_row(TABLE* table, bool is_trans,
int
THD
::
binlog_delete_row
(
TABLE
*
table
,
bool
is_trans
,
uchar
const
*
record
)
{
DBUG_ASSERT
(
is_current_stmt_binlog_format_row
()
&&
((
WSREP
(
this
)
&&
wsrep_emulate_bin_log
)
||
mysql_bin_log
.
is_open
()));
DBUG_ASSERT
(
is_current_stmt_binlog_format_row
());
DBUG_ASSERT
((
WSREP_NNULL
(
this
)
&&
wsrep_emulate_bin_log
)
||
mysql_bin_log
.
is_open
());
/**
Save a reference to the original read bitmaps
We will need this to restore the bitmaps at the end as
...
...
@@ -6952,7 +6955,7 @@ int THD::binlog_remove_pending_rows_event(bool clear_maps,
{
DBUG_ENTER
(
"THD::binlog_remove_pending_rows_event"
);
if
(
!
WSREP_EMULATE_BINLOG
(
this
)
&&
!
mysql_bin_log
.
is_open
())
if
(
!
WSREP_EMULATE_BINLOG
_NNULL
(
this
)
&&
!
mysql_bin_log
.
is_open
())
DBUG_RETURN
(
0
);
/* Ensure that all events in a GTID group are in the same cache */
...
...
@@ -6975,7 +6978,7 @@ int THD::binlog_flush_pending_rows_event(bool stmt_end, bool is_transactional)
mode: it might be the case that we left row-based mode before
flushing anything (e.g., if we have explicitly locked tables).
*/
if
(
!
WSREP_EMULATE_BINLOG
(
this
)
&&
!
mysql_bin_log
.
is_open
())
if
(
!
WSREP_EMULATE_BINLOG_NNULL
(
this
)
&&
!
mysql_bin_log
.
is_open
())
DBUG_RETURN
(
0
);
/* Ensure that all events in a GTID group are in the same cache */
...
...
@@ -7248,7 +7251,7 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype, char const *query_arg,
show_query_type
(
qtype
),
(
int
)
query_len
,
query_arg
));
DBUG_ASSERT
(
query_arg
);
DBUG_ASSERT
(
WSREP_EMULATE_BINLOG
(
this
)
||
mysql_bin_log
.
is_open
());
DBUG_ASSERT
(
WSREP_EMULATE_BINLOG
_NNULL
(
this
)
||
mysql_bin_log
.
is_open
());
/* If this is withing a BEGIN ... COMMIT group, don't log it */
if
(
variables
.
option_bits
&
OPTION_GTID_BEGIN
)
...
...
sql/sql_class.h
View file @
b896f60a
...
...
@@ -4550,7 +4550,7 @@ class THD: public THD_count, /* this must be first */
{
query_id
=
new_query_id
;
#ifdef WITH_WSREP
if
(
WSREP
(
this
))
if
(
WSREP
_NNULL
(
this
))
{
set_wsrep_next_trx_id
(
query_id
);
WSREP_DEBUG
(
"assigned new next trx id: %"
PRIu64
,
wsrep_next_trx_id
());
...
...
sql/sql_insert.cc
View file @
b896f60a
...
...
@@ -4599,7 +4599,7 @@ bool select_create::send_eof()
wsrep_start_transaction
(
thd
,
thd
->
wsrep_next_trx_id
());
}
DBUG_ASSERT
(
thd
->
wsrep_trx_id
()
!=
WSREP_UNDEFINED_TRX_ID
);
WSREP_DEBUG
(
"CTAS key append for trx: %
lu
thd %llu query %lld "
,
WSREP_DEBUG
(
"CTAS key append for trx: %
"
PRIu64
"
thd %llu query %lld "
,
thd
->
wsrep_trx_id
(),
thd
->
thread_id
,
thd
->
query_id
);
/*
...
...
sql/sql_parse.cc
View file @
b896f60a
...
...
@@ -7682,7 +7682,7 @@ void THD::reset_for_next_command(bool do_clear_error)
use autoinc values passed in binlog events, not the values forced by
the cluster.
*/
if
(
WSREP
(
this
)
&&
wsrep_thd_is_local
(
this
)
&&
if
(
WSREP
_NNULL
(
this
)
&&
wsrep_thd_is_local
(
this
)
&&
!
slave_thread
&&
wsrep_auto_increment_control
)
{
variables
.
auto_increment_offset
=
...
...
sql/wsrep_notify.cc
View file @
b896f60a
...
...
@@ -49,7 +49,7 @@ void wsrep_notify_status(enum wsrep::server_state::state status,
" --primary %s"
,
view
->
view_seqno
().
get
()
>=
0
?
"yes"
:
"no"
);
cmd_off
+=
snprintf
(
cmd_ptr
+
cmd_off
,
cmd_len
-
cmd_off
,
" --index %
l
d"
,
view
->
own_index
());
" --index %
z
d"
,
view
->
own_index
());
const
std
::
vector
<
wsrep
::
view
::
member
>&
members
(
view
->
members
());
if
(
members
.
size
())
...
...
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