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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
90110b84
Commit
90110b84
authored
Apr 29, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge abotchkov@bk-internal.mysql.com:/home/bk/mysql-5.0
into deer.(none):/home/hf/work/mysql-5.0.spaerrs
parents
c6dedf4e
1df25ccd
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
72 additions
and
16 deletions
+72
-16
mysql-test/r/gis-rtree.result
mysql-test/r/gis-rtree.result
+1
-1
mysql-test/r/gis.result
mysql-test/r/gis.result
+12
-2
mysql-test/t/gis-rtree.test
mysql-test/t/gis-rtree.test
+1
-1
mysql-test/t/gis.test
mysql-test/t/gis.test
+14
-2
sql/field.cc
sql/field.cc
+29
-1
sql/field.h
sql/field.h
+3
-3
sql/item_geofunc.cc
sql/item_geofunc.cc
+5
-2
sql/share/errmsg.txt
sql/share/errmsg.txt
+2
-0
sql/spatial.cc
sql/spatial.cc
+2
-0
sql/spatial.h
sql/spatial.h
+2
-0
sql/sql_base.cc
sql/sql_base.cc
+1
-4
No files found.
mysql-test/r/gis-rtree.result
View file @
90110b84
...
@@ -801,5 +801,5 @@ CREATE TABLE t1 (st varchar(100));
...
@@ -801,5 +801,5 @@ CREATE TABLE t1 (st varchar(100));
INSERT INTO t1 VALUES ("Fake string");
INSERT INTO t1 VALUES ("Fake string");
CREATE TABLE t2 (geom GEOMETRY NOT NULL, SPATIAL KEY gk(geom));
CREATE TABLE t2 (geom GEOMETRY NOT NULL, SPATIAL KEY gk(geom));
INSERT INTO t2 SELECT GeomFromText(st) FROM t1;
INSERT INTO t2 SELECT GeomFromText(st) FROM t1;
ERROR
HY000: Unknown error
ERROR
22003: Cannot get geometry object from data you send to the GEOMETRY field
drop table t1, t2;
drop table t1, t2;
mysql-test/r/gis.result
View file @
90110b84
...
@@ -461,9 +461,9 @@ Note 1003 select issimple(multipoint(point(3,6),point(4,10))) AS `issimple(Multi
...
@@ -461,9 +461,9 @@ Note 1003 select issimple(multipoint(point(3,6),point(4,10))) AS `issimple(Multi
create table t1 (a geometry not null);
create table t1 (a geometry not null);
insert into t1 values (GeomFromText('Point(1 2)'));
insert into t1 values (GeomFromText('Point(1 2)'));
insert into t1 values ('Garbage');
insert into t1 values ('Garbage');
ERROR
HY000: Unknown error
ERROR
22003: Cannot get geometry object from data you send to the GEOMETRY field
insert IGNORE into t1 values ('Garbage');
insert IGNORE into t1 values ('Garbage');
ERROR
HY000: Unknown error
ERROR
22003: Cannot get geometry object from data you send to the GEOMETRY field
alter table t1 add spatial index(a);
alter table t1 add spatial index(a);
drop table t1;
drop table t1;
create table t1(a geometry not null, spatial index(a));
create table t1(a geometry not null, spatial index(a));
...
@@ -655,3 +655,13 @@ t1 where object_id=85984;
...
@@ -655,3 +655,13 @@ t1 where object_id=85984;
object_id geometrytype(geo) ISSIMPLE(GEO) ASTEXT(centroid(geo))
object_id geometrytype(geo) ISSIMPLE(GEO) ASTEXT(centroid(geo))
85984 MULTIPOLYGON 0 POINT(-114.87787186923 36.33101763469)
85984 MULTIPOLYGON 0 POINT(-114.87787186923 36.33101763469)
drop table t1;
drop table t1;
create table t1 (fl geometry);
insert into t1 values (1);
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
insert into t1 values (1.11);
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
insert into t1 values ("qwerty");
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
insert into t1 values (pointfromtext('point(1,1)'));
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
drop table t1;
mysql-test/t/gis-rtree.test
View file @
90110b84
...
@@ -168,6 +168,6 @@ drop table t1;
...
@@ -168,6 +168,6 @@ drop table t1;
CREATE
TABLE
t1
(
st
varchar
(
100
));
CREATE
TABLE
t1
(
st
varchar
(
100
));
INSERT
INTO
t1
VALUES
(
"Fake string"
);
INSERT
INTO
t1
VALUES
(
"Fake string"
);
CREATE
TABLE
t2
(
geom
GEOMETRY
NOT
NULL
,
SPATIAL
KEY
gk
(
geom
));
CREATE
TABLE
t2
(
geom
GEOMETRY
NOT
NULL
,
SPATIAL
KEY
gk
(
geom
));
--
error
1
105
--
error
1
416
INSERT
INTO
t2
SELECT
GeomFromText
(
st
)
FROM
t1
;
INSERT
INTO
t2
SELECT
GeomFromText
(
st
)
FROM
t1
;
drop
table
t1
,
t2
;
drop
table
t1
,
t2
;
mysql-test/t/gis.test
View file @
90110b84
...
@@ -165,9 +165,9 @@ explain extended select issimple(MultiPoint(Point(3, 6), Point(4, 10))), issimpl
...
@@ -165,9 +165,9 @@ explain extended select issimple(MultiPoint(Point(3, 6), Point(4, 10))), issimpl
create
table
t1
(
a
geometry
not
null
);
create
table
t1
(
a
geometry
not
null
);
insert
into
t1
values
(
GeomFromText
(
'Point(1 2)'
));
insert
into
t1
values
(
GeomFromText
(
'Point(1 2)'
));
--
error
1
105
--
error
1
416
insert
into
t1
values
(
'Garbage'
);
insert
into
t1
values
(
'Garbage'
);
--
error
1
105
--
error
1
416
insert
IGNORE
into
t1
values
(
'Garbage'
);
insert
IGNORE
into
t1
values
(
'Garbage'
);
alter
table
t1
add
spatial
index
(
a
);
alter
table
t1
add
spatial
index
(
a
);
...
@@ -359,3 +359,15 @@ select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from
...
@@ -359,3 +359,15 @@ select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from
t1
where
object_id
=
85984
;
t1
where
object_id
=
85984
;
drop
table
t1
;
drop
table
t1
;
create
table
t1
(
fl
geometry
);
--
error
1416
insert
into
t1
values
(
1
);
--
error
1416
insert
into
t1
values
(
1.11
);
--
error
1416
insert
into
t1
values
(
"qwerty"
);
--
error
1416
insert
into
t1
values
(
pointfromtext
(
'point(1,1)'
));
drop
table
t1
;
sql/field.cc
View file @
90110b84
...
@@ -7267,12 +7267,38 @@ void Field_geom::sql_type(String &res) const
...
@@ -7267,12 +7267,38 @@ void Field_geom::sql_type(String &res) const
}
}
int
Field_geom
::
store
(
double
nr
)
{
my_message
(
ER_CANT_CREATE_GEOMETRY_OBJECT
,
ER
(
ER_CANT_CREATE_GEOMETRY_OBJECT
),
MYF
(
0
));
return
-
1
;
}
int
Field_geom
::
store
(
longlong
nr
)
{
my_message
(
ER_CANT_CREATE_GEOMETRY_OBJECT
,
ER
(
ER_CANT_CREATE_GEOMETRY_OBJECT
),
MYF
(
0
));
return
-
1
;
}
int
Field_geom
::
store_decimal
(
const
my_decimal
*
)
{
my_message
(
ER_CANT_CREATE_GEOMETRY_OBJECT
,
ER
(
ER_CANT_CREATE_GEOMETRY_OBJECT
),
MYF
(
0
));
return
-
1
;
}
int
Field_geom
::
store
(
const
char
*
from
,
uint
length
,
CHARSET_INFO
*
cs
)
int
Field_geom
::
store
(
const
char
*
from
,
uint
length
,
CHARSET_INFO
*
cs
)
{
{
if
(
!
length
)
if
(
!
length
)
bzero
(
ptr
,
Field_blob
::
pack_length
());
bzero
(
ptr
,
Field_blob
::
pack_length
());
else
else
{
{
if
(
from
==
Geometry
::
bad_geometry_data
.
ptr
())
goto
err
;
// Check given WKB
// Check given WKB
uint32
wkb_type
;
uint32
wkb_type
;
if
(
length
<
SRID_SIZE
+
WKB_HEADER_SIZE
+
SIZEOF_STORED_DOUBLE
*
2
)
if
(
length
<
SRID_SIZE
+
WKB_HEADER_SIZE
+
SIZEOF_STORED_DOUBLE
*
2
)
...
@@ -7280,7 +7306,7 @@ int Field_geom::store(const char *from, uint length, CHARSET_INFO *cs)
...
@@ -7280,7 +7306,7 @@ int Field_geom::store(const char *from, uint length, CHARSET_INFO *cs)
wkb_type
=
uint4korr
(
from
+
WKB_HEADER_SIZE
);
wkb_type
=
uint4korr
(
from
+
WKB_HEADER_SIZE
);
if
(
wkb_type
<
(
uint32
)
Geometry
::
wkb_point
||
if
(
wkb_type
<
(
uint32
)
Geometry
::
wkb_point
||
wkb_type
>
(
uint32
)
Geometry
::
wkb_end
)
wkb_type
>
(
uint32
)
Geometry
::
wkb_end
)
return
-
1
;
goto
err
;
Field_blob
::
store_length
(
length
);
Field_blob
::
store_length
(
length
);
if
(
table
->
copy_blobs
||
length
<=
MAX_FIELD_WIDTH
)
if
(
table
->
copy_blobs
||
length
<=
MAX_FIELD_WIDTH
)
{
// Must make a copy
{
// Must make a copy
...
@@ -7293,6 +7319,8 @@ int Field_geom::store(const char *from, uint length, CHARSET_INFO *cs)
...
@@ -7293,6 +7319,8 @@ int Field_geom::store(const char *from, uint length, CHARSET_INFO *cs)
err:
err:
bzero
(
ptr
,
Field_blob
::
pack_length
());
bzero
(
ptr
,
Field_blob
::
pack_length
());
my_message
(
ER_CANT_CREATE_GEOMETRY_OBJECT
,
ER
(
ER_CANT_CREATE_GEOMETRY_OBJECT
),
MYF
(
0
));
return
-
1
;
return
-
1
;
}
}
...
...
sql/field.h
View file @
90110b84
...
@@ -1189,9 +1189,9 @@ class Field_geom :public Field_blob {
...
@@ -1189,9 +1189,9 @@ class Field_geom :public Field_blob {
enum_field_types
type
()
const
{
return
FIELD_TYPE_GEOMETRY
;
}
enum_field_types
type
()
const
{
return
FIELD_TYPE_GEOMETRY
;
}
void
sql_type
(
String
&
str
)
const
;
void
sql_type
(
String
&
str
)
const
;
int
store
(
const
char
*
to
,
uint
length
,
CHARSET_INFO
*
charset
);
int
store
(
const
char
*
to
,
uint
length
,
CHARSET_INFO
*
charset
);
int
store
(
double
nr
)
{
return
1
;
}
int
store
(
double
nr
)
;
int
store
(
longlong
nr
)
{
return
1
;
}
int
store
(
longlong
nr
)
;
int
store_decimal
(
const
my_decimal
*
)
{
return
1
;
}
int
store_decimal
(
const
my_decimal
*
)
;
void
get_key_image
(
char
*
buff
,
uint
length
,
imagetype
type
);
void
get_key_image
(
char
*
buff
,
uint
length
,
imagetype
type
);
};
};
#endif
/*HAVE_SPATIAL*/
#endif
/*HAVE_SPATIAL*/
...
...
sql/item_geofunc.cc
View file @
90110b84
...
@@ -55,8 +55,11 @@ String *Item_func_geometry_from_text::val_str(String *str)
...
@@ -55,8 +55,11 @@ String *Item_func_geometry_from_text::val_str(String *str)
return
0
;
return
0
;
str
->
length
(
0
);
str
->
length
(
0
);
str
->
q_append
(
srid
);
str
->
q_append
(
srid
);
if
((
null_value
=
!
Geometry
::
create_from_wkt
(
&
buffer
,
&
trs
,
str
,
0
)))
if
(
!
Geometry
::
create_from_wkt
(
&
buffer
,
&
trs
,
str
,
0
))
return
0
;
/* We shouldn't return NULL here as NULL is a legal spatial object */
/* Geometry::bad_spatial_data will produce error message beeing stored*/
/* in GEOMETRY field */
return
&
Geometry
::
bad_geometry_data
;
return
str
;
return
str
;
}
}
...
...
sql/share/errmsg.txt
View file @
90110b84
...
@@ -5344,3 +5344,5 @@ ER_SP_NOT_VAR_ARG 42000
...
@@ -5344,3 +5344,5 @@ ER_SP_NOT_VAR_ARG 42000
eng "OUT or INOUT argument %d for routine %s is not a variable"
eng "OUT or INOUT argument %d for routine %s is not a variable"
ER_SP_NO_RETSET_IN_FUNC 0A000
ER_SP_NO_RETSET_IN_FUNC 0A000
eng "Not allowed to return a result set from a function"
eng "Not allowed to return a result set from a function"
ER_CANT_CREATE_GEOMETRY_OBJECT 22003
eng "Cannot get geometry object from data you send to the GEOMETRY field"
sql/spatial.cc
View file @
90110b84
...
@@ -22,6 +22,8 @@
...
@@ -22,6 +22,8 @@
/***************************** Gis_class_info *******************************/
/***************************** Gis_class_info *******************************/
String
Geometry
::
bad_geometry_data
(
"Bad object"
,
&
my_charset_bin
);
Geometry
::
Class_info
*
Geometry
::
ci_collection
[
Geometry
::
wkb_end
+
1
]
=
Geometry
::
Class_info
*
Geometry
::
ci_collection
[
Geometry
::
wkb_end
+
1
]
=
{
{
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
...
...
sql/spatial.h
View file @
90110b84
...
@@ -173,6 +173,8 @@ class Geometry
...
@@ -173,6 +173,8 @@ class Geometry
static
void
operator
delete
(
void
*
ptr
,
void
*
buffer
)
static
void
operator
delete
(
void
*
ptr
,
void
*
buffer
)
{}
{}
static
String
bad_geometry_data
;
enum
wkbType
enum
wkbType
{
{
wkb_point
=
1
,
wkb_point
=
1
,
...
...
sql/sql_base.cc
View file @
90110b84
...
@@ -3858,12 +3858,9 @@ fill_record(THD *thd, Field **ptr, List<Item> &values, bool ignore_errors)
...
@@ -3858,12 +3858,9 @@ fill_record(THD *thd, Field **ptr, List<Item> &values, bool ignore_errors)
TABLE
*
table
=
field
->
table
;
TABLE
*
table
=
field
->
table
;
if
(
field
==
table
->
next_number_field
)
if
(
field
==
table
->
next_number_field
)
table
->
auto_increment_field_not_null
=
TRUE
;
table
->
auto_increment_field_not_null
=
TRUE
;
if
((
value
->
save_in_field
(
field
,
0
)
<
0
)
&&
!
ignore_errors
)
if
(
value
->
save_in_field
(
field
,
0
)
==
-
1
)
{
my_message
(
ER_UNKNOWN_ERROR
,
ER
(
ER_UNKNOWN_ERROR
),
MYF
(
0
));
DBUG_RETURN
(
TRUE
);
DBUG_RETURN
(
TRUE
);
}
}
}
DBUG_RETURN
(
thd
->
net
.
report_error
);
DBUG_RETURN
(
thd
->
net
.
report_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