1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

fix_fields recoursion didn't stop when some level's fix_length_and_dec

produced an error. This led to server crash in some cases, e.g.:
create table t7 (s1 char);
select * from t7
where concat(s1 collate latin1_general_ci,s1 collate latin1_swedish_ci)
= 'AA';
This commit is contained in:
unknown
2003-08-05 10:08:16 +05:00
parent d54e55474d
commit 691b7584fb
3 changed files with 17 additions and 0 deletions

View File

@ -553,3 +553,8 @@ SUBSTR('abcdefg',-1,-1)
select SUBSTR('abcdefg',1,-1) FROM DUAL;
SUBSTR('abcdefg',1,-1)
create table t7 (s1 char);
select * from t7
where concat(s1 collate latin1_general_ci,s1 collate latin1_swedish_ci) = 'AA';
ERROR HY000: Illegal mix of collations (latin1_general_ci,EXPLICIT) and (latin1_swedish_ci,EXPLICIT) for operation 'concat'
drop table t7;

View File

@ -305,3 +305,13 @@ select SUBSTR('abcdefg',-1,5) FROM DUAL;
select SUBSTR('abcdefg',0,0) FROM DUAL;
select SUBSTR('abcdefg',-1,-1) FROM DUAL;
select SUBSTR('abcdefg',1,-1) FROM DUAL;
#
# Test that fix_fields doesn't follow to upper level (to comparison)
# when an error on a lower level (in concat) has accured:
#
create table t7 (s1 char);
--error 1265
select * from t7
where concat(s1 collate latin1_general_ci,s1 collate latin1_swedish_ci) = 'AA';
drop table t7;

View File

@ -192,6 +192,8 @@ Item_func::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
}
}
fix_length_and_dec();
if (thd && thd->net.last_errno) // An error inside fix_length_and_dec accured
return 1;
fixed= 1;
return 0;
}