Skip to content

Validate row field counts before serialization#86

Merged
nickvanw merged 1 commit into
mainfrom
fix/row-field-length-validation
Jun 16, 2026
Merged

Validate row field counts before serialization#86
nickvanw merged 1 commit into
mainfrom
fix/row-field-length-validation

Conversation

@nickvanw

Copy link
Copy Markdown
Contributor

Summary

  • require row value counts to match the result field list before building column maps
  • return explicit serialization errors for extra or missing values instead of panicking or emitting partial records
  • add direct coverage for both mismatch directions

Evidence

The old convertRowToMap check used idx > len(columns), so a row with exactly one extra value would index columns[len(columns)] and panic. Rows with too few values silently omitted columns because serialization iterated over the partial map.

Validation

  • GOCACHE=/tmp/fivetran-bugbash.qcjUz1/gocache go test ./cmd/internal/server/handlers -run 'TestConvertRowToMapRequiresMatchingColumnCount'
  • GOCACHE=/tmp/fivetran-bugbash.qcjUz1/gocache go test ./cmd/internal/server/handlers
  • git diff --check

@nickvanw nickvanw force-pushed the fix/row-field-length-validation branch from 9ca0c75 to 634c36f Compare June 16, 2026 15:25
@nickvanw nickvanw force-pushed the fix/row-field-length-validation branch from 634c36f to 71c833b Compare June 16, 2026 15:53
@nickvanw nickvanw merged commit 070d3bb into main Jun 16, 2026
8 checks passed
@nickvanw nickvanw deleted the fix/row-field-length-validation branch June 16, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants