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
a539fac8
Commit
a539fac8
authored
Jul 19, 2023
by
Nikita Malyavin
Committed by
Sergei Golubchik
Aug 15, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-31646 untie from max_allowed_packet and opt_binlog_rows_event_max_size
parent
d5e59c98
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
12 deletions
+41
-12
sql/log_event.cc
sql/log_event.cc
+7
-9
sql/log_event.h
sql/log_event.h
+33
-2
sql/sql_table.cc
sql/sql_table.cc
+1
-1
No files found.
sql/log_event.cc
View file @
a539fac8
...
...
@@ -761,17 +761,13 @@ Log_event::Log_event(const uchar *buf,
int
Log_event
::
read_log_event
(
IO_CACHE
*
file
,
String
*
packet
,
const
Format_description_log_event
*
fdle
,
enum
enum_binlog_checksum_alg
checksum_alg_arg
)
enum
enum_binlog_checksum_alg
checksum_alg_arg
,
size_t
max_allowed_packet
)
{
ulong
data_len
;
char
buf
[
LOG_EVENT_MINIMAL_HEADER_LEN
];
uchar
ev_offset
=
packet
->
length
();
#if !defined(MYSQL_CLIENT)
THD
*
thd
=
current_thd
;
ulong
max_allowed_packet
=
thd
?
thd
->
slave_thread
?
slave_max_allowed_packet
:
thd
->
variables
.
max_allowed_packet
:
~
(
uint
)
0
;
#endif
DBUG_ENTER
(
"Log_event::read_log_event(IO_CACHE*,String*...)"
);
if
(
my_b_read
(
file
,
(
uchar
*
)
buf
,
sizeof
(
buf
)))
...
...
@@ -882,7 +878,8 @@ int Log_event::read_log_event(IO_CACHE* file, String* packet,
Log_event
*
Log_event
::
read_log_event
(
IO_CACHE
*
file
,
const
Format_description_log_event
*
fdle
,
my_bool
crc_check
)
my_bool
crc_check
,
size_t
max_allowed_packet
)
{
DBUG_ENTER
(
"Log_event::read_log_event(IO_CACHE*,Format_description_log_event*...)"
);
DBUG_ASSERT
(
fdle
!=
0
);
...
...
@@ -890,7 +887,8 @@ Log_event* Log_event::read_log_event(IO_CACHE* file,
const
char
*
error
=
0
;
Log_event
*
res
=
0
;
switch
(
read_log_event
(
file
,
&
event
,
fdle
,
BINLOG_CHECKSUM_ALG_OFF
))
switch
(
read_log_event
(
file
,
&
event
,
fdle
,
BINLOG_CHECKSUM_ALG_OFF
,
max_allowed_packet
))
{
case
0
:
break
;
...
...
sql/log_event.h
View file @
a539fac8
...
...
@@ -1363,6 +1363,20 @@ class Log_event
#endif
#endif
private:
static
size_t
get_max_packet
()
{
size_t
max_packet
=
~
0UL
;
#if !defined(MYSQL_CLIENT)
THD
*
thd
=
current_thd
;
if
(
thd
)
max_packet
=
thd
->
slave_thread
?
slave_max_allowed_packet
:
thd
->
variables
.
max_allowed_packet
;
#endif
return
max_packet
;
}
public:
/*
read_log_event() functions read an event from a binlog or relay
log; used by SHOW BINLOG EVENTS, the binlog_dump thread on the
...
...
@@ -1377,7 +1391,15 @@ class Log_event
static
Log_event
*
read_log_event
(
IO_CACHE
*
file
,
const
Format_description_log_event
*
description_event
,
my_bool
crc_check
);
my_bool
crc_check
,
size_t
max_allowed_packet
);
static
Log_event
*
read_log_event
(
IO_CACHE
*
file
,
const
Format_description_log_event
*
description_event
,
my_bool
crc_check
)
{
return
read_log_event
(
file
,
description_event
,
crc_check
,
get_max_packet
());
}
/**
Reads an event from a binlog or relay log. Used by the dump thread
...
...
@@ -1404,7 +1426,16 @@ class Log_event
*/
static
int
read_log_event
(
IO_CACHE
*
file
,
String
*
packet
,
const
Format_description_log_event
*
fdle
,
enum
enum_binlog_checksum_alg
checksum_alg_arg
);
enum
enum_binlog_checksum_alg
checksum_alg_arg
,
size_t
max_allowed_packet
);
static
int
read_log_event
(
IO_CACHE
*
file
,
String
*
packet
,
const
Format_description_log_event
*
fdle
,
enum
enum_binlog_checksum_alg
checksum_alg
)
{
return
read_log_event
(
file
,
packet
,
fdle
,
checksum_alg
,
get_max_packet
());
}
/*
The value is set by caller of FD constructor and
Log_event::write_header() for the rest.
...
...
sql/sql_table.cc
View file @
a539fac8
...
...
@@ -11665,7 +11665,7 @@ static int online_alter_read_from_binlog(THD *thd, rpl_group_info *rgi,
do
{
const
auto
*
descr_event
=
rgi
->
rli
->
relay_log
.
description_event_for_exec
;
auto
*
ev
=
Log_event
::
read_log_event
(
log_file
,
descr_event
,
false
);
auto
*
ev
=
Log_event
::
read_log_event
(
log_file
,
descr_event
,
false
,
~
0UL
);
error
=
log_file
->
error
;
if
(
unlikely
(
!
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