Produce an error when arguments are not compatible for CONCAT()
This commit is contained in:
parent
80630f12f3
commit
676f986838
12
sql/item.cc
12
sql/item.cc
@ -182,10 +182,7 @@ bool Item::set_charset(CHARSET_INFO *cs1, enum coercion co1,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!my_charset_same(cs1,cs2))
|
if (!my_charset_same(cs1,cs2))
|
||||||
{
|
return 1;
|
||||||
set_charset(&my_charset_bin, COER_NOCOLL);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (co1 < co2)
|
if (co1 < co2)
|
||||||
{
|
{
|
||||||
@ -198,7 +195,12 @@ bool Item::set_charset(CHARSET_INFO *cs1, enum coercion co1,
|
|||||||
else // co2 == co1
|
else // co2 == co1
|
||||||
{
|
{
|
||||||
if (cs1 != cs2)
|
if (cs1 != cs2)
|
||||||
set_charset(&my_charset_bin, COER_NOCOLL);
|
{
|
||||||
|
CHARSET_INFO *bin= get_charset_by_csname(cs1->csname, MY_CS_BINSORT,MYF(0));
|
||||||
|
if (!bin)
|
||||||
|
return 1;
|
||||||
|
set_charset(bin, COER_NOCOLL);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
set_charset(cs2, co2);
|
set_charset(cs2, co2);
|
||||||
}
|
}
|
||||||
|
@ -328,8 +328,12 @@ void Item_func_concat::fix_length_and_dec()
|
|||||||
for (uint i=0 ; i < arg_count ; i++)
|
for (uint i=0 ; i < arg_count ; i++)
|
||||||
{
|
{
|
||||||
max_length+=args[i]->max_length;
|
max_length+=args[i]->max_length;
|
||||||
set_charset(charset(), coercibility,
|
if (set_charset(charset(), coercibility,
|
||||||
args[i]->charset(), args[i]->coercibility);
|
args[i]->charset(), args[i]->coercibility))
|
||||||
|
{
|
||||||
|
my_error(ER_WRONG_ARGUMENTS,MYF(0),func_name());
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (max_length > MAX_BLOB_WIDTH)
|
if (max_length > MAX_BLOB_WIDTH)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user