The current behavior looks ok to me. The expression has type CHAR(2) because the arguments have types CHAR(1) and CHAR(2). So ‘a’ is widened to ‘a ‘.
Julian > On Sep 22, 2021, at 12:00 AM, stanilovsky evgeny <[email protected]> > wrote: > > sorry for typo, 'fill the ticket' of course )) > >> hi community ! >> I found that COALESCE('a', 'bb') will return 'a ' <-- whitespace is present, >> i found that now it expands for maximum presented CHAR >> (RelDataType#inferReturnType logic) >> sql 92 standard tolds: >> >> ''' >> COALESCE (V1, V2) is equivalent to the following <case specification>: >> CASE WHEN V1 IS NOT NULL THEN V1 ELSE V2 END >> ''' >> >> So i suppose that existing behavior is erroneous, if it`s ok i fell the >> ticket. >> >> wdyt ?
