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

Fix for bug 2711: Error when calling a procedure with parameters on DB2Z #2765

Merged
merged 3 commits into from Jul 28, 2022
Merged

Fix for bug 2711: Error when calling a procedure with parameters on DB2Z #2765

merged 3 commits into from Jul 28, 2022

Conversation

michaelmatthiaskern
Copy link
Contributor

Environment

Liquibase Version: 4.8.0

Liquibase Integration & Version: CLI

Liquibase Extension(s) & Version: -

Database Vendor & Version: DB2Z 12

Operating System Type & Version: Windows 10 Pro

Pull Request Type

Description

We get an error when calling a procedure with parameters on DB2Z. Neither DB2LUW nor procedures without parameters are affected.

Steps To Reproduce

Create a procedure

CREATE PROCEDURE test(param integer)
BEGIN
END

and call the procedure

<changeSet id="9.36-un-35" author="mkern">
    <sql>CALL test(42)</sql>
</changeSet>

Actual Behavior

You will get the message

NO AUTHORIZED PROCEDURE NAMED TEST HAVING COMPATIBLE ARGUMENTS WAS FOUND. SQLCODE=-440, SQLSTATE=42884

Expected/Desired Behavior

The procedure should be called successfully.

Additional Context

This error is a DB2Z problem and also occurs also in other software, e.g. SQuirreL SQL Client, see https://sourceforge.net/p/squirrel-sql/bugs/1457/.

The issue seems to be due to an incomplete implementation of the JDBC driver or the DB2Z database. Instead of the Statement class the CallableStatement or the PreparedStatement class must be used, more details in the restrictions in https://www.ibm.com/docs/en/db2/11.5?topic=sql-calling-stored-procedures-in-jdbc-applications.

Fast Track PR Acceptance Checklist:

Need Help?

Come chat with us in the Liquibase Forum.

@nvoxland nvoxland added the SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions label Jul 27, 2022
@github-actions
Copy link

github-actions bot commented Jul 27, 2022

Unit Test Results

  4 620 files  ±0    4 620 suites  ±0   35m 12s ⏱️ + 1m 2s
  4 594 tests ±0    4 379 ✔️ ±0     215 💤 ±0  0 ±0 
54 300 runs  ±0  49 280 ✔️ ±0  5 020 💤 ±0  0 ±0 

Results for commit b644c8f. ± Comparison against base commit 28631d9.

♻️ This comment has been updated with latest results.

@nvoxland nvoxland self-requested a review as a code owner July 27, 2022 21:59
@nvoxland nvoxland added SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions autocandidate and removed SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions labels Jul 27, 2022
Copy link
Contributor

@nvoxland nvoxland left a comment

Choose a reason for hiding this comment

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

Code review and test results:

Things to be aware of:

  • Change is isolated to db2/z
  • Change makes sense to me
  • I can't test it but assume the submitter knows it's needed

Things to worry about:

@XDelphiGrl
Copy link
Contributor

@michaelmatthiaskern, hello! I've seen a couple of your PRs today and want to thank you for the very clear bug descriptions. Thanks!!!

Copy link
Contributor

@XDelphiGrl XDelphiGrl left a comment

Choose a reason for hiding this comment

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

  • Fix addresses a bug when DB2Z changesets execute CALL statments using parameterized procedures.
  • Fix is isolated to DB2Z.
  • No additional testing required.

APPROVED

Passing Functional Tests
Passing Test Harness Execution

@nvoxland nvoxland merged commit 7315bf4 into liquibase:master Jul 28, 2022
Conditioning++ automation moved this from To Do to Done Jul 28, 2022
@kataggart kataggart added this to the NEXT milestone Jul 28, 2022
@michaelmatthiaskern michaelmatthiaskern deleted the issue/2711 branch August 12, 2022 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autocandidate DBDB2Z IntegrationCLI OSWindows SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions sprint2022-30 TypeBug ver4.8.0
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Error when calling a procedure with parameters on DB2Z
5 participants