mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-24 02:03:03 +01:00
Fixed CORE-1005.
This commit is contained in:
parent
12097768a5
commit
e95f81408d
@ -7460,25 +7460,26 @@ static void set_direction(const jrd_nod* from_clause, jrd_nod* to_clause)
|
||||
*
|
||||
* Functional description
|
||||
* Update the direction of a GROUP BY, DISTINCT, or ORDER BY
|
||||
* clause to the same direction as another clause.
|
||||
* clause to the same direction as another clause. Do the same
|
||||
* for the nulls placement flag.
|
||||
*
|
||||
**************************************/
|
||||
DEV_BLKCHK(from_clause, type_nod);
|
||||
DEV_BLKCHK(to_clause, type_nod);
|
||||
/* all three clauses are allocated with thrice the number of arguments to
|
||||
/* both clauses are allocated with thrice the number of arguments to
|
||||
leave room at the end for an ascending/descending and nulls placement flags,
|
||||
one for each field */
|
||||
jrd_nod* const* from_ptr = from_clause->nod_arg + from_clause->nod_count;
|
||||
jrd_nod** to_ptr = to_clause->nod_arg + to_clause->nod_count;
|
||||
for (const jrd_nod* const* const end = from_ptr + from_clause->nod_count * 2;
|
||||
from_ptr < end; from_ptr++)
|
||||
jrd_nod* const* from_ptr = from_clause->nod_arg;
|
||||
jrd_nod** to_ptr = to_clause->nod_arg;
|
||||
for (const jrd_nod* const* const end = from_ptr + from_clause->nod_count;
|
||||
from_ptr < end; from_ptr++, to_ptr++)
|
||||
{
|
||||
*to_ptr++ = *from_ptr;
|
||||
*(to_ptr + to_clause->nod_count) = *(from_ptr + from_clause->nod_count);
|
||||
*(to_ptr + to_clause->nod_count * 2) = *(from_ptr + from_clause->nod_count * 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void set_inactive(OptimizerBlk* opt, const River* river)
|
||||
{
|
||||
/**************************************
|
||||
|
Loading…
Reference in New Issue
Block a user