267
if (field_arg->sql_type == DRIZZLE_TYPE_DATE
268
|| field_arg->sql_type == DRIZZLE_TYPE_DATETIME
269
|| field_arg->sql_type == DRIZZLE_TYPE_TIMESTAMP)
273
if (field_arg->def->get_date(<ime, TIME_FUZZY_DATE))
275
my_error(ER_INVALID_DATETIME_VALUE, MYF(ME_FATALERROR),
276
default_value->c_str());
280
/* We now do the casting down to the appropriate type.
282
Yes, this implicit casting is balls.
283
It was previously done on reading the proto back in,
284
but we really shouldn't store the bogus things in the proto,
285
and instead do the casting behaviour here.
287
the timestamp errors are taken care of elsewhere.
290
if (field_arg->sql_type == DRIZZLE_TYPE_DATETIME)
292
Item *typecast= new Item_datetime_typecast(field_arg->def);
293
typecast->quick_fix_field();
294
typecast->val_str(default_value);
296
else if (field_arg->sql_type == DRIZZLE_TYPE_DATE)
298
Item *typecast= new Item_date_typecast(field_arg->def);
299
typecast->quick_fix_field();
300
typecast->val_str(default_value);
265
304
if ((field_arg->sql_type==DRIZZLE_TYPE_VARCHAR
266
305
&& field_arg->charset==&my_charset_bin)
267
306
|| (field_arg->sql_type==DRIZZLE_TYPE_BLOB