| 527 | } |
| 528 | |
| 529 | void setDirection(SortNode* fromClause, SortNode* toClause) |
| 530 | { |
| 531 | // Update the direction of a GROUP BY, DISTINCT, or ORDER BY |
| 532 | // clause to the same direction as another clause. Do the same |
| 533 | // for the nulls placement flag. |
| 534 | |
| 535 | const auto fromCount = fromClause->expressions.getCount(); |
| 536 | |
| 537 | fb_assert(fromCount <= toClause->expressions.getCount()); |
| 538 | fb_assert(fromCount == fromClause->direction.getCount() && |
| 539 | fromCount == fromClause->nullOrder.getCount()); |
| 540 | fb_assert(toClause->expressions.getCount() == toClause->direction.getCount() && |
| 541 | toClause->expressions.getCount() == toClause->nullOrder.getCount()); |
| 542 | |
| 543 | for (FB_SIZE_T i = 0; i < fromCount; ++i) |
| 544 | { |
| 545 | toClause->direction[i] = fromClause->direction[i]; |
| 546 | toClause->nullOrder[i] = fromClause->nullOrder[i]; |
| 547 | } |
| 548 | } |
| 549 | |
| 550 | void setPosition(const SortNode* from_clause, SortNode* to_clause, const MapNode* map) |
| 551 | { |