Issue Details (XML | Word | Printable)

Key: CORE-1432
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Adriano dos Santos Fernandes
Reporter: prenosil
Votes: 2
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Collation not propagated between record formats

Created: 29/Aug/07 10:44 AM   Updated: 20/Apr/11 10:05 AM
Component/s: Charsets/Collation
Affects Version/s: 2.0.1, 2.1 Beta 1
Fix Version/s: 2.5 Beta 1

Time Tracking:
Not Specified

Environment: WinXP
Issue Links:
Relate


 Description  « Hide
* First create table/column with domain using case sensitive collation and insert some data:

  CREATE DOMAIN D_1250 VARCHAR(10) CHARACTER SET WIN1250 COLLATE WIN1250;

  CREATE TABLE T (I INTEGER, A D_1250);
  INSERT INTO T VALUES(10, 'a');
  COMMIT;

  SELECT * FROM T WHERE A='A';
  Records affected: 0

  So far o.k.

* And now alter the column to use domain with case insensitive collation:
  CREATE DOMAIN D_CZ VARCHAR(10) CHARACTER SET WIN1250 COLLATE WIN_CZ;
  ALTER TABLE T ALTER A TYPE D_CZ;

But as you can see here, the new collation is not used:
  SELECT * FROM T WHERE A='A';
  Records affected: 0

Although there are now two record formats in RDB$FORMATS,
the engine use values from the old one (because this format is used to store our data)
and does not convert data to new format.

Here, simple dummy update will "fix" it:
  UPDATE T SET I=I;

  SELECT * FROM T WHERE A='A';
            I A
  =========== ==========
           10 a
  Records affected: 1


 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Pavel Cisar added a comment - 20/Apr/11 10:05 AM
QA test added.