Files
mysql2postgres/src
alex 49b9772dba fix: CRITICAL - Do not re-sort rows by NodeNum after MySQL ORDER BY consolidation key
Bug: After fetching rows ordered by consolidation key (UnitName, ToolNameID,
EventDate, EventTime) from MySQL, code was re-sorting by NodeNum. This breaks
the grouping because rows with different consolidation keys get intermixed.

Example of what was happening:
- MySQL returns: (Unit1, Tool1, Date1, Time1, Node1),
                 (Unit1, Tool1, Date1, Time1, Node12),
                 (Unit2, Tool2, Date2, Time2, Node1)
- Re-sorting by NodeNum gives: (Unit1, Tool1, Date1, Time1, Node1),
                               (Unit2, Tool2, Date2, Time2, Node1),
                               (Unit1, Tool1, Date1, Time1, Node12)
- Result: Different consolidation keys are now mixed, each node becomes separate group!

Fix: Remove the re-sort. Trust MySQL's ORDER BY to keep rows of same key together.
The clustering nature of InnoDB ensures rows with same consolidation key are
physically adjacent.

This was causing 1 row per node instead of consolidating all nodes of same
measurement into 1 row.

🤖 Generated with Claude Code

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2025-12-26 20:15:00 +01:00
..