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
d098596b
Commit
d098596b
authored
Aug 12, 2010
by
Sergey Petrunya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a number of problems with reverse buffer use
parent
8d07c16a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
5 deletions
+21
-5
sql/multi_range_read.cc
sql/multi_range_read.cc
+8
-3
sql/multi_range_read.h
sql/multi_range_read.h
+13
-2
No files found.
sql/multi_range_read.cc
View file @
d098596b
...
...
@@ -644,6 +644,8 @@ int DsMrr_impl::dsmrr_fill_rowid_buffer()
rowid_buffer
.
reset_for_writing
();
identical_rowid_ptr
=
NULL
;
if
(
do_sort_keys
)
key_buffer
.
flip
();
while
(
rowid_buffer
.
have_space_for
(
rowid_buff_elem_size
))
{
...
...
@@ -860,13 +862,16 @@ void DsMrr_impl::dsmrr_fill_key_buffer()
setup_buffer_sizes
(
&
cur_range
.
start_key
);
}
if
(
key_buffer
.
is_reverse
()
&&
is_mrr_assoc
)
key_buffer
.
write
((
uchar
*
)
&
cur_range
.
ptr
,
sizeof
(
void
*
));
/* Put key, or {key, range_id} pair into the buffer */
if
(
use_key_pointers
)
key_buffer
.
write
((
uchar
*
)
&
cur_range
.
start_key
.
key
,
sizeof
(
char
*
));
else
key_buffer
.
write
(
cur_range
.
start_key
.
key
,
key_tuple_length
);
if
(
is_mrr_assoc
)
if
(
!
key_buffer
.
is_reverse
()
&&
is_mrr_assoc
)
key_buffer
.
write
((
uchar
*
)
&
cur_range
.
ptr
,
sizeof
(
void
*
));
}
...
...
@@ -966,7 +971,6 @@ int DsMrr_impl::dsmrr_next_from_index(char **range_info_arg)
}
goto
check_record
;
// goto read_and_check;
}
while
(
1
)
...
...
@@ -999,7 +1003,8 @@ int DsMrr_impl::dsmrr_next_from_index(char **range_info_arg)
res
=
HA_ERR_END_OF_FILE
;
goto
end
;
}
dsmrr_fill_key_buffer
();
if
(
!
do_rowid_fetch
)
dsmrr_fill_key_buffer
();
if
(
!
key_buffer
.
have_data
(
key_buff_elem_size
))
{
res
=
HA_ERR_END_OF_FILE
;
...
...
sql/multi_range_read.h
View file @
d098596b
...
...
@@ -102,14 +102,25 @@ class SimpleBuffer
{
*
unused_start
=
start
;
*
unused_end
=
read_pos
;
start
=
read_pos
;
}
else
{
*
unused_start
=
read_pos
;
*
unused_end
=
end
;
*
unused_start
=
read_pos
;
*
unused_end
=
end
;
end
=
read_pos
;
}
}
void
flip
()
{
uchar
*
tmp
=
read_pos
;
read_pos
=
write_pos
;
write_pos
=
tmp
;
direction
=
-
direction
;
}
bool
is_reverse
()
{
return
direction
==
-
1
;
}
void
grow
(
uchar
*
unused_start
,
uchar
*
unused_end
)
{
/*
...
...
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