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
14ca0468
Commit
14ca0468
authored
Dec 10, 2010
by
Sergey Petrunya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix crashes on sparc-32 bit: use memcpy when we need to access non-aligned
pointers.
parent
a86599e1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
8 deletions
+16
-8
sql/multi_range_read.cc
sql/multi_range_read.cc
+16
-8
No files found.
sql/multi_range_read.cc
View file @
14ca0468
...
@@ -359,9 +359,10 @@ int Mrr_ordered_index_reader::get_next(char **range_info)
...
@@ -359,9 +359,10 @@ int Mrr_ordered_index_reader::get_next(char **range_info)
kv_it
.
move_to_next_key_value
();
kv_it
.
move_to_next_key_value
();
continue
;
continue
;
}
}
char
*
range_info
;
if
(
!
skip_index_tuple
(
*
(
char
**
)
cur_range_info
)
&&
memcpy
(
&
range_info
,
cur_range_info
,
sizeof
(
char
*
));
!
skip_record
(
*
(
char
**
)
cur_range_info
,
NULL
))
if
(
!
skip_index_tuple
(
range_info
)
&&
!
skip_record
(
range_info
,
NULL
))
{
{
break
;
break
;
}
}
...
@@ -1051,17 +1052,24 @@ void DsMrr_impl::dsmrr_close()
...
@@ -1051,17 +1052,24 @@ void DsMrr_impl::dsmrr_close()
my_qsort2-compatible static member function to compare key tuples
my_qsort2-compatible static member function to compare key tuples
*/
*/
int
Mrr_ordered_index_reader
::
compare_keys
(
void
*
arg
,
uchar
*
key1
,
uchar
*
key2
)
int
Mrr_ordered_index_reader
::
compare_keys
(
void
*
arg
,
uchar
*
key1_arg
,
uchar
*
key2_arg
)
{
{
Mrr_ordered_index_reader
*
reader
=
(
Mrr_ordered_index_reader
*
)
arg
;
Mrr_ordered_index_reader
*
reader
=
(
Mrr_ordered_index_reader
*
)
arg
;
TABLE
*
table
=
reader
->
file
->
get_table
();
TABLE
*
table
=
reader
->
file
->
get_table
();
KEY_PART_INFO
*
part
=
table
->
key_info
[
reader
->
file
->
active_index
].
key_part
;
KEY_PART_INFO
*
part
=
table
->
key_info
[
reader
->
file
->
active_index
].
key_part
;
uchar
*
key1
,
*
key2
;
if
(
reader
->
keypar
.
use_key_pointers
)
if
(
reader
->
keypar
.
use_key_pointers
)
{
{
/* the buffer stores pointers to keys, get to the keys */
/* the buffer stores pointers to keys, get to the keys */
key1
=
*
((
uchar
**
)
key1
);
memcpy
(
&
key1
,
key1_arg
,
sizeof
(
char
*
));
key2
=
*
((
uchar
**
)
key2
);
// todo is this alignment-safe?
memcpy
(
&
key2
,
key2_arg
,
sizeof
(
char
*
));
}
else
{
key1
=
key1_arg
;
key2
=
key2_arg
;
}
}
return
key_tuple_cmp
(
part
,
key1
,
key2
,
reader
->
keypar
.
key_tuple_length
);
return
key_tuple_cmp
(
part
,
key1
,
key2
,
reader
->
keypar
.
key_tuple_length
);
...
@@ -1211,7 +1219,7 @@ int Key_value_records_iterator::init(Mrr_ordered_index_reader *owner_arg)
...
@@ -1211,7 +1219,7 @@ int Key_value_records_iterator::init(Mrr_ordered_index_reader *owner_arg)
last_identical_key_ptr
=
cur_index_tuple
;
last_identical_key_ptr
=
cur_index_tuple
;
if
(
owner
->
keypar
.
use_key_pointers
)
if
(
owner
->
keypar
.
use_key_pointers
)
cur_index_tuple
=
*
((
uchar
**
)
cur_index_tuple
);
memcpy
(
&
cur_index_tuple
,
key_in_buf
,
sizeof
(
char
*
)
);
/* Check out how many more identical keys are following */
/* Check out how many more identical keys are following */
uchar
*
save_cur_index_tuple
=
cur_index_tuple
;
uchar
*
save_cur_index_tuple
=
cur_index_tuple
;
...
...
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