Skip to content

Commit

Permalink
Feature CORE-2777 - Make possible to alter the default database chara…
Browse files Browse the repository at this point in the history
…cter set without manual update of system table
  • Loading branch information
asfernandes committed Dec 7, 2009
1 parent 264252b commit ad4d4b2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
4 changes: 4 additions & 0 deletions src/dsql/ddl.cpp
Expand Up @@ -4254,6 +4254,10 @@ static void modify_database( CompiledStatement* statement)
case nod_end_backup:
statement->append_uchar(isc_dyn_end_backup);
break;
case nod_dfl_charset:
statement->append_cstring(isc_dyn_fld_character_set_name,
((dsql_str*) element->nod_arg[0])->str_data);
break;
default:
break;
}
Expand Down
25 changes: 14 additions & 11 deletions src/dsql/parse.y
Expand Up @@ -3158,17 +3158,20 @@ alter_db : db_alter_clause
{ $$ = make_node (nod_list, (int) 2, $1, $2); }
;

db_alter_clause : ADD db_file_list
{ $$ = $2; }
| ADD KW_DIFFERENCE KW_FILE sql_string
{ $$ = make_node (nod_difference_file, (int) 1, $4); }
| DROP KW_DIFFERENCE KW_FILE
{ $$ = make_node (nod_drop_difference, (int) 0, NULL); }
| BEGIN BACKUP
{ $$ = make_node (nod_begin_backup, (int) 0, NULL); }
| END BACKUP
{ $$ = make_node (nod_end_backup, (int) 0, NULL); }
;
db_alter_clause
: ADD db_file_list
{ $$ = $2; }
| ADD KW_DIFFERENCE KW_FILE sql_string
{ $$ = make_node(nod_difference_file, (int) 1, $4); }
| DROP KW_DIFFERENCE KW_FILE
{ $$ = make_node(nod_drop_difference, (int) 0, NULL); }
| BEGIN BACKUP
{ $$ = make_node(nod_begin_backup, (int) 0, NULL); }
| END BACKUP
{ $$ = make_node(nod_end_backup, (int) 0, NULL); }
| SET DEFAULT CHARACTER SET symbol_character_set_name
{ $$ = make_node(nod_dfl_charset, 1, $5); }
;


// ALTER TRIGGER
Expand Down
3 changes: 3 additions & 0 deletions src/jrd/dyn_mod.epp
Expand Up @@ -305,6 +305,9 @@ void DYN_modify_database( Global* gbl, const UCHAR** ptr)
break;

case isc_dyn_fld_character_set_name:
if (!tdbb->getAttachment()->locksmith())
ERR_post(Arg::Gds(isc_adm_task_denied));

if (GET_STRING(ptr, DBB.RDB$CHARACTER_SET_NAME))
DBB.RDB$CHARACTER_SET_NAME.NULL = FALSE;
else
Expand Down

0 comments on commit ad4d4b2

Please sign in to comment.