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
c3ebd786
Commit
c3ebd786
authored
Oct 22, 2015
by
Michael Widenius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove THD argment from Log_event->net_send() and Protocol::pack_info() as
THD is already available in Protocol
parent
0bf2b1c1
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
61 additions
and
65 deletions
+61
-65
sql/log_event.cc
sql/log_event.cc
+33
-34
sql/log_event.h
sql/log_event.h
+23
-24
sql/log_event_old.cc
sql/log_event_old.cc
+1
-1
sql/log_event_old.h
sql/log_event_old.h
+1
-1
sql/protocol.h
sql/protocol.h
+1
-4
sql/sql_class.cc
sql/sql_class.cc
+1
-0
sql/sql_repl.cc
sql/sql_repl.cc
+1
-1
No files found.
sql/log_event.cc
View file @
c3ebd786
This diff is collapsed.
Click to expand it.
sql/log_event.h
View file @
c3ebd786
...
...
@@ -1129,15 +1129,14 @@ class Log_event
*/
static
void
init_show_field_list
(
THD
*
thd
,
List
<
Item
>*
field_list
);
#ifdef HAVE_REPLICATION
int
net_send
(
THD
*
thd
,
Protocol
*
protocol
,
const
char
*
log_name
,
my_off_t
pos
);
int
net_send
(
Protocol
*
protocol
,
const
char
*
log_name
,
my_off_t
pos
);
/*
pack_info() is used by SHOW BINLOG EVENTS; as print() it prepares and sends
a string to display to the user, so it resembles print().
*/
virtual
void
pack_info
(
THD
*
thd
,
Protocol
*
protocol
);
virtual
void
pack_info
(
Protocol
*
protocol
);
#endif
/* HAVE_REPLICATION */
virtual
const
char
*
get_db
()
...
...
@@ -1977,7 +1976,7 @@ class Query_log_event: public Log_event
bool
using_trans
,
bool
direct
,
bool
suppress_use
,
int
error
);
const
char
*
get_db
()
{
return
db
;
}
#ifdef HAVE_REPLICATION
void
pack_info
(
THD
*
thd
,
Protocol
*
protocol
);
void
pack_info
(
Protocol
*
protocol
);
#endif
/* HAVE_REPLICATION */
#else
void
print_query_header
(
IO_CACHE
*
file
,
PRINT_EVENT_INFO
*
print_event_info
);
...
...
@@ -2355,7 +2354,7 @@ class Load_log_event: public Log_event
Name_resolution_context
*
context
);
const
char
*
get_db
()
{
return
db
;
}
#ifdef HAVE_REPLICATION
void
pack_info
(
THD
*
thd
,
Protocol
*
protocol
);
void
pack_info
(
Protocol
*
protocol
);
#endif
/* HAVE_REPLICATION */
#else
void
print
(
FILE
*
file
,
PRINT_EVENT_INFO
*
print_event_info
);
...
...
@@ -2452,7 +2451,7 @@ class Start_log_event_v3: public Log_event
#ifdef MYSQL_SERVER
Start_log_event_v3
();
#ifdef HAVE_REPLICATION
void
pack_info
(
THD
*
thd
,
Protocol
*
protocol
);
void
pack_info
(
Protocol
*
protocol
);
#endif
/* HAVE_REPLICATION */
#else
Start_log_event_v3
()
{}
...
...
@@ -2710,7 +2709,7 @@ Intvar_log_event(THD* thd_arg,uchar type_arg, ulonglong val_arg,
cache_type
=
Log_event
::
EVENT_NO_CACHE
;
}
#ifdef HAVE_REPLICATION
void
pack_info
(
THD
*
thd
,
Protocol
*
protocol
);
void
pack_info
(
Protocol
*
protocol
);
#endif
/* HAVE_REPLICATION */
#else
void
print
(
FILE
*
file
,
PRINT_EVENT_INFO
*
print_event_info
);
...
...
@@ -2791,7 +2790,7 @@ class Rand_log_event: public Log_event
cache_type
=
Log_event
::
EVENT_NO_CACHE
;
}
#ifdef HAVE_REPLICATION
void
pack_info
(
THD
*
thd
,
Protocol
*
protocol
);
void
pack_info
(
Protocol
*
protocol
);
#endif
/* HAVE_REPLICATION */
#else
void
print
(
FILE
*
file
,
PRINT_EVENT_INFO
*
print_event_info
);
...
...
@@ -2841,7 +2840,7 @@ class Xid_log_event: public Log_event
cache_type
=
Log_event
::
EVENT_NO_CACHE
;
}
#ifdef HAVE_REPLICATION
void
pack_info
(
THD
*
thd
,
Protocol
*
protocol
);
void
pack_info
(
Protocol
*
protocol
);
#endif
/* HAVE_REPLICATION */
#else
void
print
(
FILE
*
file
,
PRINT_EVENT_INFO
*
print_event_info
);
...
...
@@ -2904,7 +2903,7 @@ class User_var_log_event: public Log_event
if
(
direct
)
cache_type
=
Log_event
::
EVENT_NO_CACHE
;
}
void
pack_info
(
THD
*
thd
,
Protocol
*
protocol
);
void
pack_info
(
Protocol
*
protocol
);
#else
void
print
(
FILE
*
file
,
PRINT_EVENT_INFO
*
print_event_info
);
#endif
...
...
@@ -3047,7 +3046,7 @@ class Rotate_log_event: public Log_event
uint
ident_len_arg
,
ulonglong
pos_arg
,
uint
flags
);
#ifdef HAVE_REPLICATION
void
pack_info
(
THD
*
thd
,
Protocol
*
protocol
);
void
pack_info
(
Protocol
*
protocol
);
#endif
/* HAVE_REPLICATION */
#else
void
print
(
FILE
*
file
,
PRINT_EVENT_INFO
*
print_event_info
);
...
...
@@ -3087,7 +3086,7 @@ class Binlog_checkpoint_log_event: public Log_event
Binlog_checkpoint_log_event
(
const
char
*
binlog_file_name_arg
,
uint
binlog_file_len_arg
);
#ifdef HAVE_REPLICATION
void
pack_info
(
THD
*
thd
,
Protocol
*
protocol
);
void
pack_info
(
Protocol
*
protocol
);
#endif
#else
void
print
(
FILE
*
file
,
PRINT_EVENT_INFO
*
print_event_info
);
...
...
@@ -3209,7 +3208,7 @@ class Gtid_log_event: public Log_event
Gtid_log_event
(
THD
*
thd_arg
,
uint64
seq_no
,
uint32
domain_id
,
bool
standalone
,
uint16
flags
,
bool
is_transactional
,
uint64
commit_id
);
#ifdef HAVE_REPLICATION
void
pack_info
(
THD
*
thd
,
Protocol
*
protocol
);
void
pack_info
(
Protocol
*
protocol
);
virtual
int
do_apply_event
(
rpl_group_info
*
rgi
);
virtual
int
do_update_pos
(
rpl_group_info
*
rgi
);
virtual
enum_skip_reason
do_shall_skip
(
rpl_group_info
*
rgi
);
...
...
@@ -3322,7 +3321,7 @@ class Gtid_list_log_event: public Log_event
Gtid_list_log_event
(
rpl_binlog_state
*
gtid_set
,
uint32
gl_flags
);
Gtid_list_log_event
(
slave_connection_state
*
gtid_set
,
uint32
gl_flags
);
#ifdef HAVE_REPLICATION
void
pack_info
(
THD
*
thd
,
Protocol
*
protocol
);
void
pack_info
(
Protocol
*
protocol
);
#endif
#else
void
print
(
FILE
*
file
,
PRINT_EVENT_INFO
*
print_event_info
);
...
...
@@ -3386,7 +3385,7 @@ class Create_file_log_event: public Load_log_event
uchar
*
block_arg
,
uint
block_len_arg
,
bool
using_trans
);
#ifdef HAVE_REPLICATION
void
pack_info
(
THD
*
thd
,
Protocol
*
protocol
);
void
pack_info
(
Protocol
*
protocol
);
#endif
/* HAVE_REPLICATION */
#else
void
print
(
FILE
*
file
,
PRINT_EVENT_INFO
*
print_event_info
);
...
...
@@ -3458,7 +3457,7 @@ class Append_block_log_event: public Log_event
Append_block_log_event
(
THD
*
thd
,
const
char
*
db_arg
,
uchar
*
block_arg
,
uint
block_len_arg
,
bool
using_trans
);
#ifdef HAVE_REPLICATION
void
pack_info
(
THD
*
thd
,
Protocol
*
protocol
);
void
pack_info
(
Protocol
*
protocol
);
virtual
int
get_create_or_append
()
const
;
#endif
/* HAVE_REPLICATION */
#else
...
...
@@ -3499,7 +3498,7 @@ class Delete_file_log_event: public Log_event
#ifdef MYSQL_SERVER
Delete_file_log_event
(
THD
*
thd
,
const
char
*
db_arg
,
bool
using_trans
);
#ifdef HAVE_REPLICATION
void
pack_info
(
THD
*
thd
,
Protocol
*
protocol
);
void
pack_info
(
Protocol
*
protocol
);
#endif
/* HAVE_REPLICATION */
#else
void
print
(
FILE
*
file
,
PRINT_EVENT_INFO
*
print_event_info
);
...
...
@@ -3540,7 +3539,7 @@ class Execute_load_log_event: public Log_event
#ifdef MYSQL_SERVER
Execute_load_log_event
(
THD
*
thd
,
const
char
*
db_arg
,
bool
using_trans
);
#ifdef HAVE_REPLICATION
void
pack_info
(
THD
*
thd
,
Protocol
*
protocol
);
void
pack_info
(
Protocol
*
protocol
);
#endif
/* HAVE_REPLICATION */
#else
void
print
(
FILE
*
file
,
PRINT_EVENT_INFO
*
print_event_info
);
...
...
@@ -3636,7 +3635,7 @@ class Execute_load_query_log_event: public Query_log_event
bool
using_trans
,
bool
direct
,
bool
suppress_use
,
int
errcode
);
#ifdef HAVE_REPLICATION
void
pack_info
(
THD
*
thd
,
Protocol
*
protocol
);
void
pack_info
(
Protocol
*
protocol
);
#endif
/* HAVE_REPLICATION */
#else
void
print
(
FILE
*
file
,
PRINT_EVENT_INFO
*
print_event_info
);
...
...
@@ -3723,7 +3722,7 @@ class Annotate_rows_log_event: public Log_event
#endif
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
virtual
void
pack_info
(
THD
*
thd
,
Protocol
*
);
virtual
void
pack_info
(
Protocol
*
);
#endif
#ifdef MYSQL_CLIENT
...
...
@@ -4140,7 +4139,7 @@ class Table_map_log_event : public Log_event
#endif
#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
virtual
void
pack_info
(
THD
*
thd
,
Protocol
*
protocol
);
virtual
void
pack_info
(
Protocol
*
protocol
);
#endif
#ifdef MYSQL_CLIENT
...
...
@@ -4255,7 +4254,7 @@ class Rows_log_event : public Log_event
virtual
Log_event_type
get_general_type_code
()
=
0
;
/* General rows op type, no version */
#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
virtual
void
pack_info
(
THD
*
thd
,
Protocol
*
protocol
);
virtual
void
pack_info
(
Protocol
*
protocol
);
#endif
#ifdef MYSQL_CLIENT
...
...
@@ -4795,7 +4794,7 @@ class Incident_log_event : public Log_event {
#endif
#ifdef MYSQL_SERVER
void
pack_info
(
THD
*
thd
,
Protocol
*
);
void
pack_info
(
Protocol
*
);
virtual
bool
write_data_header
();
virtual
bool
write_data_body
();
...
...
@@ -4870,7 +4869,7 @@ class Ignorable_log_event : public Log_event {
virtual
~
Ignorable_log_event
();
#ifndef MYSQL_CLIENT
void
pack_info
(
THD
*
,
Protocol
*
);
void
pack_info
(
Protocol
*
);
#endif
#ifdef MYSQL_CLIENT
...
...
sql/log_event_old.cc
View file @
c3ebd786
...
...
@@ -1804,7 +1804,7 @@ bool Old_rows_log_event::write_data_body()
#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
void
Old_rows_log_event
::
pack_info
(
THD
*
thd
,
Protocol
*
protocol
)
void
Old_rows_log_event
::
pack_info
(
Protocol
*
protocol
)
{
char
buf
[
256
];
char
const
*
const
flagstr
=
...
...
sql/log_event_old.h
View file @
c3ebd786
...
...
@@ -111,7 +111,7 @@ class Old_rows_log_event : public Log_event
flag_set
get_flags
(
flag_set
flags_arg
)
const
{
return
m_flags
&
flags_arg
;
}
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
virtual
void
pack_info
(
THD
*
thd
,
Protocol
*
protocol
);
virtual
void
pack_info
(
Protocol
*
protocol
);
#endif
#ifdef MYSQL_CLIENT
...
...
sql/protocol.h
View file @
c3ebd786
...
...
@@ -33,7 +33,6 @@ typedef struct st_mysql_rows MYSQL_ROWS;
class
Protocol
{
protected:
THD
*
thd
;
String
*
packet
;
/* Used by net_store_data() for charset conversions */
String
*
convert
;
...
...
@@ -71,7 +70,7 @@ class Protocol
const
char
*
sql_state
);
public:
Protocol
()
{}
THD
*
thd
;
Protocol
(
THD
*
thd_arg
)
{
init
(
thd_arg
);
}
virtual
~
Protocol
()
{}
void
init
(
THD
*
thd_arg
);
...
...
@@ -151,7 +150,6 @@ class Protocol
class
Protocol_text
:
public
Protocol
{
public:
Protocol_text
()
{}
Protocol_text
(
THD
*
thd_arg
)
:
Protocol
(
thd_arg
)
{}
virtual
void
prepare_for_resend
();
virtual
bool
store_null
();
...
...
@@ -183,7 +181,6 @@ class Protocol_binary :public Protocol
private:
uint
bit_fields
;
public:
Protocol_binary
()
{}
Protocol_binary
(
THD
*
thd_arg
)
:
Protocol
(
thd_arg
)
{}
virtual
bool
prepare_for_send
(
uint
num_columns
);
virtual
void
prepare_for_resend
();
...
...
sql/sql_class.cc
View file @
c3ebd786
...
...
@@ -856,6 +856,7 @@ THD::THD(bool is_wsrep_applier)
:
Statement
(
&
main_lex
,
&
main_mem_root
,
STMT_CONVENTIONAL_EXECUTION
,
/* statement id */
0
),
rli_fake
(
0
),
rgi_fake
(
0
),
rgi_slave
(
NULL
),
protocol_text
(
this
),
protocol_binary
(
this
),
in_sub_stmt
(
0
),
log_all_errors
(
0
),
binlog_unsafe_warning_flags
(
0
),
binlog_table_maps
(
0
),
...
...
sql/sql_repl.cc
View file @
c3ebd786
...
...
@@ -4012,7 +4012,7 @@ bool mysql_show_binlog_events(THD* thd)
opt_master_verify_checksum
));
)
{
if
(
event_count
>=
limit_start
&&
ev
->
net_send
(
thd
,
protocol
,
linfo
.
log_file_name
,
pos
))
ev
->
net_send
(
protocol
,
linfo
.
log_file_name
,
pos
))
{
errmsg
=
"Net error"
;
delete
ev
;
...
...
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