8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 20:03:03 +01:00

BY SCALAR_ARRAY param can't be used as a return param.

There's no support for that. It's only input param to the UDF.
This commit is contained in:
robocop 2004-08-27 09:24:39 +00:00
parent e3eb10c4c8
commit 092dd6297e

View File

@ -20,7 +20,7 @@
* All Rights Reserved.
* Contributor(s): ______________________________________.
*
* $Id: ddl.cpp,v 1.110 2004-08-27 04:52:21 robocop Exp $
* $Id: ddl.cpp,v 1.111 2004-08-27 09:24:39 robocop Exp $
* 2001.5.20 Claudio Valderrama: Stop null pointer that leads to a crash,
* caused by incomplete yacc syntax that allows ALTER DOMAIN dom SET;
*
@ -3069,7 +3069,7 @@ static void define_udf( dsql_req* request)
* define a udf to the database.
*
**************************************/
SSHORT position, blob_position;
SSHORT position, blob_position = -1;
dsql_nod* udf_node = request->req_ddl_node;
dsql_nod* arguments = udf_node->nod_arg[e_udf_args];
@ -3147,6 +3147,19 @@ static void define_udf( dsql_req* request)
0);
}
// We'll verify that SCALAR_ARRAY can't be used as a return type.
// The support for SCALAR_ARRAY is only for input parameters.
const dsql_nod* ret_arg = arguments->nod_arg[position - 1];
const dsql_nod* const* param_node = ret_arg->nod_arg;
if (param_node[e_udf_param_type]) {
const SSHORT arg_mechanism = (SSHORT)(IPTR) (param_node[e_udf_param_type]->nod_arg[0]);
if (arg_mechanism == Jrd::FUN_scalar_array)
ERRD_post(isc_sqlerr, isc_arg_number, (SLONG) -607,
isc_arg_gds, isc_random,
isc_arg_string, "BY SCALAR_ARRAY can't be used as a return parameter",
0);
}
request->append_number(isc_dyn_func_return_argument, position);
position = 1;
}
@ -3203,10 +3216,10 @@ static void define_udf( dsql_req* request)
dsql_nod** param_node = (*ptr)->nod_arg;
field = (dsql_fld*) param_node[e_udf_param_field];
request->append_number(isc_dyn_def_function_arg, (SSHORT) position);
request->append_number(isc_dyn_def_function_arg, position);
if (param_node[e_udf_param_type]) {
SSHORT arg_mechanism = (SSHORT)(IPTR) (param_node[e_udf_param_type]->nod_arg[0]);
const SSHORT arg_mechanism = (SSHORT)(IPTR) (param_node[e_udf_param_type]->nod_arg[0]);
request->append_number(isc_dyn_func_mechanism, arg_mechanism);
}
else if (field->fld_dtype == dtype_blob) {