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:04:04 UTC

[PR] Add MySQL exception mapping for ColumnNotFoundException [shardingsphere]

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

   Fixes #39124.
   
   Changes proposed in this pull request:
     - Add a `ColumnNotFoundException` branch to `MySQLDialectExceptionMapper.convert()`, mapping it to MySQL error 1054 (`Unknown column '%s' in '%s'`) instead of the generic `UnknownSQLException` fallback.
     - Add `MySQLVendorError.ER_BAD_FIELD_ERROR` and `XOpenSQLState.COLUMN_NOT_FOUND` (`42S22`, standard X/Open 42S code) to back the mapping.
     - Pass the column name before the table name so the message renders as `Unknown column '<column>' in '<table>'`.
     - Aligns MySQL with the PostgreSQL dialect mapper, which already maps `ColumnNotFoundException` to `UNDEFINED_COLUMN`.
   
   ---
   
   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] Add MySQL exception mapping for ColumnNotFoundException [shardingsphere]

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

   Both correct. For `ER_BAD_FIELD_ERROR` the second argument is MySQL's lookup-location context (`field list`), not the table name, so I'll pass `"field list"` for this INSERT column-list path and update the mapper test to assert `Unknown column 'order_id' in 'field list'`. I'll also move the release note to Bug Fixes and fix the PR link.
   


-- 
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] Add MySQL exception mapping for ColumnNotFoundException [shardingsphere]

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


-- 
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] Add MySQL exception mapping for ColumnNotFoundException [shardingsphere]

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

   Done — the mapper now passes `field list` as the `ER_BAD_FIELD_ERROR` location, the test asserts `Unknown column 'order_id' in 'field list'`, and the release note entry moved to Bug Fixes with the `#39126` link.
   


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