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
e6fe7d1b
Commit
e6fe7d1b
authored
Apr 23, 2003
by
gluh@gluh.mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Task 761:'mysqlbinlog should not die when reading
unknown event'
parent
767f9a52
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
5 deletions
+43
-5
client/mysqlbinlog.cc
client/mysqlbinlog.cc
+4
-0
sql/log_event.cc
sql/log_event.cc
+21
-1
sql/log_event.h
sql/log_event.h
+18
-4
No files found.
client/mysqlbinlog.cc
View file @
e6fe7d1b
...
@@ -43,6 +43,7 @@ static const char* default_dbug_option = "d:t:o,/tmp/mysqlbinlog.trace";
...
@@ -43,6 +43,7 @@ static const char* default_dbug_option = "d:t:o,/tmp/mysqlbinlog.trace";
void
sql_print_error
(
const
char
*
format
,
...);
void
sql_print_error
(
const
char
*
format
,
...);
static
bool
one_database
=
0
;
static
bool
one_database
=
0
;
static
bool
force_opt
=
0
;
static
const
char
*
database
;
static
const
char
*
database
;
static
bool
short_form
=
0
;
static
bool
short_form
=
0
;
static
ulonglong
offset
=
0
;
static
ulonglong
offset
=
0
;
...
@@ -73,6 +74,9 @@ static struct my_option my_long_options[] =
...
@@ -73,6 +74,9 @@ static struct my_option my_long_options[] =
{
"database"
,
'd'
,
"List entries for just this database (local log only)"
,
{
"database"
,
'd'
,
"List entries for just this database (local log only)"
,
(
gptr
*
)
&
database
,
(
gptr
*
)
&
database
,
0
,
GET_STR_ALLOC
,
REQUIRED_ARG
,
(
gptr
*
)
&
database
,
(
gptr
*
)
&
database
,
0
,
GET_STR_ALLOC
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
0
,
0
,
0
,
0
,
0
,
0
},
{
"force-read"
,
'f'
,
"Force reading unknown binlog events"
,
(
gptr
*
)
&
force_opt
,
(
gptr
*
)
&
force_opt
,
0
,
GET_BOOL
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"help"
,
'?'
,
"Display this help and exit"
,
{
"help"
,
'?'
,
"Display this help and exit"
,
0
,
0
,
0
,
GET_NO_ARG
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
0
,
0
,
0
,
GET_NO_ARG
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"host"
,
'h'
,
"Get the binlog from server"
,
(
gptr
*
)
&
host
,
(
gptr
*
)
&
host
,
{
"host"
,
'h'
,
"Get the binlog from server"
,
(
gptr
*
)
&
host
,
(
gptr
*
)
&
host
,
...
...
sql/log_event.cc
View file @
e6fe7d1b
...
@@ -659,9 +659,18 @@ Log_event* Log_event::read_log_event(const char* buf, int event_len,
...
@@ -659,9 +659,18 @@ Log_event* Log_event::read_log_event(const char* buf, int event_len,
}
}
if
(
!
ev
||
!
ev
->
is_valid
())
if
(
!
ev
||
!
ev
->
is_valid
())
{
{
*
error
=
"Found invalid event in binary log"
;
delete
ev
;
delete
ev
;
#ifdef MYSQL_CLIENT
if
(
!
force_opt
)
{
*
error
=
"Found invalid event in binary log"
;
return
0
;
}
ev
=
new
Unknown_log_event
(
buf
,
old_format
);
#else
*
error
=
"Found invalid event in binary log"
;
return
0
;
return
0
;
#endif
}
}
ev
->
cached_event_len
=
event_len
;
ev
->
cached_event_len
=
event_len
;
return
ev
;
return
ev
;
...
@@ -1695,6 +1704,17 @@ void Execute_load_log_event::pack_info(String* packet)
...
@@ -1695,6 +1704,17 @@ void Execute_load_log_event::pack_info(String* packet)
}
}
#endif
#endif
#ifdef MYSQL_CLIENT
void
Unknown_log_event
::
print
(
FILE
*
file
,
bool
short_form
,
char
*
last_db
)
{
if
(
short_form
)
return
;
print_header
(
file
);
fputc
(
'\n'
,
file
);
fprintf
(
file
,
"# %s"
,
"Unknown event
\n
"
);
}
#endif
#ifndef MYSQL_CLIENT
#ifndef MYSQL_CLIENT
int
Query_log_event
::
exec_event
(
struct
st_relay_log_info
*
rli
)
int
Query_log_event
::
exec_event
(
struct
st_relay_log_info
*
rli
)
{
{
...
...
sql/log_event.h
View file @
e6fe7d1b
...
@@ -201,10 +201,10 @@ struct sql_ex_info
...
@@ -201,10 +201,10 @@ struct sql_ex_info
enum
Log_event_type
enum
Log_event_type
{
{
START_EVENT
=
1
,
QUERY_EVENT
=
2
,
STOP_EVENT
=
3
,
ROTATE_EVENT
=
4
,
UNKNOWN_EVENT
=
0
,
START_EVENT
=
1
,
QUERY_EVENT
=
2
,
STOP_EVENT
=
3
,
INTVAR_EVENT
=
5
,
LOAD_EVENT
=
6
,
SLAVE_EVENT
=
7
,
CREATE_FILE_EVENT
=
8
,
ROTATE_EVENT
=
4
,
INTVAR_EVENT
=
5
,
LOAD_EVENT
=
6
,
SLAVE_EVENT
=
7
,
APPEND_BLOCK_EVENT
=
9
,
EXEC_LOAD_EVENT
=
10
,
DELETE_FILE_EVENT
=
11
,
CREATE_FILE_EVENT
=
8
,
APPEND_BLOCK_EVENT
=
9
,
EXEC_LOAD_EVENT
=
10
,
NEW_LOAD_EVENT
=
12
,
RAND_EVENT
=
13
DELETE_FILE_EVENT
=
11
,
NEW_LOAD_EVENT
=
12
,
RAND_EVENT
=
13
};
};
enum
Int_event_type
enum
Int_event_type
...
@@ -714,4 +714,18 @@ class Execute_load_log_event: public Log_event
...
@@ -714,4 +714,18 @@ class Execute_load_log_event: public Log_event
int
write_data
(
IO_CACHE
*
file
);
int
write_data
(
IO_CACHE
*
file
);
};
};
#ifdef MYSQL_CLIENT
class
Unknown_log_event
:
public
Log_event
{
public:
Unknown_log_event
(
const
char
*
buf
,
bool
old_format
)
:
Log_event
(
buf
,
old_format
)
{}
~
Unknown_log_event
()
{}
void
print
(
FILE
*
file
,
bool
short_form
=
0
,
char
*
last_db
=
0
);
Log_event_type
get_type_code
()
{
return
UNKNOWN_EVENT
;}
bool
is_valid
()
{
return
1
;
}
};
#endif
#endif
/* _log_event_h */
#endif
/* _log_event_h */
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