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

Alter domain operation for domain with collation specified revert its collation to database default [CORE6324] #6565

Closed
firebird-automations opened this issue Jun 5, 2020 · 11 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @livius2

Is related to CORE1202

After comment in CORE1202 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;

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

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.

@firebird-automations
Copy link
Collaborator Author

Commented by: @livius2

>> 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;

@firebird-automations
Copy link
Collaborator Author

Commented by: @mrotteveel

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.

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

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.

@firebird-automations
Copy link
Collaborator Author

Commented by: @mrotteveel

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 CORE1202 should get some more attention, I think.

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

> Maybe we need to check the SQL speciification.

In SQL 2013, a domain type cannot be changed.

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Closing as the more appropriate issue is CORE1202.

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

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

resolution: Won't Fix [ 2 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: Sean Leyne (seanleyne)

Link: This issue is related to CORE1202 [ CORE1202 ]

@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: No test => Done successfully

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

1 participant