mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 23:23:04 +01:00
Fixed CORE-1811. A solution is to move the validation code from GEN to PASS1 in order to catch bad things earlier. This differs from the SAS solution, but hopefully it's more generic.
This commit is contained in:
parent
8812aecf19
commit
30f7cce178
@ -161,14 +161,6 @@ void GEN_expr( dsql_req* request, dsql_nod* node)
|
||||
return;
|
||||
|
||||
case nod_dom_value:
|
||||
if ((request->req_type != REQ_DDL) ||
|
||||
!(ddl_node = request->req_ddl_node) ||
|
||||
!(ddl_node->nod_type == nod_def_domain ||
|
||||
ddl_node->nod_type == nod_mod_domain))
|
||||
{
|
||||
ERRD_post(isc_sqlerr, isc_arg_number, (SLONG) - 901,
|
||||
isc_arg_gds, isc_dsql_domain_err, 0);
|
||||
}
|
||||
stuff(request, blr_fid);
|
||||
stuff(request, 0); // Context
|
||||
stuff_word(request, 0); // Field id
|
||||
|
@ -1044,6 +1044,17 @@ dsql_nod* PASS1_node(dsql_req* request, dsql_nod* input, bool proc_flag)
|
||||
return node;
|
||||
|
||||
case nod_dom_value:
|
||||
{
|
||||
const dsql_nod* const ddl_node =
|
||||
(request->req_type == REQ_DDL) ? request->req_ddl_node : NULL;
|
||||
if (!ddl_node ||
|
||||
!(ddl_node->nod_type == nod_def_domain ||
|
||||
ddl_node->nod_type == nod_mod_domain))
|
||||
{
|
||||
ERRD_post(isc_sqlerr, isc_arg_number, (SLONG) - 901,
|
||||
isc_arg_gds, isc_dsql_domain_err, 0);
|
||||
}
|
||||
}
|
||||
node = MAKE_node(input->nod_type, input->nod_count);
|
||||
node->nod_desc = input->nod_desc;
|
||||
return node;
|
||||
@ -1054,9 +1065,11 @@ dsql_nod* PASS1_node(dsql_req* request, dsql_nod* input, bool proc_flag)
|
||||
*reinterpret_cast<internal_info_id*>(input->nod_arg[0]->nod_desc.dsc_address);
|
||||
USHORT req_mask = InternalInfo::getMask(id);
|
||||
if (req_mask && !(request->req_flags & req_mask))
|
||||
{
|
||||
ERRD_post(isc_sqlerr, isc_arg_number, (SLONG) - 104,
|
||||
isc_arg_gds, isc_token_err, // Token unknown
|
||||
isc_arg_gds, isc_random, isc_arg_string, InternalInfo::getAlias(id), 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user