diff --git a/src/dsql/ddl.cpp b/src/dsql/ddl.cpp index 06c9e64f55..21dd83ce31 100644 --- a/src/dsql/ddl.cpp +++ b/src/dsql/ddl.cpp @@ -2650,11 +2650,39 @@ static void define_procedure( dsql_req* request, NOD_TYPE op) request->append_uchar(blr_short); request->append_uchar(0); - if (inputs) { + if (inputs) + { request->append_uchar(blr_receive); request->append_uchar(0); } + request->append_uchar(blr_begin); + + if (inputs) + { + parameters = procedure_node->nod_arg[e_prc_inputs]; + dsql_nod** ptr = parameters->nod_arg; + for (const dsql_nod* const* const end = ptr + parameters->nod_count; + ptr < end; ptr++) + { + dsql_nod* parameter = *ptr; + dsql_var* variable = (dsql_var*) parameter->nod_arg[e_var_variable]; + dsql_fld* field = variable->var_field; + + if (field->fld_constrained || field->fld_not_nullable) + { + // ASF: To validate input parameters we need only to read his value. + // Assigning it to null is an easy way to do this. + request->append_uchar(blr_assignment); + request->append_uchar(blr_parameter2); + request->append_uchar(variable->var_msg_number); + request->append_ushort(variable->var_msg_item); + request->append_ushort(variable->var_msg_item + 1); + request->append_uchar(blr_null); + } + } + } + if (outputs) { parameters = procedure_node->nod_arg[e_prc_outputs];