8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-24 06:03:02 +01:00

Fixed CORE-1005.

This commit is contained in:
dimitr 2006-11-21 07:47:02 +00:00
parent 12097768a5
commit e95f81408d

View File

@ -7460,25 +7460,26 @@ static void set_direction(const jrd_nod* from_clause, jrd_nod* to_clause)
* *
* Functional description * Functional description
* Update the direction of a GROUP BY, DISTINCT, or ORDER BY * 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(from_clause, type_nod);
DEV_BLKCHK(to_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, leave room at the end for an ascending/descending and nulls placement flags,
one for each field */ one for each field */
jrd_nod* const* from_ptr = from_clause->nod_arg + from_clause->nod_count; jrd_nod* const* from_ptr = from_clause->nod_arg;
jrd_nod** to_ptr = to_clause->nod_arg + to_clause->nod_count; jrd_nod** to_ptr = to_clause->nod_arg;
for (const jrd_nod* const* const end = from_ptr + from_clause->nod_count * 2; for (const jrd_nod* const* const end = from_ptr + from_clause->nod_count;
from_ptr < end; from_ptr++) 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) static void set_inactive(OptimizerBlk* opt, const River* river)
{ {
/************************************** /**************************************