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
ceb444fa
Commit
ceb444fa
authored
Nov 09, 2007
by
istruewing@stella.local
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-5.1-engines
into stella.local:/home2/mydev/mysql-5.1-bug22351
parents
b8a3c91b
9de5a242
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
1 deletion
+42
-1
sql/handler.cc
sql/handler.cc
+42
-1
No files found.
sql/handler.cc
View file @
ceb444fa
...
@@ -2522,15 +2522,56 @@ int ha_enable_transaction(THD *thd, bool on)
...
@@ -2522,15 +2522,56 @@ int ha_enable_transaction(THD *thd, bool on)
int
handler
::
index_next_same
(
uchar
*
buf
,
const
uchar
*
key
,
uint
keylen
)
int
handler
::
index_next_same
(
uchar
*
buf
,
const
uchar
*
key
,
uint
keylen
)
{
{
int
error
;
int
error
;
DBUG_ENTER
(
"index_next_same"
);
if
(
!
(
error
=
index_next
(
buf
)))
if
(
!
(
error
=
index_next
(
buf
)))
{
{
my_ptrdiff_t
ptrdiff
=
buf
-
table
->
record
[
0
];
uchar
*
save_record_0
;
KEY
*
key_info
;
KEY_PART_INFO
*
key_part
;
KEY_PART_INFO
*
key_part_end
;
LINT_INIT
(
save_record_0
);
LINT_INIT
(
key_info
);
LINT_INIT
(
key_part
);
LINT_INIT
(
key_part_end
);
/*
key_cmp_if_same() compares table->record[0] against 'key'.
In parts it uses table->record[0] directly, in parts it uses
field objects with their local pointers into table->record[0].
If 'buf' is distinct from table->record[0], we need to move
all record references. This is table->record[0] itself and
the field pointers of the fields used in this key.
*/
if
(
ptrdiff
)
{
save_record_0
=
table
->
record
[
0
];
table
->
record
[
0
]
=
buf
;
key_info
=
table
->
key_info
+
active_index
;
key_part
=
key_info
->
key_part
;
key_part_end
=
key_part
+
key_info
->
key_parts
;
for
(;
key_part
<
key_part_end
;
key_part
++
)
{
DBUG_ASSERT
(
key_part
->
field
);
key_part
->
field
->
move_field_offset
(
ptrdiff
);
}
}
if
(
key_cmp_if_same
(
table
,
key
,
active_index
,
keylen
))
if
(
key_cmp_if_same
(
table
,
key
,
active_index
,
keylen
))
{
{
table
->
status
=
STATUS_NOT_FOUND
;
table
->
status
=
STATUS_NOT_FOUND
;
error
=
HA_ERR_END_OF_FILE
;
error
=
HA_ERR_END_OF_FILE
;
}
}
/* Move back if necessary. */
if
(
ptrdiff
)
{
table
->
record
[
0
]
=
save_record_0
;
for
(
key_part
=
key_info
->
key_part
;
key_part
<
key_part_end
;
key_part
++
)
key_part
->
field
->
move_field_offset
(
-
ptrdiff
);
}
}
}
return
error
;
DBUG_RETURN
(
error
)
;
}
}
...
...
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