sql: fix resulting type calculation for CASE-WHEN stmt
Before this patch, resulting type for CASE-WHEN statement was assumed to be the same as type of argument of first THEN clause. Obviously, it is wrong and could lead to sad consequence (e.g. creating ephemeral table with inconsistent format). To deal with this, we check all THEN arguments: if all of them have the same type, then such type will be resulting of the whole statement; if at least two types are different, we can't determine actual resulting type during compilation stage and assign SCALAR as a most general type in SQL now. Need for #4206
Loading
Please register or sign in to comment