Repository navigation
Return CLOB columns as text in the JDBC Request - #6936
Open
apoorv601singhal wants to merge 1 commit into
Open
apoorv601singhal wants to merge 1 commit into
apoorv601singhal wants to merge 1 commit into
Conversation
processRow appended rs.getObject() to the response and the variables, so CLOB columns showed up as the toString() of the driver's Clob, like oracle.sql.CLOB@1b2c3d. Read them as text, the way CLOB out parameters of callable statements already are. The cut-off read of large CLOBs started at position 0, but CLOB positions start at 1, so it failed for every CLOB above the retain size. Fixes apache#6106
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.
The JDBC Request appended
rs.getObject()to the response and to the variables, so CLOB columns showed up as thetoString()of the driver's Clob (e.g.oracle.sql.CLOB@1b2c3d). CLOB columns are now read as text, reusing the conversion that CLOB out parameters of callable statements already had.While extracting that conversion into
clobToString(), I also fixed the cut-off read of large CLOBs: it calledgetCharacterStream(0, ...), but CLOB positions start at 1, so it failed for every CLOB abovejdbcsampler.max_retain_result_size.Motivation and Context
Fixes #6106
How Has This Been Tested?
Added two tests to
JDBCSamplerTestwith a mockedResultSetreturning ajavax.sql.rowset.serial.SerialClob:body_1variableWithout the change both fail (the response contains
javax.sql.rowset.serial.SerialClob@...). All tests of:src:protocol:jdbcand./gradlew stylepass with JDK 21.Types of changes
Checklist: