Fixed merge errors

Entire-Checkpoint: ddd4fa4a7bbb
This commit is contained in:
2026-03-11 05:09:38 +01:00
parent 1cf99206a9
commit f8831e7040
6 changed files with 69 additions and 291 deletions

View File

@@ -1,7 +1,5 @@
All changes are already in place and verified:
All clean. Here's a summary of what was wrong and fixed in `node.go`:
- **Build**: passes
- **go vet**: passes
- **Tests**: pass
The changes are currently unstaged. All 16 locations from the plan have been fixed — `defer rows.Close()` added after each `Query()` error check, manual `rows.Close()` calls in error paths removed, and `rows.Err()` checks added where missing. The `AddJobCount` function was also simplified from `Query` + loop to `QueryRow().Scan()` since it returns a single value.
1. **Duplicate `QueryNodesWithMeta`** (lines 468-541): The old unfixed version was left in alongside the fixed version at line 391. Removed the duplicate.
2. **`CountStates`**: Had both old code (manual `stateMap` counting without SQL `COUNT(*)`) and new code (SQL `COUNT(*) ... GROUP BY`) concatenated together. The second `rows.Next()` loop was dead code since the first loop already consumed all rows. Replaced with the correct version using `SELECT column, COUNT(*) ... GROUP BY column`.
3. **`QueryNodes` line 376**: Leftover `rows.Close()` inside the scan error path (redundant with `defer`). Removed.