Skip to content

[JDBC-V2] fix(StatementImpl/PreparedStatementImpl): prevent duplicate data insertion by clearing batch after execution for issue-2548 #2549

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

potoo0
Copy link

@potoo0 potoo0 commented Aug 20, 2025

Summary

  • Override clearBatch for PreparedStatementImpl
  • Clears the internal batch state immediately after executeBatch() to prevent parameter leakage and enable safe statement reuse.

Closes #2548

Checklist

Delete items not relevant to your PR:

@CLAassistant
Copy link

CLAassistant commented Aug 20, 2025

CLA assistant check
All committers have signed the CLA.

@chernser
Copy link
Contributor

@potoo0 please sign CLA

@chernser
Copy link
Contributor

This change requires tests. I see only example code change (what is should not be).

Thanks!

@potoo0
Copy link
Author

potoo0 commented Aug 21, 2025

This change requires tests. I see only example code change (what is should not be).

@chernser
Thanks for the review! I've added the tests for this change.

@potoo0 potoo0 marked this pull request as ready for review August 21, 2025 15:30
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.

[jdbc-v2] Critical: executeBatch reuse causes duplicate data insertion after 0.8.6
3 participants