Skip to content
/ server Public
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions mysql-test/main/create.result
Original file line number Diff line number Diff line change
Expand Up @@ -2066,3 +2066,9 @@ SHOW CREATE DATABASE `#testone#■■■■■■■■■■■■■■■■
ERROR 42000: Incorrect database name '#testone#■■■■■■■■■■■■■■■■■■■■■■■■■■■■■...'
SET NAMES DEFAULT;
# End of 10.5 Test
#
# MDEV-39002: Diagnostics area assertion failure upon CREATE TABLE
#
CREATE TABLE t1 (a INT, b VARCHAR(8) DEFAULT (IFNULL(a,''))) CHARSET swe7;
ERROR HY000: Illegal mix of collations (latin1_swedish_ci,NUMERIC) and (swe7_swedish_ci,COERCIBLE) for operation 'ifnull'
End of 10.11 tests
9 changes: 9 additions & 0 deletions mysql-test/main/create.test
Original file line number Diff line number Diff line change
Expand Up @@ -1945,3 +1945,12 @@ SHOW CREATE DATABASE `#testone#■■■■■■■■■■■■■■■■
SET NAMES DEFAULT;

--echo # End of 10.5 Test

--echo #
--echo # MDEV-39002: Diagnostics area assertion failure upon CREATE TABLE
--echo #

--error ER_CANT_AGGREGATE_2COLLATIONS
CREATE TABLE t1 (a INT, b VARCHAR(8) DEFAULT (IFNULL(a,''))) CHARSET swe7;

--echo End of 10.11 tests
8 changes: 4 additions & 4 deletions sql/item_cmpfunc.h
Original file line number Diff line number Diff line change
Expand Up @@ -1207,9 +1207,9 @@ class Item_func_coalesce :public Item_func_case_expression
bool fix_length_and_dec(THD *thd) override
{
update_nullability_post_fix_fields();
if (aggregate_for_result(func_name_cstring(), args, arg_count, true))
if (aggregate_for_result(func_name_cstring(), args, arg_count, true) ||
fix_attributes(args, arg_count))
return TRUE;
fix_attributes(args, arg_count);
return FALSE;
}
LEX_CSTRING func_name_cstring() const override
Expand All @@ -1236,9 +1236,9 @@ class Item_func_case_abbreviation2 :public Item_func_case_expression
protected:
bool fix_length_and_dec2(Item **items)
{
if (aggregate_for_result(func_name_cstring(), items, 2, true))
if (aggregate_for_result(func_name_cstring(), items, 2, true) ||
fix_attributes(items, 2))
return TRUE;
fix_attributes(items, 2);
return FALSE;
}

Expand Down