mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 18:43:03 +01:00
Fixed CORE-1927 - sp_register_character_set can generate the negative RDB$CHARACTER_SET_ID
This commit is contained in:
parent
a302401357
commit
984340e106
@ -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!
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user