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
2ab37b2a
Commit
2ab37b2a
authored
Mar 25, 2010
by
Sergey Vojtovich
Browse files
Options
Browse Files
Download
Plain Diff
Merge fix for BUG51877 to mysql-5.1-bugteam.
parents
bf733b47
ba33a335
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
8 deletions
+55
-8
mysql-test/r/gis-rtree.result
mysql-test/r/gis-rtree.result
+7
-0
mysql-test/r/handler_myisam.result
mysql-test/r/handler_myisam.result
+13
-0
mysql-test/t/gis-rtree.test
mysql-test/t/gis-rtree.test
+8
-7
mysql-test/t/handler_myisam.test
mysql-test/t/handler_myisam.test
+11
-0
storage/myisam/mi_rnext.c
storage/myisam/mi_rnext.c
+16
-1
No files found.
mysql-test/r/gis-rtree.result
View file @
2ab37b2a
...
...
@@ -1540,5 +1540,12 @@ a
HANDLER t1 READ a LAST;
a
HANDLER t1 CLOSE;
HANDLER t1 OPEN;
HANDLER t1 READ a FIRST;
a
INSERT INTO t1 VALUES (GeomFromText('Polygon((40 40,60 40,60 60,40 60,40 40))'));
# should not crash
HANDLER t1 READ a NEXT;
HANDLER t1 CLOSE;
DROP TABLE t1;
End of 5.0 tests.
mysql-test/r/handler_myisam.result
View file @
2ab37b2a
...
...
@@ -756,4 +756,17 @@ TRUNCATE t1;
HANDLER t1 READ FIRST;
ERROR 42S02: Unknown table 't1' in HANDLER
DROP TABLE t1;
#
# BUG#51877 - HANDLER interface causes invalid memory read
#
CREATE TABLE t1(a INT, KEY(a));
HANDLER t1 OPEN;
HANDLER t1 READ a FIRST;
a
INSERT INTO t1 VALUES(1);
HANDLER t1 READ a NEXT;
a
1
HANDLER t1 CLOSE;
DROP TABLE t1;
End of 5.1 tests
mysql-test/t/gis-rtree.test
View file @
2ab37b2a
...
...
@@ -914,14 +914,15 @@ HANDLER t1 READ a PREV;
HANDLER
t1
READ
a
LAST
;
HANDLER
t1
CLOSE
;
#TODO: re-enable this test please when bug #51877 is solved
# second crash fixed when the tree has changed since the last search.
#HANDLER t1 OPEN;
#HANDLER t1 READ a FIRST;
#INSERT INTO t1 VALUES (GeomFromText('Polygon((40 40,60 40,60 60,40 60,40 40))'));
#HANDLER t1 READ a NEXT;
#HANDLER t1 CLOSE;
#TODO: end of the 51877 dependent section
HANDLER
t1
OPEN
;
HANDLER
t1
READ
a
FIRST
;
INSERT
INTO
t1
VALUES
(
GeomFromText
(
'Polygon((40 40,60 40,60 60,40 60,40 40))'
));
--
echo
# should not crash
--
disable_result_log
HANDLER
t1
READ
a
NEXT
;
--
enable_result_log
HANDLER
t1
CLOSE
;
DROP
TABLE
t1
;
...
...
mysql-test/t/handler_myisam.test
View file @
2ab37b2a
...
...
@@ -37,4 +37,15 @@ TRUNCATE t1;
HANDLER
t1
READ
FIRST
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# BUG#51877 - HANDLER interface causes invalid memory read
--
echo
#
CREATE
TABLE
t1
(
a
INT
,
KEY
(
a
));
HANDLER
t1
OPEN
;
HANDLER
t1
READ
a
FIRST
;
INSERT
INTO
t1
VALUES
(
1
);
HANDLER
t1
READ
a
NEXT
;
HANDLER
t1
CLOSE
;
DROP
TABLE
t1
;
--
echo
End
of
5.1
tests
storage/myisam/mi_rnext.c
View file @
2ab37b2a
...
...
@@ -28,6 +28,7 @@ int mi_rnext(MI_INFO *info, uchar *buf, int inx)
{
int
error
,
changed
;
uint
flag
;
uint
update_mask
=
HA_STATE_NEXT_FOUND
;
DBUG_ENTER
(
"mi_rnext"
);
if
((
inx
=
_mi_check_index
(
info
,
inx
))
<
0
)
...
...
@@ -55,6 +56,20 @@ int mi_rnext(MI_INFO *info, uchar *buf, int inx)
info
->
s
->
state
.
key_root
[
inx
]);
break
;
}
/*
"search first" failed. This means we have no pivot for
"search next", or in other words MI_INFO::lastkey is
likely uninitialized.
Normally SQL layer would never request "search next" if
"search first" failed. But HANDLER may do anything.
As mi_rnext() without preceeding mi_rkey()/mi_rfirst()
equals to mi_rfirst(), we must restore original state
as if failing mi_rfirst() was not called.
*/
if
(
error
)
update_mask
|=
HA_STATE_PREV_FOUND
;
}
else
{
...
...
@@ -100,7 +115,7 @@ int mi_rnext(MI_INFO *info, uchar *buf, int inx)
}
/* Don't clear if database-changed */
info
->
update
&=
(
HA_STATE_CHANGED
|
HA_STATE_ROW_CHANGED
);
info
->
update
|=
HA_STATE_NEXT_FOUND
;
info
->
update
|=
update_mask
;
if
(
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