Skip to content

fix: guard against zero/excess column count in ExecuteBulkIngest#109

Merged
lidavidm merged 1 commit into
adbc-drivers:mainfrom
eitsupi:fix/bulk-ingest-zero-column-guard
Jun 14, 2026
Merged

fix: guard against zero/excess column count in ExecuteBulkIngest#109
lidavidm merged 1 commit into
adbc-drivers:mainfrom
eitsupi:fix/bulk-ingest-zero-column-guard

Conversation

@eitsupi

@eitsupi eitsupi commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

What's Changed

When a schema with zero columns was passed to ExecuteBulkIngest, the expression MySQLMaxPlaceholders / numCols caused a division-by-zero panic. Schemas with more than 65,535 columns would silently produce a batch size of zero.

Add explicit early-return errors for both cases, consistent with how the Dolt driver handles the same condition. Move validation ahead of the createTableIfNeeded call so no database interaction occurs for invalid inputs.

When a schema with zero columns was passed to ExecuteBulkIngest, the
expression `MySQLMaxPlaceholders / numCols` caused a division-by-zero
panic. Schemas with more than 65,535 columns would silently produce a
batch size of zero.

Add explicit early-return errors for both cases, consistent with how
the Dolt driver handles the same condition. Move validation ahead of
the `createTableIfNeeded` call so no database interaction occurs for
invalid inputs.
@eitsupi eitsupi requested a review from lidavidm as a code owner June 14, 2026 12:07

@lidavidm lidavidm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!

@lidavidm lidavidm merged commit f9600a1 into adbc-drivers:main Jun 14, 2026
16 of 17 checks passed
@eitsupi eitsupi deleted the fix/bulk-ingest-zero-column-guard branch June 14, 2026 23:33
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