Skip to content

Commit

Permalink
[CBRD-24961] SP's out parameters takes wrong value (#4617)
Browse files Browse the repository at this point in the history
http://jira.cubrid.org/browse/CBRD-24961

When sending db_values for out arguments, an index of the argument array was wrongly assigned.
It fixes the wrong assigned index by using dummy null db_values.
  • Loading branch information
hgryoo authored Aug 30, 2023
1 parent 635dbe7 commit 29a71e1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/communication/network_interface_sr.c
Original file line number Diff line number Diff line change
Expand Up @@ -10442,10 +10442,12 @@ smethod_invoke_fold_constants (THREAD_ENTRY * thread_p, unsigned int rid, char *
{
/* 3) make out arguments */

method_sig_node *sig = sig_list.method_sig;
// *INDENT-OFF*
std::vector<std::reference_wrapper<DB_VALUE>> out_args;
DB_VALUE dummy_null;
db_make_null (&dummy_null);
std::vector<std::reference_wrapper<DB_VALUE>> out_args (sig->num_method_args, dummy_null);
// *INDENT-ON*
method_sig_node *sig = sig_list.method_sig;
for (int i = 0; i < sig->num_method_args; i++)
{
if (sig->arg_info.arg_mode[i] == METHOD_ARG_MODE_IN)
Expand All @@ -10454,7 +10456,7 @@ smethod_invoke_fold_constants (THREAD_ENTRY * thread_p, unsigned int rid, char *
}

int pos = sig->method_arg_pos[i];
out_args.push_back (std::ref (args[pos]));
out_args[pos] = std::ref (args[pos]);
}

/* 4) pack */
Expand Down

0 comments on commit 29a71e1

Please sign in to comment.