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
9747c33b
Commit
9747c33b
authored
Mar 08, 2012
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql-5.1 to mysql-5.5.
parents
84c6c759
c5511bdf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
21 deletions
+49
-21
storage/innobase/btr/btr0pcur.c
storage/innobase/btr/btr0pcur.c
+49
-21
No files found.
storage/innobase/btr/btr0pcur.c
View file @
9747c33b
/*****************************************************************************
/*****************************************************************************
Copyright (c) 1996, 201
1
, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 1996, 201
2
, Oracle and/or its affiliates. All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
the terms of the GNU General Public License as published by the Free Software
...
@@ -133,6 +133,8 @@ btr_pcur_store_position(
...
@@ -133,6 +133,8 @@ btr_pcur_store_position(
ut_a
(
btr_page_get_next
(
page
,
mtr
)
==
FIL_NULL
);
ut_a
(
btr_page_get_next
(
page
,
mtr
)
==
FIL_NULL
);
ut_a
(
btr_page_get_prev
(
page
,
mtr
)
==
FIL_NULL
);
ut_a
(
btr_page_get_prev
(
page
,
mtr
)
==
FIL_NULL
);
ut_ad
(
page_is_leaf
(
page
));
ut_ad
(
page_get_page_no
(
page
)
==
index
->
page
);
cursor
->
old_stored
=
BTR_PCUR_OLD_STORED
;
cursor
->
old_stored
=
BTR_PCUR_OLD_STORED
;
...
@@ -325,13 +327,20 @@ btr_pcur_restore_position_func(
...
@@ -325,13 +327,20 @@ btr_pcur_restore_position_func(
/* Save the old search mode of the cursor */
/* Save the old search mode of the cursor */
old_mode
=
cursor
->
search_mode
;
old_mode
=
cursor
->
search_mode
;
if
(
UNIV_LIKELY
(
cursor
->
rel_pos
==
BTR_PCUR_ON
))
{
switch
(
cursor
->
rel_pos
)
{
case
BTR_PCUR_ON
:
mode
=
PAGE_CUR_LE
;
mode
=
PAGE_CUR_LE
;
}
else
if
(
cursor
->
rel_pos
==
BTR_PCUR_AFTER
)
{
break
;
case
BTR_PCUR_AFTER
:
mode
=
PAGE_CUR_G
;
mode
=
PAGE_CUR_G
;
}
else
{
break
;
ut_ad
(
cursor
->
rel_pos
==
BTR_PCUR_BEFORE
);
case
BTR_PCUR_BEFORE
:
mode
=
PAGE_CUR_L
;
mode
=
PAGE_CUR_L
;
break
;
#ifdef UNIV_DEBUG
default:
ut_error
;
#endif
/* UNIV_DEBUG */
}
}
btr_pcur_open_with_no_init_func
(
index
,
tuple
,
mode
,
latch_mode
,
btr_pcur_open_with_no_init_func
(
index
,
tuple
,
mode
,
latch_mode
,
...
@@ -340,25 +349,44 @@ btr_pcur_restore_position_func(
...
@@ -340,25 +349,44 @@ btr_pcur_restore_position_func(
/* Restore the old search mode */
/* Restore the old search mode */
cursor
->
search_mode
=
old_mode
;
cursor
->
search_mode
=
old_mode
;
if
(
cursor
->
rel_pos
==
BTR_PCUR_ON
if
(
btr_pcur_is_on_user_rec
(
cursor
))
{
&&
btr_pcur_is_on_user_rec
(
cursor
)
switch
(
cursor
->
rel_pos
)
{
&&
0
==
cmp_dtuple_rec
(
tuple
,
btr_pcur_get_rec
(
cursor
),
case
BTR_PCUR_ON
:
rec_get_offsets
(
if
(
!
cmp_dtuple_rec
(
btr_pcur_get_rec
(
cursor
),
index
,
tuple
,
btr_pcur_get_rec
(
cursor
),
NULL
,
ULINT_UNDEFINED
,
&
heap
)))
{
rec_get_offsets
(
btr_pcur_get_rec
(
cursor
),
index
,
NULL
,
ULINT_UNDEFINED
,
&
heap
)))
{
/* We have to store the NEW value for
the modify clock, since the cursor can
now be on a different page! But we can
retain the value of old_rec */
cursor
->
block_when_stored
=
btr_pcur_get_block
(
cursor
);
cursor
->
modify_clock
=
buf_block_get_modify_clock
(
cursor
->
block_when_stored
);
cursor
->
old_stored
=
BTR_PCUR_OLD_STORED
;
/* We have to store the NEW value for the modify clock, since
mem_heap_free
(
heap
);
the cursor can now be on a different page! But we can retain
the value of old_rec */
cursor
->
block_when_stored
=
btr_pcur_get_block
(
cursor
);
cursor
->
modify_clock
=
buf_block_get_modify_clock
(
cursor
->
block_when_stored
);
cursor
->
old_stored
=
BTR_PCUR_OLD_STORED
;
mem_heap_free
(
heap
);
return
(
TRUE
);
}
return
(
TRUE
);
break
;
case
BTR_PCUR_BEFORE
:
page_cur_move_to_next
(
btr_pcur_get_page_cur
(
cursor
));
break
;
case
BTR_PCUR_AFTER
:
page_cur_move_to_prev
(
btr_pcur_get_page_cur
(
cursor
));
break
;
#ifdef UNIV_DEBUG
default:
ut_error
;
#endif
/* UNIV_DEBUG */
}
}
}
mem_heap_free
(
heap
);
mem_heap_free
(
heap
);
...
...
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