Skip to content

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

Open
eitsupi wants to merge 1 commit into
adbc-drivers:mainfrom
eitsupi:fix/bulk-ingest-zero-column-guard
Open

fix: guard against zero/excess column count in ExecuteBulkIngest#109
eitsupi wants to merge 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

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
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.

1 participant