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

[PR] Fix swapped names in PostgreSQL undefined column error message [shardingsphere]

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

   Fixes #39123.
   
   Changes proposed in this pull request:
     - Swap the two arguments passed to `PostgreSQLVendorError.UNDEFINED_COLUMN` in `PostgreSQLDialectExceptionMapper.convert()` so the reason format `Column "%s" of table "%s" does not exist` receives the column name first and the table name second. A missing column `user_id` in table `t_order` now produces `Column "user_id" of table "t_order" does not exist` instead of the reversed message.
     - Aligns this branch with sibling branches in the same mapper (`PRIVILEGE_NOT_GRANTED`, `INVALID_PARAMETER_VALUE`, `PROTOCOL_VIOLATION`) that already match field order to format order.
     - Add `assertConvertColumnNotFoundMessage` asserting the formatted message body; the existing `assertConvert` only checked sqlState and severity, so it missed the swap.
   
   ---
   
   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 swapped names in PostgreSQL undefined column error message [shardingsphere]

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

   Agreed on the mechanics: the mapper only sees the dialect `ColumnNotFoundException` (`database.exception.core…`), which for PostgreSQL is constructed solely in `PostgreSQLComDescribeExecutor`'s INSERT Describe branch. A projected SELECT column throws the infra `ColumnNotFoundException` via `ColumnSegmentBinder`, and `SQLExceptionTransformEngine` routes that through its `ShardingSphereSQLException` branch before the dialect-mapper branch, so it never hits this mapper.
   
   That said, the swapped `Column "x" of table "y" does not exist` text is uniquely `PostgreSQLVendorError.UNDEFINED_COLUMN` from this mapper — the infra path emits `Unknown column '…' in '…'` instead. So #39123's symptom, if it shows that swapped wording, must traverse the extended-protocol Describe (INSERT) phase, and the patch fixes it there. I'll confirm the exact SQL/phase with the reporter and correct the "SELECT" wording. If a plain SELECT is also expected to surface this, that's a separate change in `ColumnSegmentBinder`, out of scope here.
   


-- 
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 swapped names in PostgreSQL undefined column error message [shardingsphere]

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


-- 
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