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

bugfix: Parameters from stored procedures in a sub-select where not remaped to the good context in a aggregate query.

example:
SELECT
  (SELECT sp.x FROM SP_TEST(T1.ID) sp)
FROM
  Table1 T1
GROUP BY
  T1.ID
This commit is contained in:
arnobrinkman 2003-04-16 22:49:41 +00:00
parent 1a4b385128
commit 975638783a

View File

@ -5249,7 +5249,7 @@ static DSQL_NOD post_map( DSQL_NOD node, DSQL_CTX context)
static DSQL_NOD remap_field(DSQL_REQ request, DSQL_NOD field, DSQL_CTX context, USHORT current_level) static DSQL_NOD remap_field(DSQL_REQ request, DSQL_NOD field, DSQL_CTX context, USHORT current_level)
{ {
DSQL_NOD *ptr, *end; DSQL_NOD *ptr, *end;
DSQL_CTX lcontext; DSQL_CTX lcontext, lrelation_context;
MAP lmap; MAP lmap;
USHORT ldeepest_level, lcurrent_level; USHORT ldeepest_level, lcurrent_level;
@ -5394,6 +5394,18 @@ static DSQL_NOD remap_field(DSQL_REQ request, DSQL_NOD field, DSQL_CTX context,
} }
return field; return field;
case nod_relation:
lrelation_context = reinterpret_cast<DSQL_CTX>(field->nod_arg[e_rel_context]);
// Check if relation is a procedure
if (lrelation_context->ctx_procedure) {
// If input parameters exists remap those
if (lrelation_context->ctx_proc_inputs) {
lrelation_context->ctx_proc_inputs =
remap_field(request, lrelation_context->ctx_proc_inputs, context, current_level);
}
}
return field;
default: default:
return field; return field;
} }