Skip to content

Error message "expected length N, actual M" contains wrong value of M when charset UTF8 is used in the field declaration of a table [CORE6414] #6652

@firebird-automations

Description

@firebird-automations

Submitted by: @pavel-zotov

Is related to CORE6419

recreate table test(nm varchar(1) character set win1251 default 'QWERTYUIOP' not null);
Statement failed, SQLSTATE = 22001
arithmetic exception, numeric overflow, or string truncation
-string right truncation
-expected length 1, actual 10
/* 10 is OK, this is number of characters in the default string */

recreate table test(nm varchar(1) character set utf8 default 'QWERTYUIOP' not null);
Statement failed, SQLSTATE = 22001
arithmetic exception, numeric overflow, or string truncation
-string right truncation
-expected length 1, actual 4
/* value 4 is wrong and is issued regardless of default string length */

Checked on: WI-V3.0.7.33372; WI-V4.0.0.2225

(ticket is created after discussion with Adriano; perhaps similar problem already was described in some another ticket)

Commits: 0174bda

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions