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
192715db
Commit
192715db
authored
Dec 10, 2004
by
hf@deer.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for bug #6516 (Server crash loading spatial data)
(after discussion with SerG)
parent
4915d196
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
30 additions
and
5 deletions
+30
-5
include/my_base.h
include/my_base.h
+1
-0
myisam/mi_write.c
myisam/mi_write.c
+4
-3
myisam/rt_index.c
myisam/rt_index.c
+2
-1
myisam/sp_key.c
myisam/sp_key.c
+5
-0
mysql-test/r/gis-rtree.result
mysql-test/r/gis-rtree.result
+6
-0
mysql-test/t/gis-rtree.test
mysql-test/t/gis-rtree.test
+7
-0
sql/handler.cc
sql/handler.cc
+5
-1
No files found.
include/my_base.h
View file @
192715db
...
...
@@ -291,6 +291,7 @@ enum ha_base_keytype {
#define HA_ERR_NO_SUCH_TABLE 155
/* The table does not exist in engine */
#define HA_ERR_TABLE_EXIST 156
/* The table existed in storage engine */
#define HA_ERR_NO_CONNECTION 157
/* Could not connect to storage engine */
#define HA_ERR_NULL_IN_SPATIAL 158
/* NULLs are not supported in spatial index */
/* Other constants */
...
...
myisam/mi_write.c
View file @
192715db
...
...
@@ -124,8 +124,8 @@ int mi_write(MI_INFO *info, byte *record)
{
if
(
local_lock_tree
)
rw_unlock
(
&
share
->
key_root_lock
[
i
]);
DBUG_PRINT
(
"error"
,(
"Got error: %d on write"
,
my_errno
));
goto
err
;
DBUG_PRINT
(
"error"
,(
"Got error: %d on write"
,
my_errno
));
goto
err
;
}
}
if
(
local_lock_tree
)
...
...
@@ -159,7 +159,8 @@ int mi_write(MI_INFO *info, byte *record)
err:
save_errno
=
my_errno
;
if
(
my_errno
==
HA_ERR_FOUND_DUPP_KEY
||
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
)
{
if
(
info
->
bulk_insert
)
{
...
...
myisam/rt_index.c
View file @
192715db
...
...
@@ -710,7 +710,8 @@ err1:
int
rtree_insert
(
MI_INFO
*
info
,
uint
keynr
,
uchar
*
key
,
uint
key_length
)
{
return
(
rtree_insert_level
(
info
,
keynr
,
key
,
key_length
,
-
1
)
==
-
1
)
?
-
1
:
0
;
return
(
!
key_length
||
(
rtree_insert_level
(
info
,
keynr
,
key
,
key_length
,
-
1
)
==
-
1
))
?
-
1
:
0
;
}
...
...
myisam/sp_key.c
View file @
192715db
...
...
@@ -50,6 +50,11 @@ uint sp_make_key(register MI_INFO *info, uint keynr, uchar *key,
dlen
=
_mi_calc_blob_length
(
keyseg
->
bit_start
,
pos
);
memcpy_fixed
(
&
dptr
,
pos
+
keyseg
->
bit_start
,
sizeof
(
char
*
));
if
(
!
dptr
)
{
my_errno
=
HA_ERR_NULL_IN_SPATIAL
;
return
0
;
}
sp_mbr_from_wkb
(
dptr
+
4
,
dlen
-
4
,
SPDIMS
,
mbr
);
/* SRID */
for
(
i
=
0
,
keyseg
=
keyinfo
->
seg
;
keyseg
->
type
;
keyseg
++
,
i
++
)
...
...
mysql-test/r/gis-rtree.result
View file @
192715db
...
...
@@ -798,3 +798,9 @@ INSERT INTO t1 (name, kind, line) VALUES
ALTER TABLE t1 ENABLE KEYS;
INSERT INTO t1 (name, kind, line) VALUES ("austria", "pp", GeomFromText('LINESTRING(14.9906 48.9887,14.9946 48.9904,14.9947 48.9916)'));
drop table t1;
CREATE TABLE t1 (st varchar(100));
INSERT INTO t1 VALUES ("Fake string");
CREATE TABLE t2 (geom GEOMETRY NOT NULL, SPATIAL KEY gk(geom));
INSERT INTO t2 SELECT GeomFromText(st) FROM t1;
ERROR HY000: Unknown error
drop table t1, t2;
mysql-test/t/gis-rtree.test
View file @
192715db
...
...
@@ -165,3 +165,10 @@ INSERT INTO t1 (name, kind, line) VALUES
ALTER
TABLE
t1
ENABLE
KEYS
;
INSERT
INTO
t1
(
name
,
kind
,
line
)
VALUES
(
"austria"
,
"pp"
,
GeomFromText
(
'LINESTRING(14.9906 48.9887,14.9946 48.9904,14.9947 48.9916)'
));
drop
table
t1
;
CREATE
TABLE
t1
(
st
varchar
(
100
));
INSERT
INTO
t1
VALUES
(
"Fake string"
);
CREATE
TABLE
t2
(
geom
GEOMETRY
NOT
NULL
,
SPATIAL
KEY
gk
(
geom
));
--
error
1105
INSERT
INTO
t2
SELECT
GeomFromText
(
st
)
FROM
t1
;
drop
table
t1
,
t2
;
sql/handler.cc
View file @
192715db
...
...
@@ -1083,6 +1083,9 @@ void handler::print_error(int error, myf errflag)
textno
=
ER_DUP_KEY
;
break
;
}
case
HA_ERR_NULL_IN_SPATIAL
:
textno
=
ER_UNKNOWN_ERROR
;
DBUG_VOID_RETURN
;
case
HA_ERR_FOUND_DUPP_UNIQUE
:
textno
=
ER_DUP_UNIQUE
;
break
;
...
...
@@ -1196,7 +1199,8 @@ uint handler::get_dup_key(int error)
{
DBUG_ENTER
(
"handler::get_dup_key"
);
table
->
file
->
errkey
=
(
uint
)
-
1
;
if
(
error
==
HA_ERR_FOUND_DUPP_KEY
||
error
==
HA_ERR_FOUND_DUPP_UNIQUE
)
if
(
error
==
HA_ERR_FOUND_DUPP_KEY
||
error
==
HA_ERR_FOUND_DUPP_UNIQUE
||
error
==
HA_ERR_NULL_IN_SPATIAL
)
info
(
HA_STATUS_ERRKEY
|
HA_STATUS_NO_LOCK
);
DBUG_RETURN
(
table
->
file
->
errkey
);
}
...
...
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