Issue Details (XML | Word | Printable)

Key: CORE-2426
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Adriano dos Santos Fernandes
Reporter: Carlos H. Cantu
Votes: 0
Watchers: 0
Operations

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

Alter table not respecting collation

Created: 14/Apr/09 05:16 AM   Updated: 31/May/11 03:57 PM
Component/s: Charsets/Collation
Affects Version/s: 2.1.2, 2.5 Beta 1
Fix Version/s: 2.5 Beta 2

Time Tracking:
Not Specified

Environment: Windows XP SP3, Firebird SuperServer
Issue Links:
Relate
 

Planning Status: Unspecified


 Description  « Hide
Table already exists with FIELD_A VARCHAR(14) CHARSET WIN1252 COLLATE WIN1252;

Create a domain A_DOMAIN VARCHAR(14) CHARSET WIN1252 COLLATE WINPT_BR;

Use "alter table" to change FIELD_A to type A_DOMAIN

Try to create a FK in some other table, referencing FIELD_A and you will get:

This operation is not defined for system tables.
unsuccessful metadata update.
partner index segment no 1 has incompatible data type.

Looks like FIELD_A still has old collation. If I change system tables to force the new collation, I can create the FK.

 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Adriano dos Santos Fernandes added a comment - 23/Apr/09 06:57 AM
More dangerous behavior observed:

create domain A_DOMAIN VARCHAR(14) CHARacter SET WIN1252 COLLATE WINPT_BR;
create domain B_DOMAIN VARCHAR(14) CHARacter SET ISO8859_1 COLLATE PT_BR;

create table t (FIELD_A VARCHAR(14) CHARacter SET WIN1252 COLLATE WIN1252);
alter table t alter field_a type b_domain;

show table t; -- colattion changes to de_de

Pavel Cisar added a comment - 31/May/11 03:57 PM
QA test added.