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 select from table with ICU column when database (.FDB) is created on LINUX with icu 4.2.1 and then copied to WINDOWS [CORE4571] #4888

Closed
firebird-automations opened this issue Oct 7, 2014 · 12 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @pavel-zotov

On Linux, empty database:

create collation nums_coll for utf8 from unicode case insensitive 'NUMERIC-SORT=1';
commit;
create domain dm_nums as varchar(20) character set utf8 collate nums_coll;
commit;
create table wares(
id bigint generated by default as identity constraint pk_wares primary key using index pk_wares
,numb dm_nums
,constraint wares_numb_unq unique(numb) using index wares_numb_unq
);
commit;
exit;

Then make copy .FDB (not .FBK) to Windows machine and run there ISQL with attach to this database - no problem, it is opened OK.
Then: select * from wares;

Result:

SQL> select * from wares;
Statement failed, SQLSTATE = 22021
COLLATION NUMS_COLL for CHARACTER SET UTF8 is not installed

PS.

On linux:

1) $ rpm -qa | grep icu
icu4j-eclipse-4.2.1-5.el6.x86_64
libicu-4.2.1-9.1.el6_2.x86_64

2) ISQL Version: LI-T3.0.0.31353 Firebird 3.0 Alpha 2
Server version:
Firebird/Linux/AMD/Intel/x64 (access method), version "LI-T3.0.0.31353 Firebird 3.0 Alpha 2"
Firebird/Linux/AMD/Intel/x64 (remote server), version "LI-T3.0.0.31353 Firebird 3.0 Alpha 2/tcp (oel64)/P13"
Firebird/Linux/AMD/Intel/x64 (remote interface), version "LI-T3.0.0.31353 Firebird 3.0 Alpha 2/tcp (oel64)/P13"
on disk structure version 12.0

On windows:

1) ICU is supplied in FB snaphot, 5.2
2) ISQL Version: WI-T3.0.0.31353 Firebird 3.0 Alpha 2
Server version:
Firebird/Windows/Intel/i386 (access method), version "WI-T3.0.0.31353 Firebird 3.0 Alpha 2"
Firebird/Windows/Intel/i386 (remote server), version "WI-T3.0.0.31353 Firebird 3.0 Alpha 2/tcp (IT_test)/P13"
Firebird/Windows/Intel/i386 (remote interface), version "WI-T3.0.0.31353 Firebird 3.0 Alpha 2/tcp (IT_test)/P13"
on disk structure version 12.0

Commits: a6d28f7 255b4ff FirebirdSQL/fbt-repository@24c6ce0 FirebirdSQL/fbt-repository@0811eb6

@firebird-automations
Copy link
Collaborator Author

Commented by: @aafemt

As designed. Between servers with different versions of ICU database can be transferred only by backup-restore.

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Pavel, can you backup and restore (both!) the Linux-created fdb in Windows?

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

Adriano,

yes, no problem with that:

C:\>del C:\1INSTALL\FB30SNAP\tmpicu.fdb.tmp 2>nul

C:\>C:\1INSTALL\FB30SNAP\gbak.exe -b C:\1INSTALL\FBTEST\tmpicu.fdb C:\1INSTALL\FBTEST\tmpicu.fbk.tmp
--- no output ---

C:\>C:\1INSTALL\FB30SNAP\gbak.exe -c C:\1INSTALL\FBTEST\tmpicu.fbk.tmp C:\1INSTALL\FB30SNAP\tmpicu.fdb.tmp
--- no output ---

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

Want to make sure - if you do not have constraint wares_numb_unq will it be possible to transfer database file between different ICU versions?

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

> if you do not have constraint wares_numb_unq will it be possible to transfer database file between different ICU versions?

Seems than NOT.

This is new case of DDL on source (linux) host:

create collation nums_coll for utf8 from unicode;
commit;
create domain dm_nums as varchar(20) character set utf8 collate nums_coll;
commit;
create table wares(
id bigint
,numb dm_nums
);
commit;

Running this on linux I get:
SQL> show table wares;
ID BIGINT Nullable
NUMB (DM_NUMS) VARCHAR(20) CHARACTER SET UTF8 Nullable
COLLATE NUMS_COLL
SQL> show domain dm_nums;
DM_NUMS VARCHAR(20) CHARACTER SET UTF8 Nullable
COLLATE NUMS_COLL
SQL> show collation nums_coll;
NUMS_COLL, CHARACTER SET UTF8, FROM EXTERNAL ('UNICODE'), PAD SPACE, 'COLL-VERSION=49.192.5.41'

SQL> exit;

The pack database in .rar, copy this to Windows host, unpack and trying to attach and query table wares:

C:\1INSTALL\FB30SNAP>C:\1INSTALL\FB30SNAP\isql.exe localhost/3333:C:\1INSTALL\FBTEST\tmpicu.fdb
Database: localhost/3333:C:\1INSTALL\FBTEST\tmpicu.fdb
SQL> show table;
WARES
SQL> select * from wares;
Statement failed, SQLSTATE = 22021
COLLATION NUMS_COLL for CHARACTER SET UTF8 is not installed

The same error.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

Regression: 3.0 Alpha 2 [ 10560 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

Except mostly recommended for such cases method (install required ICU version) added switch '-icu' to gfix (and appropriate DPB tag, and appropriate services support) updating ICU-dependent collations and rebuilding dependent indices.

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 3.0 Beta 2 [ 10586 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: Deferred

Test Details: Need original .fdb (which can not be attached on windows host due to ICU problems) for every new test launch because `gfix -icu` will fix problem and this .fdb will be changed.
It would be nice if fbt_run could understand something like this:
'database': 'Unzip',
'zip_file': 'core4571.fdb.zip'
-- where "core4571.fdb.zip" is archive of original database file (not .fbk!) which has troubles.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Closed [ 6 ] => Closed [ 6 ]

QA Status: Deferred => Done successfully

Test Details: Need original .fdb (which can not be attached on windows host due to ICU problems) for every new test launch because `gfix -icu` will fix problem and this .fdb will be changed.
It would be nice if fbt_run could understand something like this:
'database': 'Unzip',
'zip_file': 'core4571.fdb.zip'
-- where "core4571.fdb.zip" is archive of original database file (not .fbk!) which has troubles.

=>

Test Specifics: [Platform (Windows/Linux) specific]

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

No branches or pull requests

2 participants