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
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
Show 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()
...
@@ -644,6 +644,8 @@ int DsMrr_impl::dsmrr_fill_rowid_buffer()
rowid_buffer
.
reset_for_writing
();
rowid_buffer
.
reset_for_writing
();
identical_rowid_ptr
=
NULL
;
identical_rowid_ptr
=
NULL
;
if
(
do_sort_keys
)
key_buffer
.
flip
();
while
(
rowid_buffer
.
have_space_for
(
rowid_buff_elem_size
))
while
(
rowid_buffer
.
have_space_for
(
rowid_buff_elem_size
))
{
{
...
@@ -860,13 +862,16 @@ void DsMrr_impl::dsmrr_fill_key_buffer()
...
@@ -860,13 +862,16 @@ void DsMrr_impl::dsmrr_fill_key_buffer()
setup_buffer_sizes
(
&
cur_range
.
start_key
);
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 */
/* Put key, or {key, range_id} pair into the buffer */
if
(
use_key_pointers
)
if
(
use_key_pointers
)
key_buffer
.
write
((
uchar
*
)
&
cur_range
.
start_key
.
key
,
sizeof
(
char
*
));
key_buffer
.
write
((
uchar
*
)
&
cur_range
.
start_key
.
key
,
sizeof
(
char
*
));
else
else
key_buffer
.
write
(
cur_range
.
start_key
.
key
,
key_tuple_length
);
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
*
));
key_buffer
.
write
((
uchar
*
)
&
cur_range
.
ptr
,
sizeof
(
void
*
));
}
}
...
@@ -966,7 +971,6 @@ check_record:
...
@@ -966,7 +971,6 @@ check_record:
}
}
goto
check_record
;
goto
check_record
;
// goto read_and_check;
}
}
while
(
1
)
while
(
1
)
...
@@ -999,6 +1003,7 @@ check_record:
...
@@ -999,6 +1003,7 @@ check_record:
res
=
HA_ERR_END_OF_FILE
;
res
=
HA_ERR_END_OF_FILE
;
goto
end
;
goto
end
;
}
}
if
(
!
do_rowid_fetch
)
dsmrr_fill_key_buffer
();
dsmrr_fill_key_buffer
();
if
(
!
key_buffer
.
have_data
(
key_buff_elem_size
))
if
(
!
key_buffer
.
have_data
(
key_buff_elem_size
))
{
{
...
...
sql/multi_range_read.h
View file @
d098596b
...
@@ -102,14 +102,25 @@ public:
...
@@ -102,14 +102,25 @@ public:
{
{
*
unused_start
=
start
;
*
unused_start
=
start
;
*
unused_end
=
read_pos
;
*
unused_end
=
read_pos
;
start
=
read_pos
;
}
}
else
else
{
{
*
unused_start
=
read_pos
;
*
unused_start
=
read_pos
;
*
unused_end
=
end
;
*
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
)
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