Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-added support for stored procedure 'exec' escape syntax in CallableStatements #2325

Merged
merged 12 commits into from
Feb 15, 2024

Conversation

tkyc
Copy link
Member

@tkyc tkyc commented Feb 8, 2024

Prior to 12.6.0, all cstmts calls were wrapped int T-SQL sp_executesql, sp_prepexec etc.. calls before being sent off to the server. Doing so means the raw/unprocessed user's sql was passed into these T-SQL calls as parameter values and so the driver was able to execute "EXEC" calls against the server eg. EXEC sp_columns_100 ?,?,?,?.....

For example:

exec sp_executesql N'EXEC sp_getapplock @Resource=@P0, @LockTimeout='3600000', @LockMode='Exclusive', @LockOwner='Session',N'@P0 nvarchar(4000)',N'testParamValue'

This PR enables this prior behaviour again.

#2323

@lilgreenbird lilgreenbird added this to In progress in MSSQL JDBC via automation Feb 9, 2024
@lilgreenbird lilgreenbird added this to the 12.6.1 milestone Feb 9, 2024
@lilgreenbird lilgreenbird moved this from In progress to Under Peer Review in MSSQL JDBC Feb 9, 2024
lilgreenbird
lilgreenbird previously approved these changes Feb 9, 2024
MSSQL JDBC automation moved this from Under Peer Review to In progress Feb 9, 2024
Copy link
Member

@lilgreenbird lilgreenbird left a comment

Choose a reason for hiding this comment

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

change the title to something more descriptive instead of just regression fix

@tkyc tkyc changed the title EXEC system stored procedure regression fix Re-added support for stored procedure 'exec' escape syntax in CallableStatements Feb 13, 2024
David-Engel
David-Engel previously approved these changes Feb 13, 2024
@tkyc tkyc merged commit ba88da8 into main Feb 15, 2024
17 checks passed
MSSQL JDBC automation moved this from In progress to Closed/Merged PRs Feb 15, 2024
@tkyc tkyc deleted the sp-regression-fix branch February 15, 2024 22:26
tkyc added a commit that referenced this pull request Feb 15, 2024
…eStatements (#2325)

* EXEC system stored procedure regression fix

* Additional test

* Additional test

* Indenting

* Switched error string to TestResource error string

* CR comments

* Test update p1

* Test update p2

* CR comment changes; Test update

* call escape syntax check

* CR changes

* formatting
tkyc added a commit that referenced this pull request Feb 17, 2024
…eStatements (#2325) (#2329)

* EXEC system stored procedure regression fix

* Additional test

* Additional test

* Indenting

* Switched error string to TestResource error string

* CR comments

* Test update p1

* Test update p2

* CR comment changes; Test update

* call escape syntax check

* CR changes

* formatting
@olerabanal
Copy link

I cannot see #2325 in the release notes of 12.6.1 ? @tkyc

@tkyc
Copy link
Member Author

tkyc commented Feb 21, 2024

@olerabanal #2329 is the backport of this PR to 12.6, which is in the release notes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
MSSQL JDBC
  
Closed/Merged PRs
Development

Successfully merging this pull request may close these issues.

mssql-jdbc:12.6.0.jre11 - 'sp_getapplock' expects parameter '@LockMode'
5 participants