Skip to content
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

accented characters (multi-byte) in field names are been counted Incorrectly [CORE5361] #5634

Closed
firebird-automations opened this issue Sep 28, 2016 · 4 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Denis Pereira Raymundo (denistek)

Votes: 5

Note these commands and their results:

1) select char_length('Preço Venda Padrão Est.Físico') from rdb$database
R: 29

2) select 0.00 "Preço Venda Padrão Est.Físico" from rdb$database
R: arithmetic exception, numeric overflow, or string truncation.
string right truncation.
expected length 31, actual 29.

3) select 0.00 "Preco Venda Padrão Est.Físico" from rdb$database
R: ok

4) select 0.00 "Preço Venda Padrao Est.Físico" from rdb$database
R: ok

5) select 0.00 "Preço Venda Padrão Est.Fisico" from rdb$database
R: ok

6) select 0.00 "Preço Venda Padrão Est.Físic" from rdb$database
R: ok

7) select 0.00 "çççççççççççççççç" from rdb$database
R: arithmetic exception, numeric overflow, or string truncation.
string right truncation.
expected length 31, actual 16.

@firebird-automations
Copy link
Collaborator Author

Modified by: Denis Pereira Raymundo (denistek)

summary: accented characters in field names are been counted Incorrectly => accented characters (multi-byte) in field names are been counted Incorrectly

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

security: Developers [ 10012 ] =>

@pavel-zotov
Copy link

It seems that this ticket can be marked as 'resolved' and closed: I can not reproduce error in none of the following encodings: win1252, dos860 and utf8.

@mrotteveel
Copy link
Member

mrotteveel commented May 22, 2021

It is actually the expected and correct behaviour for Firebird 3 and earlier: identifiers in those versions are restricted to 31 characters and 31 bytes, given identifiers are UNICODE_FSS in Firebird 3 and earlier, any non-ASCII character counts as 2 or 3 bytes, reducing the allowed number of characters. It is just that the error message is a bit confusing.

This changed in Firebird 4 now the maximum length of an identifier is 63 characters UTF8, max 252 bytes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants