summaryrefslogtreecommitdiff
path: root/sql/item_timefunc.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2019-10-14 08:21:08 +0400
committerAlexander Barkov <bar@mariadb.com>2019-10-14 08:21:08 +0400
commit5392726e3c4f924745412500a7d1e030226a68d1 (patch)
treeb4267ef4878509fad2ee7d98bce7e07a37ac7c85 /sql/item_timefunc.cc
parentfa8437908ba55022d5f186d63dec4f01afb59746 (diff)
downloadmariadb-git-5392726e3c4f924745412500a7d1e030226a68d1.tar.gz
MDEV-20818 ER_CRASHED_ON_USAGE or Assertion `length <= column->length' failed in write_block_record on temporary table
The patch for `MDEV-20795 CAST(inet6 AS BINARY) returns wrong result` unintentionally changed what Item_char_typecast::type_handler() returns. This broke UNIONs with the BINARY() function, as the Aria engine started to get columns of unexpected data types. Restoring previous behaviour, to return Type_handler::string_type_handler(max_length). The prototype for Item_handed_func::return_type_handler() has changed from: const Type_handler *return_type_handler() const to: const Type_handler *return_type_handler(const Item_handled_func *) const
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r--sql/item_timefunc.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index 631829eee1d..8639edf2944 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -2420,14 +2420,14 @@ String *Item_char_typecast::val_str_binary_from_native(String *str)
class Item_char_typecast_func_handler: public Item_handled_func::Handler_str
{
public:
- const Type_handler *return_type_handler() const
+ const Type_handler *return_type_handler(const Item_handled_func *item) const
{
- return &type_handler_varchar;
+ return Type_handler::string_type_handler(item->max_length);
}
const Type_handler *
type_handler_for_create_select(const Item_handled_func *item) const
{
- return return_type_handler()->type_handler_for_tmp_table(item);
+ return return_type_handler(item)->type_handler_for_tmp_table(item);
}
bool fix_length_and_dec(Item_handled_func *item) const