You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SET NAMES WIN1251;
CREATE DATABASE 'inet4://localhost:3055/test'
USER "SYSDBA" PASSWORD 'masterkey'
PAGE_SIZE 8192
DEFAULT CHARACTER SET UTF8;
RECREATE TABLE T (
ID BIGINTNOT NULL,
NAME_UTF8 VARCHAR(50),
NAME_WIN1251 VARCHAR(50) CHARACTER SET WIN1251,
PRIMARY KEY (ID)
);
INSERT INTO T(ID, NAME_UTF8, NAME_WIN1251) VALUES (1, 'abc', 'abc');
INSERT INTO T(ID, NAME_UTF8, NAME_WIN1251) VALUES (2, 'Ават', 'Ават');
COMMIT;
Query:
SET NAMES WIN1251;
CONNECT 'inet4://localhost:3055/test'
USER "SYSDBA" PASSWORD 'masterkey';
SELECT COUNT(*)
FROM T
WHERE NAME_WIN1251 LIKE 'Ават';
COUNT
=====================
1
SELECT COUNT(*)
FROM T
WHERE NAME_UTF8 LIKE 'Ават';
Statement failed, SQLSTATE = 22001
arithmetic exception, numeric overflow, or string truncation
-string right truncation
-expected length 0, actual 1
-- Why??? But
SELECT COUNT(*)
FROM T
WHERE NAME_UTF8 LIKE 'Ава_';
COUNT
=====================
1
The text was updated successfully, but these errors were encountered:
If the connection encoding is changed to UTF8 and the console encoding to 65001, then the error will not be raised for NAME_UTF8 LIKE 'Ават'.
sim1984
changed the title
String right truncation error when preparing a query with a LIKE predicate without wildcards with UTF8 encoding.
String right truncation error when preparing a query with a LIKE predicate without wildcards with UTF8 encoding and connection charset WIN1251.
Dec 23, 2024
WI-V5.0.2.1582 Firebird 5.0 4a67617
Create database
Query:
The text was updated successfully, but these errors were encountered: