You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "ClaireLytt (via GitHub)" <gi...@apache.org> on 2026/05/04 04:50:38 UTC

[PR] Fix No value specified for parameter exception when sql is 'INSERT INTO tableName *** ON CONFLICT *** DO UPDATE set ** WHERE ***' [shardingsphere]

ClaireLytt opened a new pull request, #38668:
URL: https://github.com/apache/shardingsphere/pull/38668

   Fixes https://github.com/apache/shardingsphere/issues/32280.
   
   Changes proposed in this pull request:
     -
   
   ---
   
   Before committing this PR, I'm sure that I have checked the following options:
   - [x] My code follows the [code of conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) of this project.
   - [x] I have self-reviewed the commit code.
   - [ ] I have (or in comment I request) added corresponding labels for the pull request.
   - [x] I have passed maven check locally : `./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e`.
   - [ ] I have made corresponding changes to the documentation.
   - [x] I have added corresponding unit tests for my changes.
   - [x] I have updated the Release Notes of the current development version. For more details, see [Update Release Note](https://shardingsphere.apache.org/community/en/involved/contribute/contributor/)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix No value specified for parameter exception when sql is 'INSERT INTO tableName *** ON CONFLICT *** DO UPDATE set ** WHERE ***' [shardingsphere]

Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu commented on PR #38668:
URL: https://github.com/apache/shardingsphere/pull/38668#issuecomment-4528878912

   Decision
   
   Merge Verdict: Mergeable
   Reviewed Scope: PR #38668 latest head 5c126f9; PostgreSQL parser visitor, parser IT fixtures, release note, PR/issue/CI metadata, PostgreSQL official INSERT docs.
   Not Reviewed Scope: full runtime JDBC prepared-statement reproduction and full repository build were not run locally.
   Need Expert Review: No.
   Basis
   
   The root cause is covered. Issue #32280 reports ShardingSphere-JDBC 5.4.1 failing on the third placeholder in:
   
   INSERT INTO tableName (...) VALUES (?, now(), ?) ON CONFLICT (...) DO UPDATE SET ... WHERE ... ?
   with PostgreSQL reporting parameter 3 unset. The old visitor only visited setClauseList; the PR now also visits optConfExpr() and the ON CONFLICT DO UPDATE whereClause(), so the third marker is collected before InsertStatement.addParameterMarkers(...) runs. The added parser IT case has three expected parameters, and the shared parser assertion checks actual parameter count against that fixture.
   
   PostgreSQL syntax supports this exact shape: ON CONFLICT ... DO UPDATE SET ... [WHERE condition], and the official docs also define conflict targets with optional predicates and describe ON CONFLICT DO UPDATE WHERE behavior. Sources: [PR files](https://github.com/apache/shardingsphere/pull/38668/files), [issue #32280](https://github.com/apache/shardingsphere/issues/32280), [PostgreSQL INSERT docs](https://www.postgresql.org/docs/current/sql-insert.html).
   
   Risk scan passed: no grammar change, no public API/SPI change, no dependency change, no computeIfAbsent, and no cross-dialect blast radius. Per CODE_OF_CONDUCT.md, PostgreSQL has no listed branch dialect; I also checked openGauss separately and it does not use this optOnConflict grammar path. Existing PostgreSQL DO NOTHING and SET status = ? paths remain structurally intact.
   
   Pre-Merge Checks
   
   GitHub checks on head 5c126f9: 28 success, 3 skipped. Includes CheckStyle, Spotless, License, CI, and PostgreSQL JDBC/Proxy E2E smoke jobs.
   
   Key commands run:
   
   git fetch apache pull/38668/head:refs/remotes/apache/pr-38668: exit 0
   git fetch apache master:refs/remotes/apache/master: exit 0
   git diff --check apache/master...apache/pr-38668: exit 0
   curl .../pulls/38668, curl .../check-runs?per_page=100: exit 0
   rg scans for computeIfAbsent, dependency files, generated target/ changes: no matches
   Two early rg attempts used outdated grammar paths and exited 2; reran with the correct parser paths.
   Self-check: no merge blockers found; only non-blocking polish would be fixing the typo conflit in the test case id and making the release-note wording more readable.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix No value specified for parameter exception when sql is 'INSERT INTO tableName *** ON CONFLICT *** DO UPDATE set ** WHERE ***' [shardingsphere]

Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu merged PR #38668:
URL: https://github.com/apache/shardingsphere/pull/38668


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org