mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 18:03:04 +01:00
Fixed CORE-3806: Wrong data returned if a sub-query or a computed field refers to the base table in the ORDER BY clause.
This commit is contained in:
parent
b0749faa08
commit
fe01201cd4
@ -268,7 +268,7 @@ Sort* SortedStream::init(thread_db* tdbb) const
|
||||
scb->sort(tdbb);
|
||||
|
||||
// For the sake of prudence, set all record parameter blocks to contain
|
||||
// the most recent format. This will guarentee that all fields mapped
|
||||
// the most recent format. This will guarantee that all fields mapped
|
||||
// back to records by get_sort() have homes in the target record.
|
||||
|
||||
if (records)
|
||||
@ -287,7 +287,10 @@ Sort* SortedStream::init(thread_db* tdbb) const
|
||||
stream = item->stream;
|
||||
record_param* const rpb = &request->req_rpb[stream];
|
||||
|
||||
if (rpb->rpb_relation)
|
||||
// dimitr: I've added the check for !isValid to ensure that we don't overwrite
|
||||
// the format for an active rpb (i.e. the one having some record fetched).
|
||||
// See CORE-3806 for example.
|
||||
if (rpb->rpb_relation && !rpb->rpb_number.isValid())
|
||||
VIO_record(tdbb, rpb, MET_current(tdbb, rpb->rpb_relation), tdbb->getDefaultPool());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user