Skip to content
Snippets Groups Projects
Commit 5e42fa66 authored by Nikita Pettik's avatar Nikita Pettik Committed by Konstantin Osipov
Browse files

sql: compute resulting collation for concatenation

According to ANSI, result of concatenation operation should derive
collation sequence from its operands. Now it is not true: result is
always comes with no ("none") collation.

In a nutshell[1], rules are quite simple:

a) If some data type has an explicit collation EC1, then every data type
that has an explicit collation shall have declared type collation that
is EC1.  The collation derivation is explicit and the collation is EC1.

b) If every data type has an implicit collation, then:

 - If every data type has the same declared type collation IC1, then
   the collation derivation is implicit and the collation is IC1.

 - Otherwise, the collation derivation is none.

c) Otherwise, the collation derivation is none.

[1] Read complete statement at chapter 9.5 Result of data type
combinations, ANSI 2013, Part 2: Foundations.

Closes #3937
parent d197d107
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment