mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 02:03:04 +01:00
Backported CORE-3730: isc_dsql_exec_immed2() loses input parameter value with RETURNING clause.
This commit is contained in:
parent
4ab0fafa51
commit
04401c286c
@ -1739,7 +1739,8 @@ static bool_t xdr_sql_blr(
|
||||
if (!(message != 0) ||
|
||||
statement->rsr_format->fmt_length > statement->rsr_fmt_length)
|
||||
{
|
||||
REMOTE_release_messages(message);
|
||||
const REM_MSG org_message = message;
|
||||
const USHORT org_length = message ? statement->rsr_fmt_length : 0;
|
||||
statement->rsr_fmt_length = statement->rsr_format->fmt_length;
|
||||
statement->rsr_buffer = message =
|
||||
(REM_MSG) ALLR_block(type_msg, statement->rsr_fmt_length);
|
||||
@ -1748,6 +1749,14 @@ static bool_t xdr_sql_blr(
|
||||
#ifdef SCROLLABLE_CURSORS
|
||||
message->msg_prior = message;
|
||||
#endif
|
||||
if (org_length)
|
||||
{
|
||||
// dimitr: the original buffer might have something useful inside
|
||||
// (filled by a prior xdr_sql_message() call, for example),
|
||||
// so its contents must be preserved (see CORE-3730)
|
||||
memcpy(message->msg_buffer, org_message->msg_buffer, org_length);
|
||||
}
|
||||
REMOTE_release_messages(org_message);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
Loading…
Reference in New Issue
Block a user