New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wrong order when using collation DE_DE [CORE4026] #4356
Comments
Modified by: Volker Rehn (vr2_s18)environment: Win7, XP, Firebird 2.5.2 => Win7, XP |
Commented by: @mrotteveel The collation does actually sort the other characters, but it seems to apply a different sort (if you insert the same values in different order multiple times they are actually grouped together when sorted). de_de isn't the only collation with this behavior. It also occurs for (only checked for ISO8859_1 collations): The following sort as expected (based on this small sample): |
Commented by: @asfernandes Volker, this is as designed, and you can change this customizing the collation with: create collation de_de2 for iso8859_1 from de_de 'SPECIALS-FIRST=1'; And then use de_de2 or whatever the name you use. The order will be: '+'0 %;'-'0 % |
Modified by: @pcisarstatus: Resolved [ 5 ] => Closed [ 6 ] |
Commented by: @mrotteveel I am curious to the logic that doesn't sort 0 next to 0.00 |
Commented by: Volker Rehn (vr2_s18) Thanks a lot, Adriano and Mark. That helps. Now - 1. What's the point of ignoring parts of the charset when sorting? This is rather counter-intuitive. Regards Volker |
Submitted by: Volker Rehn (vr2_s18)
Votes: 1
Only digits and alphabet characters are used for sorting, everything else (#$%&_[]{}/"!<>~+*:;,. etc) is ignored. Collation DE_DE is not a CI_AI etc collation, it should work with other characters too. Test case:
CREATE TABLE TBL (
ENTRY VARCHAR(30) COLLATE DE_DE
);
INSERT INTO TBL (ENTRY) VALUES('0');
INSERT INTO TBL (ENTRY) VALUES('''+''0 %;''-''0 %');
INSERT INTO TBL (ENTRY) VALUES('0.00');
INSERT INTO TBL (ENTRY) VALUES('0.00 %');
INSERT INTO TBL (ENTRY) VALUES('''+''0.000;''-''0.000');
INSERT INTO TBL (ENTRY) VALUES('abc');
INSERT INTO TBL (ENTRY) VALUES('def');
INSERT INTO TBL (ENTRY) VALUES('NNN');
INSERT INTO TBL (ENTRY) VALUES('yyy');
select entry from tbl
order by 1
gives:
ENTRY
0
'+'0 %;'-'0 %
0.00
0.00 %
'+'0.000;'-'0.000
abc
def
NNN
yyy
Regards Volker
The text was updated successfully, but these errors were encountered: