Skip to content

Oracle: date/time: Fix writing of mismatched c/sql type.#963

Merged
detule merged 4 commits intor-dbi:mainfrom
detule:959-oracle-date-type
Dec 1, 2025
Merged

Oracle: date/time: Fix writing of mismatched c/sql type.#963
detule merged 4 commits intor-dbi:mainfrom
detule:959-oracle-date-type

Conversation

@detule
Copy link
Collaborator

@detule detule commented Nov 4, 2025

There is more information in #959. The condensed story is:

  • OEM and PRO oracle drivers exhibit different sensitivities when writing buffers of c type that doesn't exactly match the target sql type. Think writing character buffers to Oracle::DATE targets, for example.
  • The SQLBindParameters API call has two types (target parameter SQL type, and buffer C type), and two buffer sizes (target parameter size, and buffer size). It is important that these are specified correctly since it seems some drivers are more flexible than others (if we correctly specify the c type, the buffer length is inferred correctly in some cases, and not in others).
  • This PR attempts to:
    • Respect the fact that both OEM and PRO drivers map the Oracle::DATE type to the ODBC SQL_TYPE_TIMESTAMP.
    • Patch the more generic nanodbc code so that the buffer length argument to the SQLBindParameter API call is correctly reported.

This last bullet point in particular, is in the codepath used by other drivers, and all other databases so we need to make sure:

Closes #962 #959

Copy link
Collaborator

@simonpcouch simonpcouch left a comment

Choose a reason for hiding this comment

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

Looking good!

@detule detule merged commit 3dab591 into r-dbi:main Dec 1, 2025
18 of 19 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.

Remove stray debug print statements from recent commit

2 participants