Skip to content

Commit 1790e51

Browse files
committed
Fixed bug #8851 : 'Internal error' when calling outer procedure after deleting unused result variable from inner procedure
1 parent a42ec44 commit 1790e51

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/jrd/recsrc/ProcedureScan.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ void ProcedureScan::internalOpen(thread_db* tdbb) const
7272

7373
const_cast<jrd_prc*>(m_procedure)->checkReload(tdbb);
7474

75+
// Procedure could be altered and its record format changed since current instance of
76+
// ProcedureScan was created. Here it is not the right place to check if new format is
77+
// compatible with caller's expectations, so we just use correct (possible new) format.
78+
79+
m_format = m_procedure->prc_record_format;
80+
7581
Request* const request = tdbb->getRequest();
7682
Impure* const impure = request->getImpure<Impure>(m_impure);
7783

@@ -229,6 +235,8 @@ bool ProcedureScan::internalGetRecord(thread_db* tdbb) const
229235

230236
trace.fetch(false, ITracePlugin::RESULT_SUCCESS);
231237

238+
fb_assert(m_format == m_procedure->prc_record_format);
239+
232240
for (USHORT i = 0; i < m_format->fmt_count; i++)
233241
{
234242
assignParams(tdbb, &msg_format->fmt_desc[2 * i], &msg_format->fmt_desc[2 * i + 1],

src/jrd/recsrc/RecordSource.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ namespace Jrd
170170

171171
protected:
172172
const StreamType m_stream;
173-
const Format* const m_format;
173+
mutable const Format* m_format;
174174
};
175175

176176

0 commit comments

Comments
 (0)