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
d5281263
Commit
d5281263
authored
Nov 16, 2000
by
sasha@mysql.sashanet.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed bugs in IO_CACHE and Load_event constructor. The code now passes
replication test suite
parent
02ee7434
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
12 deletions
+17
-12
mysys/mf_iocache2.c
mysys/mf_iocache2.c
+1
-1
sql/log_event.cc
sql/log_event.cc
+5
-5
sql/mf_iocache.cc
sql/mf_iocache.cc
+11
-6
No files found.
mysys/mf_iocache2.c
View file @
d5281263
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
void
my_b_seek
(
IO_CACHE
*
info
,
my_off_t
pos
)
void
my_b_seek
(
IO_CACHE
*
info
,
my_off_t
pos
)
{
{
info
->
seek_not_done
=
0
;
info
->
seek_not_done
=
1
;
info
->
pos_in_file
=
pos
;
info
->
pos_in_file
=
pos
;
info
->
rc_pos
=
info
->
rc_end
=
info
->
buffer
;
info
->
rc_pos
=
info
->
rc_end
=
info
->
buffer
;
}
}
...
...
sql/log_event.cc
View file @
d5281263
...
@@ -256,7 +256,7 @@ void Log_event::print_header(FILE* file)
...
@@ -256,7 +256,7 @@ void Log_event::print_header(FILE* file)
{
{
fputc
(
'#'
,
file
);
fputc
(
'#'
,
file
);
print_timestamp
(
file
);
print_timestamp
(
file
);
fprintf
(
file
,
" server id %
l
d "
,
server_id
);
fprintf
(
file
,
" server id %d "
,
server_id
);
}
}
void
Log_event
::
print_timestamp
(
FILE
*
file
,
time_t
*
ts
)
void
Log_event
::
print_timestamp
(
FILE
*
file
,
time_t
*
ts
)
...
@@ -418,7 +418,7 @@ Query_log_event::Query_log_event(IO_CACHE* file, time_t when_arg,
...
@@ -418,7 +418,7 @@ Query_log_event::Query_log_event(IO_CACHE* file, time_t when_arg,
Query_log_event
::
Query_log_event
(
const
char
*
buf
,
int
event_len
)
:
Query_log_event
::
Query_log_event
(
const
char
*
buf
,
int
event_len
)
:
Log_event
(
buf
),
data_buf
(
0
),
query
(
NULL
),
db
(
NULL
)
Log_event
(
buf
),
data_buf
(
0
),
query
(
NULL
),
db
(
NULL
)
{
{
if
(
event_len
<
QUERY_EVENT_OVERHEAD
)
if
(
(
uint
)
event_len
<
QUERY_EVENT_OVERHEAD
)
return
;
return
;
ulong
data_len
;
ulong
data_len
;
buf
+=
EVENT_LEN_OFFSET
;
buf
+=
EVENT_LEN_OFFSET
;
...
@@ -577,10 +577,10 @@ Load_log_event::Load_log_event(const char* buf, int event_len):
...
@@ -577,10 +577,10 @@ Load_log_event::Load_log_event(const char* buf, int event_len):
{
{
ulong
data_len
;
ulong
data_len
;
if
(
event_len
<
(
LOAD_EVENT_OVERHEAD
+
LOG_EVENT_HEADER_LEN
))
if
(
(
uint
)
event_len
<
(
LOAD_EVENT_OVERHEAD
+
LOG_EVENT_HEADER_LEN
))
return
;
return
;
buf
+=
EVENT_LEN_OFFSET
;
buf
+=
EVENT_LEN_OFFSET
;
memcpy
(
&
sql_ex
,
buf
+
LOAD_HEADER_LEN
+
4
,
sizeof
(
sql_ex
));
data_len
=
event_len
;
data_len
=
event_len
;
if
(
!
(
data_buf
=
(
char
*
)
my_malloc
(
data_len
+
1
,
MYF
(
MY_WME
))))
if
(
!
(
data_buf
=
(
char
*
)
my_malloc
(
data_len
+
1
,
MYF
(
MY_WME
))))
...
@@ -671,7 +671,7 @@ void Load_log_event::print(FILE* file, bool short_form)
...
@@ -671,7 +671,7 @@ void Load_log_event::print(FILE* file, bool short_form)
}
}
if
((
int
)
skip_lines
>
0
)
if
((
int
)
skip_lines
>
0
)
fprintf
(
file
,
" IGNORE %
l
d LINES "
,
skip_lines
);
fprintf
(
file
,
" IGNORE %d LINES "
,
skip_lines
);
if
(
num_fields
)
if
(
num_fields
)
{
{
...
...
sql/mf_iocache.cc
View file @
d5281263
...
@@ -241,11 +241,16 @@ int _my_b_read(register IO_CACHE *info, byte *Buffer, uint Count)
...
@@ -241,11 +241,16 @@ int _my_b_read(register IO_CACHE *info, byte *Buffer, uint Count)
uint
length
,
diff_length
,
left_length
;
uint
length
,
diff_length
,
left_length
;
my_off_t
max_length
,
pos_in_file
;
my_off_t
max_length
,
pos_in_file
;
if
((
left_length
=
(
uint
)
(
info
->
rc_end
-
info
->
rc_pos
)))
{
if
(
Count
<
left_length
)
left_length
=
Count
;
memcpy
(
Buffer
,
info
->
rc_pos
,
memcpy
(
Buffer
,
info
->
rc_pos
,
(
size_t
)
(
left_length
=
(
uint
)
(
info
->
rc_end
-
info
->
rc_pos
)
));
(
size_t
)
(
left_length
));
Buffer
+=
left_length
;
Buffer
+=
left_length
;
Count
-=
left_length
;
Count
-=
left_length
;
pos_in_file
=
info
->
pos_in_file
+
(
uint
)
(
info
->
rc_end
-
info
->
buffer
);
}
pos_in_file
=
info
->
pos_in_file
+
left_length
;
if
(
info
->
seek_not_done
)
if
(
info
->
seek_not_done
)
{
/* File touched, do seek */
{
/* File touched, do seek */
VOID
(
my_seek
(
info
->
file
,
pos_in_file
,
MY_SEEK_SET
,
MYF
(
0
)));
VOID
(
my_seek
(
info
->
file
,
pos_in_file
,
MY_SEEK_SET
,
MYF
(
0
)));
...
...
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