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
9db41de0
Commit
9db41de0
authored
Oct 24, 2009
by
Georgi Kodinov
Browse files
Options
Browse Files
Download
Plain Diff
automerge
parents
dd171939
dd02c4a1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
2 deletions
+35
-2
mysql-test/r/gis.result
mysql-test/r/gis.result
+12
-0
mysql-test/t/gis.test
mysql-test/t/gis.test
+16
-0
sql/item_geofunc.cc
sql/item_geofunc.cc
+7
-2
No files found.
mysql-test/r/gis.result
View file @
9db41de0
...
@@ -972,6 +972,18 @@ select min(`col002`) from t1 union select `col002` from t1;
...
@@ -972,6 +972,18 @@ select min(`col002`) from t1 union select `col002` from t1;
min(`col002`)
min(`col002`)
NULL
NULL
drop table t1;
drop table t1;
#
# Bug #47780: crash when comparing GIS items from subquery
#
CREATE TABLE t1(a INT, b MULTIPOLYGON);
INSERT INTO t1 VALUES
(0,
GEOMFROMTEXT(
'multipolygon(((1 2,3 4,5 6,7 8,9 8),(7 6,5 4,3 2,1 2,3 4)))'));
# must not crash
SELECT 1 FROM t1 WHERE a <> (SELECT GEOMETRYCOLLECTIONFROMWKB(b) FROM t1);
1
DROP TABLE t1;
End of 5.0 tests
End of 5.0 tests
create table t1 (f1 tinyint(1), f2 char(1), f3 varchar(1), f4 geometry, f5 datetime);
create table t1 (f1 tinyint(1), f2 char(1), f3 varchar(1), f4 geometry, f5 datetime);
create view v1 as select * from t1;
create view v1 as select * from t1;
...
...
mysql-test/t/gis.test
View file @
9db41de0
...
@@ -655,6 +655,22 @@ insert into t1 values (),(),();
...
@@ -655,6 +655,22 @@ insert into t1 values (),(),();
select
min
(
`col002`
)
from
t1
union
select
`col002`
from
t1
;
select
min
(
`col002`
)
from
t1
union
select
`col002`
from
t1
;
drop
table
t1
;
drop
table
t1
;
--
echo
#
--
echo
# Bug #47780: crash when comparing GIS items from subquery
--
echo
#
CREATE
TABLE
t1
(
a
INT
,
b
MULTIPOLYGON
);
INSERT
INTO
t1
VALUES
(
0
,
GEOMFROMTEXT
(
'multipolygon(((1 2,3 4,5 6,7 8,9 8),(7 6,5 4,3 2,1 2,3 4)))'
));
--
echo
# must not crash
SELECT
1
FROM
t1
WHERE
a
<>
(
SELECT
GEOMETRYCOLLECTIONFROMWKB
(
b
)
FROM
t1
);
DROP
TABLE
t1
;
--
echo
End
of
5.0
tests
--
echo
End
of
5.0
tests
...
...
sql/item_geofunc.cc
View file @
9db41de0
...
@@ -84,7 +84,9 @@ String *Item_func_geometry_from_wkb::val_str(String *str)
...
@@ -84,7 +84,9 @@ String *Item_func_geometry_from_wkb::val_str(String *str)
if
(
args
[
0
]
->
field_type
()
==
MYSQL_TYPE_GEOMETRY
)
if
(
args
[
0
]
->
field_type
()
==
MYSQL_TYPE_GEOMETRY
)
{
{
return
args
[
0
]
->
val_str
(
str
);
String
*
str_ret
=
args
[
0
]
->
val_str
(
str
);
null_value
=
args
[
0
]
->
null_value
;
return
str_ret
;
}
}
wkb
=
args
[
0
]
->
val_str
(
&
arg_val
);
wkb
=
args
[
0
]
->
val_str
(
&
arg_val
);
...
@@ -94,7 +96,10 @@ String *Item_func_geometry_from_wkb::val_str(String *str)
...
@@ -94,7 +96,10 @@ String *Item_func_geometry_from_wkb::val_str(String *str)
str
->
set_charset
(
&
my_charset_bin
);
str
->
set_charset
(
&
my_charset_bin
);
if
(
str
->
reserve
(
SRID_SIZE
,
512
))
if
(
str
->
reserve
(
SRID_SIZE
,
512
))
return
0
;
{
null_value
=
TRUE
;
/* purecov: inspected */
return
0
;
/* purecov: inspected */
}
str
->
length
(
0
);
str
->
length
(
0
);
str
->
q_append
(
srid
);
str
->
q_append
(
srid
);
if
((
null_value
=
if
((
null_value
=
...
...
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