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
e20693c1
Commit
e20693c1
authored
Jan 27, 2024
by
Monty
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed some wrong printf() usage after changing m_table_id to ulonglong
This caused some crashes on 32 bit platforms.
parent
daca0c05
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
11 deletions
+13
-11
sql/log_event_client.cc
sql/log_event_client.cc
+3
-2
sql/log_event_old.cc
sql/log_event_old.cc
+6
-5
sql/log_event_server.cc
sql/log_event_server.cc
+4
-4
No files found.
sql/log_event_client.cc
View file @
e20693c1
...
...
@@ -1502,8 +1502,9 @@ bool Rows_log_event::print_verbose(IO_CACHE *file,
if
(
!
(
map
=
print_event_info
->
m_table_map
.
get_table
(
m_table_id
))
||
!
(
td
=
map
->
create_table_def
()))
{
return
(
my_b_printf
(
file
,
"### Row event for unknown table #%llu"
,
(
ulonglong
)
m_table_id
));
char
llbuff
[
22
];
return
(
my_b_printf
(
file
,
"### Row event for unknown table #%s"
,
ullstr
(
m_table_id
,
llbuff
)));
}
/* If the write rows event contained no values for the AI */
...
...
sql/log_event_old.cc
View file @
e20693c1
...
...
@@ -1251,7 +1251,7 @@ Old_rows_log_event::Old_rows_log_event(const uchar *buf, uint event_len,
const
uchar
*
const
ptr_rows_data
=
(
const
uchar
*
)
ptr_after_width
;
size_t
const
data_size
=
event_len
-
(
ptr_rows_data
-
(
const
uchar
*
)
buf
);
DBUG_PRINT
(
"info"
,(
"m_table_id: %lu m_flags: %d m_width: %lu data_size: %zu"
,
DBUG_PRINT
(
"info"
,(
"m_table_id: %l
l
u m_flags: %d m_width: %lu data_size: %zu"
,
m_table_id
,
m_flags
,
m_width
,
data_size
));
DBUG_DUMP
(
"rows_data"
,
(
uchar
*
)
ptr_rows_data
,
data_size
);
...
...
@@ -1790,7 +1790,7 @@ bool Old_rows_log_event::write_data_header()
DBUG_ASSERT
(
m_table_id
!=
UINT32_MAX
);
DBUG_EXECUTE_IF
(
"old_row_based_repl_4_byte_map_id_master"
,
{
int4store
(
buf
+
0
,
m_table_id
);
int4store
(
buf
+
0
,
(
ulong
)
m_table_id
);
int2store
(
buf
+
4
,
m_flags
);
return
write_data
(
buf
,
6
);
});
...
...
@@ -1837,7 +1837,7 @@ void Old_rows_log_event::pack_info(Protocol *protocol)
char
const
*
const
flagstr
=
get_flags
(
STMT_END_F
)
?
" flags: STMT_END_F"
:
""
;
size_t
bytes
=
my_snprintf
(
buf
,
sizeof
(
buf
),
"table_id: %lu%s"
,
m_table_id
,
flagstr
);
"table_id: %l
l
u%s"
,
m_table_id
,
flagstr
);
protocol
->
store
(
buf
,
bytes
,
&
my_charset_bin
);
}
#endif
...
...
@@ -1859,9 +1859,10 @@ bool Old_rows_log_event::print_helper(FILE *file,
if
(
!
print_event_info
->
short_form
)
{
char
llbuff
[
22
];
if
(
print_header
(
head
,
print_event_info
,
!
do_print_encoded
)
||
my_b_printf
(
head
,
"
\t
%s: table id %
lu
%s
\n
"
,
name
,
m_table_id
,
my_b_printf
(
head
,
"
\t
%s: table id %
s
%s
\n
"
,
name
,
ullstr
(
m_table_id
,
llbuff
)
,
do_print_encoded
?
" flags: STMT_END_F"
:
""
)
||
print_base64
(
body
,
print_event_info
,
do_print_encoded
))
goto
err
;
...
...
sql/log_event_server.cc
View file @
e20693c1
...
...
@@ -6074,7 +6074,7 @@ bool Rows_log_event::write_data_header()
DBUG_ASSERT
(
m_table_id
!=
UINT32_MAX
);
DBUG_EXECUTE_IF
(
"old_row_based_repl_4_byte_map_id_master"
,
{
int4store
(
buf
+
0
,
m_table_id
);
int4store
(
buf
+
0
,
(
ulong
)
m_table_id
);
int2store
(
buf
+
4
,
m_flags
);
return
(
write_data
(
buf
,
6
));
});
...
...
@@ -6588,7 +6588,7 @@ int Table_map_log_event::do_apply_event(rpl_group_info *rgi)
char
buf
[
256
];
my_snprintf
(
buf
,
sizeof
(
buf
),
"Found table map event mapping table id %u which "
"Found table map event mapping table id %
ll
u which "
"was already mapped but with different settings."
,
table_list
->
table_id
);
...
...
@@ -6633,7 +6633,7 @@ bool Table_map_log_event::write_data_header()
uchar
buf
[
TABLE_MAP_HEADER_LEN
];
DBUG_EXECUTE_IF
(
"old_row_based_repl_4_byte_map_id_master"
,
{
int4store
(
buf
+
0
,
m_table_id
);
int4store
(
buf
+
0
,
(
ulong
)
m_table_id
);
int2store
(
buf
+
4
,
m_flags
);
return
(
write_data
(
buf
,
6
));
});
...
...
@@ -7069,7 +7069,7 @@ void Table_map_log_event::pack_info(Protocol *protocol)
{
char
buf
[
256
];
size_t
bytes
=
my_snprintf
(
buf
,
sizeof
(
buf
),
"table_id: %llu (%s.%s)"
,
"table_id: %llu (%s.%s)"
,
m_table_id
,
m_dbnam
,
m_tblnam
);
protocol
->
store
(
buf
,
bytes
,
&
my_charset_bin
);
}
...
...
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