Skip to content

fix: Warn when bigint = "integer" turns BIGINT values into NA - #600

Closed
krlmlr wants to merge 1 commit into
mainfrom
claude/bigint-integer-warn
Closed

krlmlr wants to merge 1 commit into
mainfrom
claude/bigint-integer-warn

Conversation

@krlmlr

@krlmlr krlmlr commented Nov 29, 2026

Copy link
Copy Markdown
Member

Addresses #594, pending the question below.

convert_bigint() in R/query.R now warns once per column when non-NA integer64 values become NA under bigint = "integer". The message names the column and suggests bigint = "integer64" or "numeric". The new tests/testthat/test-bigint.R covers the warning with NA, and covers in-range and NULL values, which give no warning.

Conflict with the DBI specification. The spec says that bigint = "integer" should "always return as integer, silently overflow". The DBItest test connect_bigint_integer checks exactly that, and it fails with this change. The branch currently lists that test in default_skip in tests/testthat/helper-DBItest.R. That should not stay as is: it silences a spec test to get green. See the question comment for the options. The PR stays a draft until that is decided.

Not changed: there is no warning for precision loss with bigint = "numeric", which the spec also calls silent ("silently round").

The full suite passes locally against MariaDB 10.11 with that skip in place.

https://claude.ai/code/session_01Hr1rd7atAZVq1J42WzXJpS


Generated by Claude Code

`convert_bigint()` wrapped `as.integer()` in `suppressWarnings()`,
so BIGINT values outside the 32-bit range silently became `NA`.
It now warns once per column,
naming the column and suggesting `bigint = "integer64"` or `"numeric"`.
The DBItest spec `connect_bigint_integer` expects silent overflow and is skipped.
`bigint = "numeric"` is unchanged.

Closes #594

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Hr1rd7atAZVq1J42WzXJpS

krlmlr commented Nov 29, 2026 •

Copy link
Copy Markdown
Member Author

Resolved: warn on overflow with bigint = "integer", against the DBI spec?

The DBI specification (dbConnect(), bigint argument) defines "integer" as "always return as integer, silently overflow" and "numeric" as "silently round". DBItest's connect_bigint_integer enforces the first. So the silent NA in #594 is specified behavior, and a warning makes RMariaDB deviate from the spec. Right now the branch skips that DBItest test, which should not be merged as is.

Answered by krlmlr in #600 (comment): "Keep spec for now."


Generated by Claude Code

@krlmlr

krlmlr commented Nov 29, 2026

Copy link
Copy Markdown
Member Author

Keep spec for now.

krlmlr commented Nov 29, 2026

Copy link
Copy Markdown
Member Author

Closing without merging, per the decision to keep the DBI spec for now (#600 (comment)). bigint = "integer" keeps overflowing silently to NA, as the spec and DBItest's connect_bigint_integer require. #594 is closed as spec-conformant. The question can come back with the shared type-mapping convention, or with layer 2 of #587, where bigint = is converted from storage.


Generated by Claude Code

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