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
ab3cae3d
Commit
ab3cae3d
authored
Jun 07, 2011
by
Ramil Kalimullin
Browse files
Options
Browse Files
Download
Plain Diff
Auto-merge from mysql-5.1
parents
e3a43936
768b9a0e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
5 deletions
+61
-5
mysql-test/r/gis-rtree.result
mysql-test/r/gis-rtree.result
+27
-0
mysql-test/t/gis-rtree.test
mysql-test/t/gis-rtree.test
+28
-0
storage/myisam/mi_update.c
storage/myisam/mi_update.c
+5
-4
storage/myisam/mi_write.c
storage/myisam/mi_write.c
+1
-1
No files found.
mysql-test/r/gis-rtree.result
View file @
ab3cae3d
...
...
@@ -1549,3 +1549,30 @@ HANDLER t1 READ a NEXT;
HANDLER t1 CLOSE;
DROP TABLE t1;
End of 5.0 tests.
#
# Bug #57323/11764487: myisam corruption with insert ignore
# and invalid spatial data
#
CREATE TABLE t1(a LINESTRING NOT NULL, b GEOMETRY NOT NULL,
SPATIAL KEY(a), SPATIAL KEY(b)) ENGINE=MyISAM;
INSERT INTO t1 VALUES(GEOMFROMTEXT("point (0 0)"), GEOMFROMTEXT("point (1 1)"));
INSERT IGNORE INTO t1 SET a=GEOMFROMTEXT("point (-6 0)"), b=GEOMFROMTEXT("error");
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
INSERT IGNORE INTO t1 SET a=GEOMFROMTEXT("point (-6 0)"), b=NULL;
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
SELECT ASTEXT(a), ASTEXT(b) FROM t1;
ASTEXT(a) ASTEXT(b)
POINT(0 0) POINT(1 1)
DROP TABLE t1;
CREATE TABLE t1(a INT NOT NULL, b GEOMETRY NOT NULL,
KEY(a), SPATIAL KEY(b)) ENGINE=MyISAM;
INSERT INTO t1 VALUES(0, GEOMFROMTEXT("point (1 1)"));
INSERT IGNORE INTO t1 SET a=0, b=GEOMFROMTEXT("error");
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
INSERT IGNORE INTO t1 SET a=1, b=NULL;
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
SELECT a, ASTEXT(b) FROM t1;
a ASTEXT(b)
0 POINT(1 1)
DROP TABLE t1;
End of 5.1 tests
mysql-test/t/gis-rtree.test
View file @
ab3cae3d
...
...
@@ -928,3 +928,31 @@ DROP TABLE t1;
--
echo
End
of
5.0
tests
.
--
echo
#
--
echo
# Bug #57323/11764487: myisam corruption with insert ignore
--
echo
# and invalid spatial data
--
echo
#
CREATE
TABLE
t1
(
a
LINESTRING
NOT
NULL
,
b
GEOMETRY
NOT
NULL
,
SPATIAL
KEY
(
a
),
SPATIAL
KEY
(
b
))
ENGINE
=
MyISAM
;
INSERT
INTO
t1
VALUES
(
GEOMFROMTEXT
(
"point (0 0)"
),
GEOMFROMTEXT
(
"point (1 1)"
));
--
error
ER_CANT_CREATE_GEOMETRY_OBJECT
INSERT
IGNORE
INTO
t1
SET
a
=
GEOMFROMTEXT
(
"point (-6 0)"
),
b
=
GEOMFROMTEXT
(
"error"
);
--
error
ER_CANT_CREATE_GEOMETRY_OBJECT
INSERT
IGNORE
INTO
t1
SET
a
=
GEOMFROMTEXT
(
"point (-6 0)"
),
b
=
NULL
;
SELECT
ASTEXT
(
a
),
ASTEXT
(
b
)
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
INT
NOT
NULL
,
b
GEOMETRY
NOT
NULL
,
KEY
(
a
),
SPATIAL
KEY
(
b
))
ENGINE
=
MyISAM
;
INSERT
INTO
t1
VALUES
(
0
,
GEOMFROMTEXT
(
"point (1 1)"
));
--
error
ER_CANT_CREATE_GEOMETRY_OBJECT
INSERT
IGNORE
INTO
t1
SET
a
=
0
,
b
=
GEOMFROMTEXT
(
"error"
);
--
error
ER_CANT_CREATE_GEOMETRY_OBJECT
INSERT
IGNORE
INTO
t1
SET
a
=
1
,
b
=
NULL
;
SELECT
a
,
ASTEXT
(
b
)
FROM
t1
;
DROP
TABLE
t1
;
--
echo
End
of
5.1
tests
storage/myisam/mi_update.c
View file @
ab3cae3d
...
...
@@ -192,8 +192,8 @@ err:
save_errno
=
my_errno
;
if
(
changed
)
key_changed
|=
HA_STATE_CHANGED
;
if
(
my_errno
==
HA_ERR_FOUND_DUPP_KEY
||
my_errno
==
HA_ERR_
OUT_OF_MEM
||
my_errno
==
HA_ERR_
RECORD_FILE_FULL
)
if
(
my_errno
==
HA_ERR_FOUND_DUPP_KEY
||
my_errno
==
HA_ERR_
RECORD_FILE_FULL
||
my_errno
==
HA_ERR_
NULL_IN_SPATIAL
||
my_errno
==
HA_ERR_OUT_OF_MEM
)
{
info
->
errkey
=
(
int
)
i
;
flag
=
0
;
...
...
@@ -211,8 +211,9 @@ err:
{
uint
new_length
=
_mi_make_key
(
info
,
i
,
new_key
,
newrec
,
pos
);
uint
old_length
=
_mi_make_key
(
info
,
i
,
old_key
,
oldrec
,
pos
);
if
((
flag
++
&&
_mi_ck_delete
(
info
,
i
,
new_key
,
new_length
))
||
_mi_ck_write
(
info
,
i
,
old_key
,
old_length
))
if
((
flag
++
&&
share
->
keyinfo
[
i
].
ck_delete
(
info
,
i
,
new_key
,
new_length
))
||
share
->
keyinfo
[
i
].
ck_insert
(
info
,
i
,
old_key
,
old_length
))
break
;
}
}
...
...
storage/myisam/mi_write.c
View file @
ab3cae3d
...
...
@@ -204,7 +204,7 @@ err:
else
{
uint
key_length
=
_mi_make_key
(
info
,
i
,
buff
,
record
,
filepos
);
if
(
_mi_ck_delete
(
info
,
i
,
buff
,
key_length
))
if
(
share
->
keyinfo
[
i
].
ck_delete
(
info
,
i
,
buff
,
key_length
))
{
if
(
local_lock_tree
)
mysql_rwlock_unlock
(
&
share
->
key_root_lock
[
i
]);
...
...
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