Skip to content

[jdbc-v2] Fixes in the PreparedStatementImpl class, the initial length of the parameters is incorrectly changed in the clearParameters method#2305

Merged
chernser merged 5 commits into
ClickHouse:mainfrom
CCweixiao:dev-2299
Apr 17, 2025
Merged

[jdbc-v2] Fixes in the PreparedStatementImpl class, the initial length of the parameters is incorrectly changed in the clearParameters method#2305
chernser merged 5 commits into
ClickHouse:mainfrom
CCweixiao:dev-2299

Conversation

@CCweixiao

Copy link
Copy Markdown

Summary

Closes #2299

Checklist

Delete items not relevant to your PR:

  • Closes #
  • Unit and integration tests covering the common scenarios were added
  • A human-readable description of the changes was provided to include in CHANGELOG
  • For significant changes, documentation in https://github.com/ClickHouse/clickhouse-docs was updated with further explanations or tutorials

@CLAassistant

CLAassistant commented Apr 14, 2025

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ chernser
❌ jielongping


jielongping seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@chernser

Copy link
Copy Markdown
Contributor

Good day, @CCweixiao!
Thank you for the contribution!
Would you please add at least one test to verify the problem is fixed?

Thanks!

jielongping added 2 commits April 17, 2025 09:57
…h of the parameters is incorrectly changed in the clearParameters method
@CCweixiao

CCweixiao commented Apr 17, 2025

Copy link
Copy Markdown
Author

Good day, @CCweixiao! Thank you for the contribution! Would you please add at least one test to verify the problem is fixed?

Thanks!

Thanks a lot for the code review, I've submitted a test case for the corresponding code fix, please help me review again. @chernser

}

@Override
String compileSql(String[] segments) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is not a good practice - if someone change an original method then test will not be verifying a production code.
Please just make compileSql package private. This is ok because tests sometimes need to do so.

}
}

static class TestPreparedStatementImpl extends PreparedStatementImpl {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

please remove this class.

@chernser

Copy link
Copy Markdown
Contributor

@CCweixiao thanks!
I've reviewed - please see my comments.

@CCweixiao

Copy link
Copy Markdown
Author

@CCweixiao thanks! I've reviewed - please see my comments.

Your suggestion was taken and the test case modifications were completed @chernser

@mshustov
mshustov requested a review from chernser April 17, 2025 07:03
@mzitnik

mzitnik commented Apr 17, 2025

Copy link
Copy Markdown
Contributor

@CCweixiao can you sign the CLA

@CCweixiao

Copy link
Copy Markdown
Author

@CCweixiao can you sign the CLA

image

@chernser
chernser merged commit 6ecc277 into ClickHouse:main Apr 17, 2025
@chernser

Copy link
Copy Markdown
Contributor

Good day, @CCweixiao !

Would you please try signing CLA once again?
Sorry for asking after so long time.

Thanks!

@CCweixiao

Copy link
Copy Markdown
Author

Good day, @CCweixiao !

Would you please try signing CLA once again? Sorry for asking after so long time.

Thanks!

It seems I need to change my commit username and email. I didn't pay attention when submitting before. How should I handle this? Should I bring up a new PR?

@chernser

Copy link
Copy Markdown
Contributor

Yes,
I think new PR will trigger same check and we do not need to merge it - just simple change.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

In the PreparedStatementImpl class, the initial length of the parameters is incorrectly changed in the clearParameters method

4 participants