Ùse the collate of the domain when altering a domain instead of the default domain of the default character set ---------------------------------------------------------------------------------------------------------------
Key: CORE-5895 URL: http://tracker.firebirdsql.org/browse/CORE-5895 Project: Firebird Core Issue Type: Improvement Affects Versions: 3.0.3, 2.5.8, 4.0 Alpha 1, 3.0.2, 2.5.7, 3.0.1, 2.5.6, 3.0.0, 4.0 Initial, 2.5.5, 2.5.4, 2.5.3 Update 1, 2.1.7, 2.5.3, 2.5.2 Update 1, 2.5.2, 2.5.1, 2.5.0 Environment: Doesn't matter Reporter: Van den Wouwer Danny * Within the 2.xx versions it can be done through direct manipulation of the system tables * Within the 3.xx versions, it can be done with multiple DML statements, but this is ridiculous and still error prune Example, both databases have UTF8 as default character set with UTF8 as default collate DML source: create domain d1 as char(2) collate unicode_ci_ai; create domain d2 as varchar(2) collate unicode_ci_ai; create table t (a d1, b d2); DML target: create domain d1 as char(1) collate unicode_ci_ai; create domain d2 as varchar(1) collate unicode_ci_ai; create table t (a d1, b d2); Change script, to make source a target: ALTER CHARACTER SET UTF8 SET DEFAULT COLLATION UNICODE_CI_AI; ALTER DOMAIN D1 TYPE CHAR(2); ALTER CHARACTER SET UTF8 SET DEFAULT COLLATION UTF8; ALTER CHARACTER SET UTF8 SET DEFAULT COLLATION UNICODE_CI_AI; ALTER DOMAIN D2 TYPE VARCHAR(2); ALTER CHARACTER SET UTF8 SET DEFAULT COLLATION UTF8; * Without these changes we end up with domains with the default collate UTF8 * I think if these domains have indirect dependencies like indices, constraints we could end up with corrupted data (unique constraint) -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://tracker.firebirdsql.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel