2024-01-22 08:42:42 +01:00
|
|
|
#coding:utf-8
|
|
|
|
|
|
|
|
"""
|
|
|
|
ID: issue-7436
|
|
|
|
ISSUE: 7436
|
|
|
|
TITLE: Backup error for wide table
|
|
|
|
DESCRIPTION:
|
|
|
|
NOTES:
|
|
|
|
[22.01.2024] pzotov
|
|
|
|
Confirmed problem on 5.0.0.882 (date of build: 22.12.2022).
|
|
|
|
Backup can be successfully done on 5.0.0.884 (date of build: 24.12.2022).
|
|
|
|
::: NB :::
|
2024-01-22 19:27:17 +01:00
|
|
|
This test also does RESTORE with validation.
|
|
|
|
But restore failed on FB 5.x and 6.x before gh-7974 was fixed, see commits:
|
|
|
|
6.x: https://github.com/FirebirdSQL/firebird/commit/1dbcb940447182f24d9dfd2a243f048b99c9533b
|
|
|
|
5.x: https://github.com/FirebirdSQL/firebird/commit/37f19bf2d92c0ab8ff9967b63841897da597dee3
|
|
|
|
|
|
|
|
Checked on 6.0.0.219, 5.0.1.1318 (both - intermediate snapshot); 4.0.5.3051
|
2024-01-22 08:42:42 +01:00
|
|
|
"""
|
|
|
|
|
|
|
|
from io import BytesIO
|
|
|
|
from pathlib import Path
|
|
|
|
import locale
|
|
|
|
from firebird.driver import SrvRestoreFlag, SrvRepairFlag
|
|
|
|
from firebird.driver.types import DatabaseError
|
|
|
|
|
|
|
|
import pytest
|
|
|
|
from firebird.qa import *
|
|
|
|
|
|
|
|
init_sql = """
|
2024-01-22 19:27:17 +01:00
|
|
|
create domain dm_guid varchar(38) default 'B7D4B716-C7CB-4882-BC25-D060C1CAC1D5B7';
|
|
|
|
create domain dm_str_4k varchar(4000) default 'D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077031C-335E-4975-AD01-BA9B475ABB76D077';
|
|
|
|
create domain dm_str_5k varchar(5000) default '05DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD7-4404-8CA9-91765CF03F7605DF35AD-8BD
|
|
|
|
create domain dm_str_255 varchar(255) default 'EA41A64B-951C-4D1D-8544-D1A8ADE6993DEA41A64B-951C-4D1D-8544-D1A8ADE6993DEA41A64B-951C-4D1D-8544-D1A8ADE6993DEA41A64B-951C-4D1D-8544-D1A8ADE6993DEA41A64B-951C-4D1D-8544-D1A8ADE6993DEA41A64B-951C-4D1D-8544-D1A8ADE6993DEA41A64B-951C-4D1D-8544-D1A8ADE6993DEA4';
|
|
|
|
create domain dm_tm time default current_time;
|
|
|
|
create domain dm_ts timestamp default 'now';
|
|
|
|
create domain dm_int int default 1793427031;
|
|
|
|
create domain dm_dbl double precision default 3.1415926;
|
|
|
|
create domain dm_bool smallint default 1;
|
|
|
|
create domain dm_blob blob sub_type 1 segment size 80
|
2024-01-22 08:42:42 +01:00
|
|
|
default
|
|
|
|
'FBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B615-81AE9456F57DFBA26DCF-9A71-4B20-B61
|
|
|
|
;
|
2024-01-22 19:27:17 +01:00
|
|
|
commit;
|
2024-01-22 08:42:42 +01:00
|
|
|
|
2024-01-22 19:27:17 +01:00
|
|
|
create table test (
|
|
|
|
id dm_guid not null /* dm_guid = varchar(38) */,
|
|
|
|
f_000000000001 dm_guid /* dm_guid = varchar(38) */,
|
|
|
|
f_00002 dm_str_255 /* dm_str_255 = varchar(255) */,
|
|
|
|
f_000000003 dm_str_4k /* dm_str_4k = varchar(4000) */,
|
|
|
|
f_000004 dm_str_4k /* dm_str_4k = varchar(4000) */,
|
|
|
|
f_0000005 dm_ts default 'now' /* dm_ts = timestamp */,
|
|
|
|
f_0000006 dm_ts default 'now' /* dm_ts = timestamp */,
|
|
|
|
f_000007 dm_ts default 'now' /* dm_ts = timestamp */,
|
|
|
|
f_0000008 dm_guid /* dm_guid = varchar(38) */,
|
|
|
|
f_000009 dm_ts default 'now' /* dm_ts = timestamp */,
|
|
|
|
f_0000000010 dm_guid /* dm_guid = varchar(38) */,
|
|
|
|
f_00000011 dm_int /* dm_int = integer */,
|
|
|
|
f_0012 dm_guid /* dm_guid = varchar(38) */,
|
|
|
|
f_0000013 dm_guid /* dm_guid = varchar(38) */,
|
|
|
|
f_0000000014 dm_ts default 'now' /* dm_ts = timestamp */,
|
|
|
|
f_0015 dm_int /* dm_int = integer */,
|
|
|
|
f_000000016 dm_ts default 'now' /* dm_ts = timestamp */,
|
|
|
|
f_000017 dm_int /* dm_int = integer */,
|
|
|
|
f_000018 dm_int /* dm_int = integer */,
|
|
|
|
f_0000019 dm_guid /* dm_guid = varchar(38) */,
|
|
|
|
f_0020 dm_guid /* dm_guid = varchar(38) */,
|
|
|
|
f_021 dm_guid /* dm_guid = varchar(38) */,
|
|
|
|
f_00000022 dm_guid /* dm_guid = varchar(38) */,
|
|
|
|
f_00000023 dm_guid /* dm_guid = varchar(38) */,
|
|
|
|
f_000000000024 dm_guid /* dm_guid = varchar(38) */,
|
|
|
|
f_0000000025 dm_ts default 'now' /* dm_ts = timestamp */,
|
|
|
|
f_000000000026 dm_int /* dm_int = integer */,
|
|
|
|
f_000000000027 dm_int /* dm_int = integer */,
|
|
|
|
f_00000000028 dm_int /* dm_int = integer */,
|
|
|
|
f_0029 dm_int /* dm_int = integer */,
|
|
|
|
x01e dm_int /* dm_int = integer */,
|
|
|
|
f_00031 dm_guid /* dm_guid = varchar(38) */,
|
|
|
|
f_00032 dm_guid /* dm_guid = varchar(38) */,
|
|
|
|
f_00033 dm_guid /* dm_guid = varchar(38) */,
|
|
|
|
f_000034 dm_guid /* dm_guid = varchar(38) */,
|
|
|
|
f_00035 dm_guid /* dm_guid = varchar(38) */,
|
|
|
|
x024 dm_str_255 /* dm_str_255 = varchar(255) */,
|
|
|
|
x0025 dm_ts default 'now' /* dm_ts = timestamp */,
|
|
|
|
f_0000038 dm_int /* dm_int = integer */,
|
|
|
|
f_000000000039 dm_int /* dm_int = integer */,
|
|
|
|
f_000000000040 dm_int /* dm_int = integer */,
|
|
|
|
f_00000000041 dm_int /* dm_int = integer */,
|
|
|
|
f_0000042 dm_tm /* dm_tm = time */,
|
|
|
|
f_00000043 dm_tm /* dm_tm = time */,
|
|
|
|
f_00000000044 dm_dbl /* dm_dbl = double precision */,
|
|
|
|
f_000000000045 dm_dbl /* dm_dbl = double precision */,
|
|
|
|
f_000000000046 dm_dbl /* dm_dbl = double precision */,
|
|
|
|
f_000000047 dm_guid /* dm_guid = varchar(38) */,
|
|
|
|
x30 dm_dbl /* dm_dbl = double precision */,
|
|
|
|
f_0000000049 dm_ts default 'now' /* dm_ts = timestamp */,
|
|
|
|
x00032 dm_ts default 'now' /* dm_ts = timestamp */,
|
|
|
|
x000033 dm_ts default 'now' /* dm_ts = timestamp */,
|
|
|
|
f_0000000052 dm_str_4k /* dm_str_4k = varchar(4000) */,
|
|
|
|
f_0000000053 dm_guid /* dm_guid = varchar(38) */,
|
|
|
|
f_0000000054 dm_guid /* dm_guid = varchar(38) */,
|
|
|
|
f_00000055 dm_str_255 /* dm_str_255 = varchar(255) */,
|
|
|
|
f_0000000000056 dm_bool /* dm_bool = smallint */,
|
|
|
|
f_00000057 dm_dbl /* dm_dbl = double precision */,
|
|
|
|
f_00000058 dm_int /* dm_int = integer */,
|
|
|
|
f_0000000059 dm_int /* dm_int = integer */,
|
|
|
|
f_00000060 dm_dbl /* dm_dbl = double precision */,
|
|
|
|
f_0000061 dm_dbl /* dm_dbl = double precision */,
|
|
|
|
f_0000062 dm_ts default 'now' /* dm_ts = timestamp */,
|
|
|
|
f_0000063 dm_ts default 'now' /* dm_ts = timestamp */,
|
|
|
|
f_000000064 dm_ts default 'now' /* dm_ts = timestamp */,
|
|
|
|
f_000000065 dm_ts default 'now' /* dm_ts = timestamp */,
|
|
|
|
f_0000000000066 dm_str_255 /* dm_str_255 = varchar(255) */,
|
|
|
|
f_000000067 dm_ts default 'now' /* dm_ts = timestamp */,
|
|
|
|
f_000000000068 dm_bool /* dm_bool = smallint */,
|
|
|
|
f_00000000000069 dm_bool /* dm_bool = smallint */,
|
|
|
|
f_0000000070 dm_str_255 /* dm_str_255 = varchar(255) */,
|
|
|
|
f_0000000071 dm_str_255 /* dm_str_255 = varchar(255) */,
|
|
|
|
f_00000072 dm_int /* dm_int = integer */,
|
|
|
|
x0049 dm_int /* dm_int = integer */,
|
|
|
|
f_0000000000074 dm_dbl /* dm_dbl = double precision */,
|
|
|
|
f_000000000000075 dm_ts default 'now' /* dm_ts = timestamp */,
|
|
|
|
f_00000000000076 dm_ts default 'now' /* dm_ts = timestamp */,
|
|
|
|
f_000000000000077 dm_ts default 'now' /* dm_ts = timestamp */,
|
|
|
|
f_000000000078 dm_int /* dm_int = integer */,
|
|
|
|
x00004f dm_ts default 'now' /* dm_ts = timestamp */,
|
|
|
|
x0050 dm_bool /* dm_bool = smallint */,
|
|
|
|
x000000051 dm_guid /* dm_guid = varchar(38) */,
|
|
|
|
x000052 dm_guid /* dm_guid = varchar(38) */,
|
|
|
|
f_000000000083 dm_str_255 /* dm_str_255 = varchar(255) */,
|
|
|
|
x000054 dm_int /* dm_int = integer */,
|
|
|
|
f_0000000085 dm_guid /* dm_guid = varchar(38) */,
|
|
|
|
f_0000000086 dm_guid /* dm_guid = varchar(38) */,
|
|
|
|
x00000057 dm_ts default 'now' /* dm_ts = timestamp */,
|
|
|
|
x58 dm_int /* dm_int = integer */,
|
|
|
|
x00000059 dm_str_255 /* dm_str_255 = varchar(255) */,
|
|
|
|
f_00000000000090 dm_guid /* dm_guid = varchar(38) */,
|
|
|
|
x0000005b dm_dbl /* dm_dbl = double precision */,
|
|
|
|
x0000005c dm_dbl /* dm_dbl = double precision */,
|
|
|
|
x0000005d dm_dbl /* dm_dbl = double precision */,
|
|
|
|
f_0000000094 dm_ts default 'now' /* dm_ts = timestamp */,
|
|
|
|
f_00000000000000095 dm_dbl /* dm_dbl = double precision */,
|
|
|
|
x0000000060 dm_int /* dm_int = integer */,
|
|
|
|
f_000000000000000097 dm_guid /* dm_guid = varchar(38) */,
|
|
|
|
f_0000000000000000000098 dm_guid /* dm_guid = varchar(38) */,
|
|
|
|
f_0000000000000099 dm_bool default 0 not null /* dm_bool = smallint */,
|
|
|
|
f_000000000100 dm_bool /* dm_bool = smallint */,
|
|
|
|
x00000065 dm_guid /* dm_guid = varchar(38) */,
|
|
|
|
x000000066 dm_str_255 /* dm_str_255 = varchar(255) */,
|
|
|
|
x000000067 dm_str_255 /* dm_str_255 = varchar(255) */,
|
|
|
|
x0000068 dm_str_255 /* dm_str_255 = varchar(255) */,
|
|
|
|
x0000000069 dm_str_255 /* dm_str_255 = varchar(255) */,
|
|
|
|
x000000006a dm_str_255 /* dm_str_255 = varchar(255) */,
|
|
|
|
x00006b dm_str_255 /* dm_str_255 = varchar(255) */,
|
|
|
|
x00006c dm_str_255 /* dm_str_255 = varchar(255) */,
|
|
|
|
x0000006d dm_guid /* dm_guid = varchar(38) */,
|
|
|
|
x0000000006e dm_str_255 /* dm_str_255 = varchar(255) */,
|
|
|
|
x00000006f dm_str_255 /* dm_str_255 = varchar(255) */,
|
|
|
|
x000000000070 dm_guid /* dm_guid = varchar(38) */,
|
|
|
|
x00000000071 dm_str_255 /* dm_str_255 = varchar(255) */,
|
|
|
|
x00000072 dm_ts default 'now' /* dm_ts = timestamp */,
|
|
|
|
x000000073 dm_bool /* dm_bool = smallint */,
|
|
|
|
x000000074 dm_bool /* dm_bool = smallint */,
|
|
|
|
x000000075 dm_bool /* dm_bool = smallint */,
|
|
|
|
x0000000076 dm_bool /* dm_bool = smallint */,
|
|
|
|
x0000000077 dm_bool /* dm_bool = smallint */,
|
|
|
|
x0000000078 dm_bool /* dm_bool = smallint */,
|
|
|
|
x0000000079 dm_bool /* dm_bool = smallint */,
|
|
|
|
x00000000007a dm_bool /* dm_bool = smallint */,
|
|
|
|
x00000000007b dm_bool /* dm_bool = smallint */,
|
|
|
|
f_00000000000124 dm_int /* dm_int = integer */,
|
|
|
|
f_00000000000125 dm_int /* dm_int = integer */,
|
|
|
|
f_00000000000126 dm_int /* dm_int = integer */,
|
|
|
|
f_000000000000127 dm_int /* dm_int = integer */,
|
|
|
|
f_000000000000128 dm_int /* dm_int = integer */,
|
|
|
|
f_000000000000129 dm_int /* dm_int = integer */,
|
|
|
|
f_000000000000130 dm_int /* dm_int = integer */,
|
|
|
|
f_00000000000000131 dm_int /* dm_int = integer */,
|
|
|
|
f_00000000000000132 dm_int /* dm_int = integer */,
|
|
|
|
x00000000000085 dm_str_5k /* dm_str_5k = varchar(5000) */,
|
|
|
|
x00000000000086 dm_str_5k /* dm_str_5k = varchar(5000) */,
|
|
|
|
x00000000000087 dm_str_5k /* dm_str_5k = varchar(5000) */,
|
|
|
|
f_00000000000136 dm_str_5k /* dm_str_5k = varchar(5000) */,
|
|
|
|
f_00000000000137 dm_str_5k /* dm_str_5k = varchar(5000) */,
|
|
|
|
f_00000000000138 dm_str_5k /* dm_str_5k = varchar(5000) */,
|
|
|
|
f_00000000000139 dm_str_5k /* dm_str_5k = varchar(5000) */,
|
|
|
|
f_0000000000000140 dm_str_5k /* dm_str_5k = varchar(5000) */,
|
|
|
|
f_0000000000000141 dm_str_255 /* dm_str_255 = varchar(255) */,
|
|
|
|
x000000008e dm_bool /* dm_bool = smallint */,
|
|
|
|
f_0000000000000143 dm_bool /* dm_bool = smallint */,
|
|
|
|
f_0000000000000144 dm_bool /* dm_bool = smallint */,
|
|
|
|
f_0000000000000145 dm_bool /* dm_bool = smallint */,
|
|
|
|
x000000000092 dm_bool /* dm_bool = smallint */,
|
|
|
|
x00000000000093 dm_bool /* dm_bool = smallint */,
|
|
|
|
x000000000094 dm_bool /* dm_bool = smallint */,
|
|
|
|
x000000000095 dm_bool /* dm_bool = smallint */,
|
|
|
|
x0000000096 dm_str_4k /* dm_str_4k = varchar(4000) */,
|
|
|
|
x0000000000097 dm_dbl /* dm_dbl = double precision */,
|
|
|
|
x000000000000098 dm_str_255 /* dm_str_255 = varchar(255) */,
|
|
|
|
x00099 dm_int /* dm_int = integer */,
|
|
|
|
x0000000009a dm_bool /* dm_bool = smallint */,
|
|
|
|
x09b dm_guid /* dm_guid = varchar(38) */,
|
|
|
|
x000000009c dm_guid /* dm_guid = varchar(38) */,
|
|
|
|
x0000000009d dm_guid /* dm_guid = varchar(38) */,
|
|
|
|
x0000000000009e dm_dbl /* dm_dbl = double precision */,
|
|
|
|
f_00000000000000159 dm_int /* dm_int = integer */,
|
|
|
|
f_00000000000000000160 dm_dbl /* dm_dbl = double precision */,
|
|
|
|
x000000000000000a1 dm_str_255 /* dm_str_255 = varchar(255) */,
|
|
|
|
x00000000a2 dm_int /* dm_int = integer */,
|
|
|
|
f_0000000000000000163 dm_bool /* dm_bool = smallint */,
|
|
|
|
x0000000000000a4 dm_guid /* dm_guid = varchar(38) */,
|
|
|
|
x0000000000a5 dm_ts default 'now' /* dm_ts = timestamp */,
|
|
|
|
f_000000000000000000166 dm_str_255 /* dm_str_255 = varchar(255) */,
|
|
|
|
x00000a7 dm_int /* dm_int = integer */,
|
|
|
|
x000000a8 dm_int /* dm_int = integer */,
|
|
|
|
x000000000a9 dm_bool /* dm_bool = smallint */,
|
|
|
|
x000000aa dm_int /* dm_int = integer */,
|
|
|
|
x000000ab dm_str_255 /* dm_str_255 = varchar(255) */,
|
|
|
|
x0000000000000000ac dm_str_255 /* dm_str_255 = varchar(255) */,
|
|
|
|
x00000000000ad dm_guid /* dm_guid = varchar(38) */,
|
|
|
|
x000000000000000ae dm_str_255 /* dm_str_255 = varchar(255) */,
|
|
|
|
x000000000000000af dm_ts default 'now' /* dm_ts = timestamp */,
|
|
|
|
x0000000b0 dm_int /* dm_int = integer */,
|
|
|
|
x0000b1 dm_str_255 /* dm_str_255 = varchar(255) */,
|
|
|
|
x000000000b2 dm_dbl /* dm_dbl = double precision */,
|
|
|
|
x000000000000b3 dm_blob /* dm_blob = blob sub_type 1 segment size 80 */,
|
|
|
|
f_000000000000000000000180 dm_ts default 'now' /* dm_ts = timestamp */,
|
|
|
|
x0000b5 dm_str_255 /* dm_str_255 = varchar(255) */,
|
|
|
|
x00000000b6 dm_str_255 /* dm_str_255 = varchar(255) */
|
2024-01-22 08:42:42 +01:00
|
|
|
);
|
|
|
|
commit;
|
|
|
|
|
2024-01-22 19:27:17 +01:00
|
|
|
insert into test (id) values( lpad('', 38, uuid_to_char(gen_uuid())) );
|
|
|
|
insert into test (id) values( lpad('', 38, uuid_to_char(gen_uuid())) );
|
|
|
|
insert into test (id) values( lpad('', 38, uuid_to_char(gen_uuid())) );
|
|
|
|
insert into test (id) values( lpad('', 38, uuid_to_char(gen_uuid())) );
|
|
|
|
insert into test (id) values( lpad('', 38, uuid_to_char(gen_uuid())) );
|
|
|
|
insert into test (id) values( lpad('', 38, uuid_to_char(gen_uuid())) );
|
|
|
|
insert into test (id) values( lpad('', 38, uuid_to_char(gen_uuid())) );
|
|
|
|
insert into test (id) values( lpad('', 38, uuid_to_char(gen_uuid())) );
|
2024-01-22 08:42:42 +01:00
|
|
|
commit;
|
2024-01-22 19:27:17 +01:00
|
|
|
|
2024-01-22 08:42:42 +01:00
|
|
|
"""
|
|
|
|
db = db_factory(init = init_sql, charset = 'win1251')
|
|
|
|
db_tmp = db_factory(filename='tmp_gh_7436.restored.tmp', do_not_create=True, do_not_drop=True)
|
|
|
|
|
|
|
|
act = python_act('db')
|
|
|
|
|
|
|
|
@pytest.mark.version('>=4.0')
|
|
|
|
def test_1(act: Action, db_tmp: Database, capsys):
|
|
|
|
|
2024-01-22 19:27:17 +01:00
|
|
|
#with act.db.connect() as con:
|
|
|
|
# if act.is_version('>=5'):
|
|
|
|
# pytest.skip("currently works only in FB 4.x.")
|
2024-01-22 08:42:42 +01:00
|
|
|
|
|
|
|
backup = BytesIO()
|
|
|
|
with act.connect_server() as srv:
|
|
|
|
# 5.0.0.882:
|
|
|
|
# firebird.driver.types.DatabaseError: message length error (encountered 32, expected 65568)
|
|
|
|
# -gds_$receive failed
|
|
|
|
# -Exiting before completion due to errors
|
|
|
|
#
|
|
|
|
srv.database.local_backup(database=act.db.db_path, backup_stream=backup)
|
|
|
|
backup.seek(0)
|
|
|
|
|
2024-01-22 19:27:17 +01:00
|
|
|
# 5.0.1.1318, 6.0.0.219 (before fix):
|
2024-01-22 08:42:42 +01:00
|
|
|
# firebird.driver.types.DatabaseError: expected record length
|
|
|
|
# -Exiting before completion due to errors
|
|
|
|
#
|
|
|
|
try:
|
|
|
|
srv.database.local_restore(backup_stream = backup, database = db_tmp.db_path, flags = SrvRestoreFlag.REPLACE)
|
2024-01-22 19:27:17 +01:00
|
|
|
# Validation must pass without any output:
|
|
|
|
act.gfix(switches=['-v', '-full', db_tmp.db_path], combine_output = True, io_enc = locale.getpreferredencoding())
|
2024-01-22 08:42:42 +01:00
|
|
|
except DatabaseError as e:
|
|
|
|
print('Restore FAILED:')
|
|
|
|
print(e.__str__())
|
|
|
|
print(e.gds_codes)
|
|
|
|
finally:
|
|
|
|
if Path(db_tmp.db_path).is_file():
|
|
|
|
Path(db_tmp.db_path).unlink()
|
|
|
|
|
|
|
|
act.expected_stdout = ''
|
|
|
|
act.stdout = capsys.readouterr().out
|
|
|
|
assert act.clean_stdout == act.clean_expected_stdout
|