Commit 539cf29
authored
fix: FixRawSize SQL column name, join, and filetype bugs (#1037)
Four SQL bugs in task_fix_rawSize.go, all introduced in #855:
1. CanAccept: mpd.miner_id → l.miner_id
market_piece_deal has no miner_id column; join should reference
sector_location.miner_id.
Error: column mpd.miner_id does not exist (SQLSTATE 42703)
2. Do + CanAccept: mpd.sector_number → mpd.sector_num
market_piece_deal column is sector_num, not sector_number.
Masked in Do() because CanAccept always fails first.
3. Do: same sector_number fix in sectors_meta join condition.
4. CanAccept: sector_filetype = 4 → sector_filetype = 1
Restored to FTUnsealed (original value before #855). The task reads
piece data via ReadPiece() which requires unsealed sector data, not
cache. The existing panic guard (storiface.FTUnsealed != 1) confirms
the original intent. Changed to 4 (FTCache) during the #855 rewrite
by copying the pattern from task_treed.go (which correctly uses
FTCache for its own purposes).
Every other query against market_piece_deal in the codebase correctly
uses sector_num (task_check_indexes.go, cachedreader.go, market.go).
Full column-by-column audit performed against schema definitions in:
20260211-fix-raw-size-table.sql, 20240731-market-migration.sql,
20240425-sector_meta.sql, 20230712-sector_index.sql.
All 7 queries in the file verified.
Follow-up to #1035 (array cast fix).1 parent 404589e commit 539cf29
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
| 132 | + | |
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| |||
0 commit comments