|
User defined type plugins and new built-in types (implemented as always-built-in plugins) will want to do CAST.
This task will add infrastructure for such casts.
Let's add this branch into the cast_type grammar rules:
| IDENT_sys
|
{
|
const Type_handler *h;
|
if (!(h= Type_handler::handler_by_name_or_error($1)))
|
MYSQL_YYABORT;
|
$$.set(h);
|
Lex->charset= NULL;
|
}
|
Note, the GEOMETRY data types (which is as of time of writing 95% plugin compatible) does not support CAST for now. So for test purposes let's override the relevant method as follows:
Item *
|
Type_handler_geometry::create_typecast_item(THD *thd, Item *item,
|
const Type_cast_attributes &attr)
|
const
|
{
|
DBUG_EXECUTE_IF("emulate_geometry_create_typecast_item",
|
return new (thd->mem_root) Item_func_geometry_from_text(thd, item);
|
);
|
|
return NULL;
|
}
|
|