mirror of
https://github.com/MariaDB/server.git
synced 2025-01-30 18:41:56 +01:00
Bug #3087 CONCAT_WS makes the server die in case of illegal mix of collations
This commit is contained in:
parent
8bbb6d2b42
commit
54735ae3a9
3 changed files with 6 additions and 0 deletions
|
@ -339,6 +339,8 @@ select concat(_latin1'a',_latin2'a',_latin5'a');
|
||||||
ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE), (latin2_general_ci,COERCIBLE), (latin5_turkish_ci,COERCIBLE) for operation 'concat'
|
ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE), (latin2_general_ci,COERCIBLE), (latin5_turkish_ci,COERCIBLE) for operation 'concat'
|
||||||
select concat(_latin1'a',_latin2'a',_latin5'a',_latin7'a');
|
select concat(_latin1'a',_latin2'a',_latin5'a',_latin7'a');
|
||||||
ERROR HY000: Illegal mix of collations for operation 'concat'
|
ERROR HY000: Illegal mix of collations for operation 'concat'
|
||||||
|
select concat_ws(_latin1'a',_latin2'a');
|
||||||
|
ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE) and (latin2_general_ci,COERCIBLE) for operation 'concat_ws'
|
||||||
select FIELD('b','A','B');
|
select FIELD('b','A','B');
|
||||||
FIELD('b','A','B')
|
FIELD('b','A','B')
|
||||||
2
|
2
|
||||||
|
|
|
@ -195,6 +195,8 @@ select concat(_latin1'a',_latin2'a');
|
||||||
select concat(_latin1'a',_latin2'a',_latin5'a');
|
select concat(_latin1'a',_latin2'a',_latin5'a');
|
||||||
--error 1271
|
--error 1271
|
||||||
select concat(_latin1'a',_latin2'a',_latin5'a',_latin7'a');
|
select concat(_latin1'a',_latin2'a',_latin5'a',_latin7'a');
|
||||||
|
--error 1267
|
||||||
|
select concat_ws(_latin1'a',_latin2'a');
|
||||||
|
|
||||||
#
|
#
|
||||||
# Test FIELD() and collations
|
# Test FIELD() and collations
|
||||||
|
|
|
@ -628,9 +628,11 @@ void Item_func_concat_ws::fix_length_and_dec()
|
||||||
max_length=separator->max_length*(arg_count-1);
|
max_length=separator->max_length*(arg_count-1);
|
||||||
for (uint i=0 ; i < arg_count ; i++)
|
for (uint i=0 ; i < arg_count ; i++)
|
||||||
{
|
{
|
||||||
|
DTCollation tmp(collation.collation, collation.derivation);
|
||||||
max_length+=args[i]->max_length;
|
max_length+=args[i]->max_length;
|
||||||
if (collation.aggregate(args[i]->collation))
|
if (collation.aggregate(args[i]->collation))
|
||||||
{
|
{
|
||||||
|
collation.set(tmp); // Restore the previous value
|
||||||
my_coll_agg_error(collation, args[i]->collation, func_name());
|
my_coll_agg_error(collation, args[i]->collation, func_name());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue