FirebirdSQL / firebird

Firebird server, client and tools
https://www.firebirdsql.org/
1.26k stars 217 forks source link

Improve explanation about string overflow when trying to create login with non-ascii characters and number of octets in it more than 31 [CORE4883] #5177

Open firebird-automations opened 9 years ago

firebird-automations commented 9 years ago

Submitted by: @pavel-zotov

chcp 1251 isql -ch win1251 localhost/3333:e30

SQL> create or alter user "Спасопреображенский" password '123'; Statement failed, SQLSTATE = 22001 arithmetic exception, numeric overflow, or string truncation -string right truncation -expected length 31, actual 19

This error actually says that number of OCTETS in login multi-byte representation exceeded limit of 31. Can this message be corrected in order not to see strange "expected length 31, actual 19" ?

firebird-automations commented 9 years ago

Commented by: @mrotteveel

AFAIK users are stored as UNICODE_FSS, so the errors shouldn't occur at all. It looks like there is a flawed check on byte length and not on character length.