Skip to content

Fix column state leaking between COPY loads (VTA-118540) - #26

Merged
SandeepDave2 merged 2 commits into
mainfrom
VTA-118540-Fix_COPY_not_working_while_loading_data_from_different_source_tables_from_same_VSQL_session
Oct 9, 2026
Merged

SandeepDave2 merged 2 commits into
mainfrom
VTA-118540-Fix_COPY_not_working_while_loading_data_from_different_source_tables_from_same_VSQL_session

Conversation

@SandeepDave2

Copy link
Copy Markdown
Collaborator

Fix:
Successive COPY loads with different column counts could reuse stale column metadata, causing an invalid setter exception.

Make the column count and mapping instance-owned, initialize them for each load, and validate mapping sizes/indexes before binding columns.
Preserve external-table projection and NULL handling.

Addresses VTA-118540.

Verification:
Manually tested in fenced mode on Vertica 26.4.0 with PostgreSQL 15:

  • Same-session 10 → 4 → 10 → 4 column loads pass without reconnecting.
  • Four-slice loads, full/projected external-table queries and subsequent direct COPY pass.
  • Complete values, reordered types and NULL handling match controls.
  • Invalid mappings fail explicitly; corrected loads succeed afterward.
  • Fewer returned columns load correctly with trailing target NULLs.

@SandeepDave2

Copy link
Copy Markdown
Collaborator Author

VTA-118540-Pre-and-Post-Fix-Test-Results.docx

UT details attahced.

@mkottakota1 mkottakota1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a new test case covering this fix scenario?

@SandeepDave2
SandeepDave2 force-pushed the VTA-118540-Fix_COPY_not_working_while_loading_data_from_different_source_tables_from_same_VSQL_session branch from b7c742f to d222aa6 Compare October 9, 2026 04:57
@SandeepDave2

Copy link
Copy Markdown
Collaborator Author

Could you add a new test case covering this fix scenario?

Done.

@mkottakota1 mkottakota1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sandeep has added the new test case which covers the regression. Code changes are looking good

@SandeepDave2
SandeepDave2 merged commit f88bba3 into main Oct 9, 2026
2 checks passed
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.

3 participants