diff --git a/src/misc/intl.sql b/src/misc/intl.sql index 667f42b21d..bd5011401e 100644 --- a/src/misc/intl.sql +++ b/src/misc/intl.sql @@ -40,17 +40,20 @@ begin break; end - insert into rdb$types - (rdb$field_name, rdb$type, rdb$type_name, rdb$system_flag) - values ('RDB$CHARACTER_SET_NAME', :id, :name, 0); + if (id > 0) then + begin + insert into rdb$types + (rdb$field_name, rdb$type, rdb$type_name, rdb$system_flag) + values ('RDB$CHARACTER_SET_NAME', :id, :name, 0); - insert into rdb$character_sets - (rdb$character_set_name, rdb$character_set_id, rdb$system_flag, rdb$bytes_per_character, rdb$default_collate_name) - values (:name, :id, 0, :max_bytes_per_character, :name); + insert into rdb$character_sets + (rdb$character_set_name, rdb$character_set_id, rdb$system_flag, rdb$bytes_per_character, rdb$default_collate_name) + values (:name, :id, 0, :max_bytes_per_character, :name); - insert into rdb$collations - (rdb$collation_name, rdb$collation_id, rdb$character_set_id, rdb$system_flag) - values (:name, 0, :id, 0); + insert into rdb$collations + (rdb$collation_name, rdb$collation_id, rdb$character_set_id, rdb$system_flag) + values (:name, 0, :id, 0); + end end! @@ -73,6 +76,9 @@ begin delete from rdb$character_sets where rdb$character_set_id = :id; + + delete from rdb$types + where rdb$field_name = 'RDB$CHARACTER_SET_NAME' and rdb$type_name = :name; end!