Skip to content

Commit 13a14c0

Browse files
committed
MDEV-33987 Server crashes at Item_func_as_wkt::val_str_ascii
Item_func_boundary::val_str() did not set null_value when it could not construct a geomery object from the input.
1 parent 8a3c53f commit 13a14c0

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

mysql-test/main/gis.result

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5453,4 +5453,10 @@ t2 CREATE TABLE `t2` (
54535453
`c` polygon DEFAULT NULL
54545454
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
54555455
drop table t1, t2;
5456+
#
5457+
# MDEV-33987 Server crashes at Item_func_as_wkt::val_str_ascii
5458+
#
5459+
SELECT ST_ASTEXT(BOUNDARY(INET6_ATON('255.255.255.255'))) AS c1;
5460+
c1
5461+
NULL
54565462
# End of 10.5 tests

mysql-test/main/gis.test

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3456,4 +3456,12 @@ create table t2 as select group_concat(c, c order by 1,2), concat(c), c from t1;
34563456
show create table t2;
34573457
drop table t1, t2;
34583458

3459+
3460+
--echo #
3461+
--echo # MDEV-33987 Server crashes at Item_func_as_wkt::val_str_ascii
3462+
--echo #
3463+
3464+
SELECT ST_ASTEXT(BOUNDARY(INET6_ATON('255.255.255.255'))) AS c1;
3465+
3466+
34593467
--echo # End of 10.5 tests

sql/item_geofunc.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ String *Item_func_boundary::val_str(String *str_value)
452452
Transporter trn(&res_receiver);
453453

454454
Geometry *g= Geometry::construct(&buffer, swkb->ptr(), swkb->length());
455-
if (!g)
455+
if ((null_value= !g))
456456
DBUG_RETURN(0);
457457

458458
if (g->store_shapes(&trn))

0 commit comments

Comments
 (0)