Repository navigation
Test that an Oracle JSON text parameter past 32,767 bytes binds and is read whole, as a CLOB - #621
Open
jasperblues wants to merge 2 commits into
Open
jasperblues wants to merge 2 commits into
jasperblues wants to merge 2 commits into
Conversation
…hole on Oracle, as a bound list or map literal will be (liberation-data/drivine4j#955)
… text, so a list given as a list crosses 32,767 bytes where its text does
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A guard test, ahead of liberation-data/drivine4j#955's root fix. That fix will have the shared compiler bind a large constant list or map literal as a statement parameter, read as
JSON(:p)orJSON(:p EXTENDED)on Oracle, so that batches of one shape share one cursor. An APOC replay's batch literal is hundreds of KB.drivine-python's Oracle host already binds a str longer than 32,767 UTF-8 bytes as a CLOB (
OracleConnection._bindable,_MAX_TEXT, throughcreatelob). A list or dict parameter is written as JSON text first, so it takes the same path. A plain str bind in thin python-oracledb (26.0.1) fails past 32,767 bytes with ORA-01460, as checked in a probe, so the CLOB is what makes a large parameter work. This test pins it.test_oracle_long_json_parameter.pyand its unasync sync copy run at 4,000, 4,001, 32,767, 32,768, 100 KB and 1 MB:JSON_TABLE(JSON(:p), …);JSON(:p EXTENDED), each item still a double;UNWIND $xs).Each list text is exactly its size as the host writes it (compact JSON), so the list cases cross 32,767 bytes where the text cases do. All 60 pass on Oracle through the test lock. The test is skipped unless
ORACLE_TESTS=true.No source change. drivine4j and Drivine for TypeScript bind the same way, and have the same test (drivine#925).
Review: 1 pass. It found the list cases' compact JSON fell 2 bytes short of the CLOB line at 32,768, and fixed it, rerun green through the lock. It also checked the multibyte boundary in bytes, the sync copy (
unasync --check), and ruff and pyright.