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
01d1e68b
Commit
01d1e68b
authored
Oct 31, 2010
by
Sergey Petrunya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DS-MRR/CPK improvements: correct buffer exhaustion handling
parent
67a514da
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
12 deletions
+25
-12
sql/multi_range_read.cc
sql/multi_range_read.cc
+15
-10
sql/multi_range_read.h
sql/multi_range_read.h
+10
-2
No files found.
sql/multi_range_read.cc
View file @
01d1e68b
...
...
@@ -484,7 +484,7 @@ int Mrr_ordered_index_reader::refill_buffer()
scanning_key_val_iter
=
FALSE
;
index_scan_eof
=
FALSE
;
DBUG_RETURN
(
0
);
DBUG_RETURN
(
(
no_more_keys
&&
key_buffer
->
is_empty
())
?
HA_ERR_END_OF_FILE
:
0
);
}
...
...
@@ -522,7 +522,10 @@ int Mrr_ordered_rndpos_reader::init(handler *h_arg,
//if (!(mode & HA_MRR_NO_ASSOCIATION))
// rowid_buff_elem_size += sizeof(char*);
return
index_reader
->
refill_buffer
();
int
res
=
index_reader
->
refill_buffer
();
if
(
res
&&
res
!=
HA_ERR_END_OF_FILE
)
return
res
;
return
0
;
}
...
...
@@ -561,7 +564,7 @@ int Mrr_ordered_rndpos_reader::refill_buffer()
last_identical_rowid
=
NULL
;
if
(
index_reader
->
eof
())
DBUG_RETURN
(
0
);
DBUG_RETURN
(
HA_ERR_END_OF_FILE
);
while
(
rowid_buffer
->
can_write
())
{
...
...
@@ -586,7 +589,7 @@ int Mrr_ordered_rndpos_reader::refill_buffer()
rowid_buffer
->
setup_reading
(
&
rowid
,
h
->
ref_length
,
is_mrr_assoc
?
(
uchar
**
)
&
rowids_range_id
:
NULL
,
sizeof
(
void
*
));
DBUG_RETURN
(
0
);
DBUG_RETURN
(
(
rowid_buffer
->
is_empty
()
&&
res
)
?
HA_ERR_END_OF_FILE
:
0
);
}
...
...
@@ -632,8 +635,9 @@ int Mrr_ordered_rndpos_reader::get_next(char **range_info)
/* First, finish off the sorted keys we have */
if
(
!
index_reader
->
eof
())
{
if
((
res
=
refill_buffer
()))
return
res
;
/* for fatal errors */
res
=
refill_buffer
();
if
(
res
&&
res
!=
HA_ERR_END_OF_FILE
)
return
res
;
}
if
(
rowid_buffer
->
is_empty
())
...
...
@@ -822,7 +826,8 @@ int DsMrr_impl::dsmrr_init(handler *h_arg, RANGE_SEQ_IF *seq_funcs,
}
}
if
(
strategy
->
refill_buffer
())
res
=
strategy
->
refill_buffer
();
if
(
res
&&
res
!=
HA_ERR_END_OF_FILE
)
goto
error
;
/*
...
...
sql/multi_range_read.h
View file @
01d1e68b
...
...
@@ -126,8 +126,16 @@ class Buffer_manager
index tuple or a table record.
Getting HA_ERR_END_OF_FILE from get_next() means that the source should be
re-filled. if eof() returns true after refill attempt, then the end of
re-filled.
Was:
if eof() returns true after refill attempt, then the end of
stream has been reached and get_next() must not be called anymore.
Now:
if refill_buffer() returns HA_ERR_END_OF_FILE that means the stream is
really exhausted.
*/
class
Mrr_reader
...
...
@@ -168,7 +176,7 @@ class Mrr_simple_index_reader : public Mrr_index_reader
void
*
seq_init_param
,
uint
n_ranges
,
uint
mode
,
Buffer_manager
*
buf_manager_arg
);
int
get_next
(
char
**
range_info
);
int
refill_buffer
()
{
return
0
;
}
int
refill_buffer
()
{
return
HA_ERR_END_OF_FILE
;
}
bool
eof
()
{
return
test
(
res
);
}
uchar
*
get_rowid_ptr
()
{
return
h
->
ref
;
}
bool
skip_record
(
char
*
range_id
,
uchar
*
rowid
)
...
...
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