diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index 174088bf944..2bd492008bc 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -1630,3 +1630,16 @@ SELECT ASTEXT(p) FROM v1; ASTEXT(p) POINT(1 1) DROP VIEW v1; +# +# Start of 10.0 tests +# +# +# MDEV-12495 Conditional jump depends on uninitialised value for: SELECT NULL UNION geom_expression +# +SELECT AsText(g) FROM (SELECT NULL AS g UNION SELECT Point(1,1)) AS t1; +AsText(g) +NULL +POINT(1 1) +# +# End 10.0 tests +# diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index 9378ea55377..f689902533a 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -1492,3 +1492,16 @@ SELECT ASTEXT(p) FROM v1; DROP VIEW v1; # --echo End of 5.5 tests + +--echo # +--echo # Start of 10.0 tests +--echo # + +--echo # +--echo # MDEV-12495 Conditional jump depends on uninitialised value for: SELECT NULL UNION geom_expression +--echo # +SELECT AsText(g) FROM (SELECT NULL AS g UNION SELECT Point(1,1)) AS t1; + +--echo # +--echo # End 10.0 tests +--echo # diff --git a/sql/item.cc b/sql/item.cc index dbec742e4a2..ceb8d984d9e 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -9464,7 +9464,10 @@ void Item_cache_row::set_null() Item_type_holder::Item_type_holder(THD *thd, Item *item) - :Item(thd, item), enum_set_typelib(0), fld_type(get_real_type(item)) + :Item(thd, item), + enum_set_typelib(0), + fld_type(get_real_type(item)), + geometry_type(Field::GEOM_GEOMETRY) { DBUG_ASSERT(item->fixed); maybe_null= item->maybe_null;