Skip to content

Commit fac2a7a

Browse files
author
Alexander Barkov
committed
MDEV-12495 Conditional jump depends on uninitialised value for: SELECT NULL UNION geom_expression
1 parent 97fb1f2 commit fac2a7a

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

mysql-test/r/gis.result

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1630,3 +1630,16 @@ SELECT ASTEXT(p) FROM v1;
16301630
ASTEXT(p)
16311631
POINT(1 1)
16321632
DROP VIEW v1;
1633+
#
1634+
# Start of 10.0 tests
1635+
#
1636+
#
1637+
# MDEV-12495 Conditional jump depends on uninitialised value for: SELECT NULL UNION geom_expression
1638+
#
1639+
SELECT AsText(g) FROM (SELECT NULL AS g UNION SELECT Point(1,1)) AS t1;
1640+
AsText(g)
1641+
NULL
1642+
POINT(1 1)
1643+
#
1644+
# End 10.0 tests
1645+
#

mysql-test/t/gis.test

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1492,3 +1492,16 @@ SELECT ASTEXT(p) FROM v1;
14921492
DROP VIEW v1;
14931493

14941494
# --echo End of 5.5 tests
1495+
1496+
--echo #
1497+
--echo # Start of 10.0 tests
1498+
--echo #
1499+
1500+
--echo #
1501+
--echo # MDEV-12495 Conditional jump depends on uninitialised value for: SELECT NULL UNION geom_expression
1502+
--echo #
1503+
SELECT AsText(g) FROM (SELECT NULL AS g UNION SELECT Point(1,1)) AS t1;
1504+
1505+
--echo #
1506+
--echo # End 10.0 tests
1507+
--echo #

sql/item.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9464,7 +9464,10 @@ void Item_cache_row::set_null()
94649464

94659465

94669466
Item_type_holder::Item_type_holder(THD *thd, Item *item)
9467-
:Item(thd, item), enum_set_typelib(0), fld_type(get_real_type(item))
9467+
:Item(thd, item),
9468+
enum_set_typelib(0),
9469+
fld_type(get_real_type(item)),
9470+
geometry_type(Field::GEOM_GEOMETRY)
94689471
{
94699472
DBUG_ASSERT(item->fixed);
94709473
maybe_null= item->maybe_null;

0 commit comments

Comments
 (0)