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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
7da3818f
Commit
7da3818f
authored
Aug 23, 2000
by
sasha@mysql.sashanet.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replication fixes
parent
0c46a399
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
23 deletions
+21
-23
sql/log_event.cc
sql/log_event.cc
+4
-8
sql/log_event.h
sql/log_event.h
+13
-13
sql/slave.cc
sql/slave.cc
+4
-2
No files found.
sql/log_event.cc
View file @
7da3818f
...
...
@@ -23,9 +23,9 @@
#endif
/* MYSQL_CLIENT */
#define LOG_EVENT_HEADER_LEN 9
#define QUERY_HEADER_LEN (sizeof(uint
) + sizeof(uint
) + sizeof(uchar))
#define LOAD_HEADER_LEN (sizeof(uint
) + sizeof(uint
) + \
+ sizeof(uint
) + 2 + sizeof(uint
))
#define QUERY_HEADER_LEN (sizeof(uint
32) + sizeof(uint32
) + sizeof(uchar))
#define LOAD_HEADER_LEN (sizeof(uint
32) + sizeof(uint32
) + \
+ sizeof(uint
32) + 2 + sizeof(uint32
))
#define EVENT_LEN_OFFSET 5
#define EVENT_TYPE_OFFSET 4
#define MAX_EVENT_LEN 4*1024*1024
...
...
@@ -71,11 +71,7 @@ int Log_event::write_header(FILE* file)
int4store
(
pos
,
when
);
// timestamp
pos
+=
4
;
*
pos
++
=
get_type_code
();
// event type code
int4store
(
pos
,
get_data_size
()
+
sizeof
(
time_t
)
// timestamp
+
sizeof
(
char
)
// event code
+
sizeof
(
uint
)
// event entry size
);
int4store
(
pos
,
get_data_size
()
+
LOG_EVENT_HEADER_LEN
);
pos
+=
4
;
return
(
my_fwrite
(
file
,
(
byte
*
)
buf
,
(
uint
)
(
pos
-
buf
),
MYF
(
MY_NABP
|
MY_WME
)));
...
...
sql/log_event.h
View file @
7da3818f
...
...
@@ -85,10 +85,10 @@ protected:
public:
const
char
*
query
;
const
char
*
db
;
uint
q_len
;
// if we already know the length of the query string
uint
32
q_len
;
// if we already know the length of the query string
// we pass it here, so we would not have to call strlen()
// otherwise, set it to 0, in which case, we compute it with strlen()
uint
db_len
;
uint
32
db_len
;
int
thread_id
;
#if !defined(MYSQL_CLIENT)
THD
*
thd
;
...
...
@@ -101,7 +101,7 @@ public:
time
(
&
end_time
);
exec_time
=
(
ulong
)
(
end_time
-
thd
->
start_time
);
valid_exec_time
=
1
;
db_len
=
(
db
)
?
(
uint
)
strlen
(
db
)
:
0
;
db_len
=
(
db
)
?
(
uint
32
)
strlen
(
db
)
:
0
;
}
#endif
...
...
@@ -120,8 +120,8 @@ public:
int
get_data_size
()
{
return
q_len
+
db_len
+
2
+
sizeof
(
uint
)
// thread_id
+
sizeof
(
uint
)
// exec_time
sizeof
(
uint
32
)
// thread_id
+
sizeof
(
uint
32
)
// exec_time
;
}
...
...
@@ -157,19 +157,19 @@ protected:
char
*
data_buf
;
public:
int
thread_id
;
uint
table_name_len
;
uint
db_len
;
uint
fname_len
;
uint
num_fields
;
uint
32
table_name_len
;
uint
32
db_len
;
uint
32
fname_len
;
uint
32
num_fields
;
const
char
*
fields
;
const
uchar
*
field_lens
;
uint
field_block_len
;
uint
32
field_block_len
;
const
char
*
table_name
;
const
char
*
db
;
const
char
*
fname
;
uint
skip_lines
;
uint
32
skip_lines
;
sql_ex_info
sql_ex
;
#if !defined(MYSQL_CLIENT)
...
...
@@ -189,8 +189,8 @@ public:
time
(
&
end_time
);
exec_time
=
(
ulong
)
(
end_time
-
thd
->
start_time
);
valid_exec_time
=
1
;
db_len
=
(
db
)
?
(
uint
)
strlen
(
db
)
:
0
;
table_name_len
=
(
table_name
)
?
(
uint
)
strlen
(
table_name
)
:
0
;
db_len
=
(
db
)
?
(
uint
32
)
strlen
(
db
)
:
0
;
table_name_len
=
(
table_name
)
?
(
uint
32
)
strlen
(
table_name
)
:
0
;
fname_len
=
(
fname
)
?
(
uint
)
strlen
(
fname
)
:
0
;
sql_ex
.
field_term
=
(
*
ex
->
field_term
)[
0
];
sql_ex
.
enclosed
=
(
*
ex
->
enclosed
)[
0
];
...
...
sql/slave.cc
View file @
7da3818f
...
...
@@ -372,9 +372,11 @@ int show_master_info(THD* thd)
int
flush_master_info
(
MASTER_INFO
*
mi
)
{
FILE
*
file
=
mi
->
file
;
char
lbuf
[
22
];
if
(
my_fseek
(
file
,
0L
,
MY_SEEK_SET
,
MYF
(
MY_WME
))
==
MY_FILEPOS_ERROR
||
fprintf
(
file
,
"%s
\n
%
ld
\n
%s
\n
%s
\n
%s
\n
%d
\n
%d
\n
"
,
mi
->
log_file_name
,
mi
->
pos
,
mi
->
host
,
mi
->
user
,
mi
->
password
,
fprintf
(
file
,
"%s
\n
%
s
\n
%s
\n
%s
\n
%s
\n
%d
\n
%d
\n
"
,
mi
->
log_file_name
,
llstr
(
mi
->
pos
,
lbuf
)
,
mi
->
host
,
mi
->
user
,
mi
->
password
,
mi
->
port
,
mi
->
connect_retry
)
<
0
||
fflush
(
file
))
{
...
...
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