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

Can't backup/restore database from v3 to v4 with SEC$USER_NAME field longer than 10 characters #7611

Closed
dmitry-starodubov opened this issue May 31, 2023 · 5 comments · Fixed by #7614

Comments

@dmitry-starodubov
Copy link
Collaborator

If I have such a simple database

CREATE TABLE T (ID INTEGER NOT NULL,
USER_NAME SEC$USER_NAME,
PASSWD VARCHAR(256) CHARACTER SET OCTETS,
ALG VARCHAR(32) CHARACTER SET UNICODE_FSS);

insert into t values(1, 'aaabbbcccddd', '12345678', '123');

I can backup/restore in on v3.
But when I try to restore backup from v3 on v4 I get an error:
gbak: ERROR:arithmetic exception, numeric overflow, or string truncation
gbak: ERROR: string right truncation
gbak: ERROR: expected length 10, actual 12
gbak: ERROR:gds_$send failed
gbak:Exiting before completion due to errors

Because maximum length of USER_NAME field is calculated wrong.

@sim1984
Copy link

sim1984 commented May 31, 2023

v3 and v4, the SEC$USER_NAME domain has a different definition

CREATE DOMAIN SEC$USER_NAME AS
VARCHAR(31) CHARACTER SET UNICODE_FSS;

vs

CREATE DOMAIN SEC$USER_NAME AS
VARCHAR(63) CHARACTER SET UTF8;

@aafemt
Copy link
Contributor

aafemt commented May 31, 2023

Both of them should be enough for 12 characters. Expected 10 in the error message is strange.

@pavel-zotov
Copy link

I could not reproduce described problem.
What exact versions of FB 3.x and FB 4.x / 5.x ?

@asfernandes
Copy link
Member

Try restore in v4 using embedded.

@pavel-zotov
Copy link

Adriano, thanks. Now all OK.

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