Skip to content

Conversation

@joboon
Copy link
Contributor

@joboon joboon commented Nov 6, 2025

Description

Inserting strings or byte arrays which exceed the builtin character limit for PLSQL VARCHAR2 variables causes failures. #102 fixes this issue for single inserts/merges. However, in batch inserts where some VARCHAR2 variables have been converted to LOBs and some have not, the subsequent UNION or RETURNING operations will fail due to inconsistent types.

This change was complicated to fix. Ultimately, it feels like the best thing to do in these scenarios is handle all LOB bulk inserts through PLSQL, where we have the ability to cast input/output as LOB types consistently across an entire column. In order to do that, we have to frontload the real type determination before choosing the code branch. I have attempted to do that in a way that only traverses and casts the createValues object once for efficiency. It will be a net efficiency loss for inserts/merges which do not end up needing PLSQL, though.

As part of testing this change, we found many other deficiencies in the PLSQL merge code path. For example, detecting conflict columns containing a primary key, as well as supporting JSON, UUIDs, boolean, and custom Valuer types in PLSQL. This PR fixes those cases and adds tests for those situations as well.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Numerous unit tests have been added which would fail without the proposed fixes.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Nov 6, 2025
@joboon joboon marked this pull request as ready for review November 6, 2025 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant