Issue Details (XML | Word | Printable)

Key: CORE-6324
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Major Major
Assignee: Unassigned
Reporter: Karol Bieniaszewski
Votes: 0
Watchers: 4
Operations

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

Alter domain operation for domain with collation specified revert its collation to database default

Created: 05/Jun/20 06:06 PM   Updated: 09/Jun/20 09:28 PM
Component/s: Engine
Affects Version/s: 3.0.5
Fix Version/s: None

Issue Links:
Relate
 

QA Status: Done successfully


 Description  « Hide
After comment in CORE-1202 Mark Rotteveel ask me for creating new bug ticket.

CREATE DOMAIN XXX Varchar(1000) CHARACTER SET WIN1250 COLLATE PXW_PLK;

now when you alter its e.g. size

ALTER DOMAIN XXX TYPE VARCHAR(2000);

it will be after ALTER equivalent to

CREATE DOMAIN XXX Varchar(2000) CHARACTER SET WIN1250 COLLATE WIN1250;

as you can see it change PXW_PLK to WIN1250;

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Adriano dos Santos Fernandes added a comment - 05/Jun/20 06:25 PM
What if the default character set is different than the original field character set?

Is it changed too?

If it changes, the charset (and collation) is considered part of the type, and hence are reset if you don't pass them.

Karol Bieniaszewski added a comment - 05/Jun/20 08:25 PM
>> What if the default character set is different than the original field character set?
>> Is it changed too?

tested now and yes it change charset and collation

>> and hence are reset if you don't pass them.

but i cannot pass collation in alter ;-)

but one workaround is:
ALTER CHARACTER SET WIN1250 SET DEFAULT COLLATION PXW_PLK;

and then alter the domain;

Mark Rotteveel added a comment - 06/Jun/20 07:41 AM
Adriano, obviously passing in a different character set will change the collation, as collations are specific to a character set. However ALTER DOMAIN without changing the character set should definitely not change the collation: it should only change those things explicitly specified in the ALTER DOMAIN.

Dmitry Yemanov added a comment - 06/Jun/20 08:04 AM
Character set is not a part of the domain itself, it's a part of its data type. When you change the data type, how should the engine know whether VARCHAR(X) without charset is equivalent to the same passed during CREATE DOMAIN (and thus inheriting the default database charset) or that the prior charset should be preserved? Maybe we need to check the SQL speciification.

Mark Rotteveel added a comment - 06/Jun/20 08:22 AM
Ah, I hadn't considered that, but I just noticed that altering the type of a domain with a different character set than the database default will indeed revert to the database default character set. In that case it seems this is not a bug, but then CORE-1202 should get some more attention, I think.

Adriano dos Santos Fernandes added a comment - 09/Jun/20 01:36 PM
> Maybe we need to check the SQL speciification.

In SQL 2013, a domain type cannot be changed.

Adriano dos Santos Fernandes added a comment - 09/Jun/20 01:37 PM
Closing as the more appropriate issue is CORE-1202.