1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-12560, MDEV-12665 - geometry type not preserved in hybrid functions and UNION

This is a join patch fixing these two bugs:
MDEV-12560 Wrong data type for SELECT NULL UNION SELECT Point(1,1)
MDEV-12665 Hybrid functions do not preserve geometry type
This commit is contained in:
Alexander Barkov
2017-05-05 07:23:16 +04:00
parent aacb4d57ca
commit 583b68e899
7 changed files with 366 additions and 21 deletions

View File

@ -2148,6 +2148,26 @@ bool Type_handler_timestamp_common::
return false;
}
#ifdef HAVE_SPATIAL
bool Type_handler_geometry::
Item_hybrid_func_fix_attributes(THD *thd, Item_hybrid_func *func,
Item **items, uint nitems) const
{
DBUG_ASSERT(nitems > 0);
Type_geometry_attributes gattr(items[0]);
for (uint i= 1; i < nitems; i++)
gattr.join(items[i]);
func->set_geometry_type(gattr.get_geometry_type());
func->collation.set(&my_charset_bin);
func->unsigned_flag= false;
func->decimals= 0;
func->max_length= (uint32) UINT_MAX32;
func->maybe_null= true;
return false;
}
#endif
/*************************************************************************/
bool Type_handler::