mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 00:03:02 +01:00
1) Allow to reference others fields in the expression of ALTER...COMPUTED
2) Documentation
This commit is contained in:
parent
86b80853bf
commit
7d34ead84e
@ -187,3 +187,21 @@ executed to go from input type X to output type Z. If you have such problem in
|
||||
databases created with earlier versions and you have a backup for them that want
|
||||
to restore in FB2, expect to see your database restore being rejected by FB2.
|
||||
|
||||
7) ALTER computed fields
|
||||
(Adriano dos Santos Fernandes)
|
||||
|
||||
Syntax:
|
||||
alter table ...
|
||||
alter <field> [type <data type>] computed by (<expression>);
|
||||
|
||||
Notes:
|
||||
- You cannot alter a non-COMPUTED field to COMPUTED and vice-versa.
|
||||
|
||||
Example:
|
||||
create table test (
|
||||
n integer,
|
||||
dn computed by (n * 2)
|
||||
);
|
||||
|
||||
alter table test
|
||||
alter dn computed by (n + n);
|
||||
|
@ -6715,6 +6715,11 @@ static void modify_field(dsql_req* request,
|
||||
dsql_nod* computedNod = element->nod_arg[e_mod_fld_type_computed];
|
||||
if (computedNod)
|
||||
{
|
||||
if (request->req_context_number)
|
||||
reset_context_stack(request);
|
||||
|
||||
PASS1_make_context(request, request->req_ddl_node->nod_arg[e_alt_name]);
|
||||
|
||||
dsql_str* computedSrc = (dsql_str*) computedNod->nod_arg[e_cmp_text];
|
||||
fb_assert(computedSrc->str_length <= MAX_USHORT);
|
||||
|
||||
@ -6733,6 +6738,8 @@ static void modify_field(dsql_req* request,
|
||||
|
||||
request->append_string(isc_dyn_fld_computed_source,
|
||||
computedSrc->str_data, (USHORT) computedSrc->str_length);
|
||||
|
||||
reset_context_stack(request);
|
||||
}
|
||||
|
||||
const dsql_nod* defNod = element->nod_arg[e_mod_fld_type_default];
|
||||
|
Loading…
Reference in New Issue
Block a user