Skip to content

fix(mysql): translate column access error 1143 - #1587

Merged
dimitri-yatsenko merged 1 commit into
datajoint:masterfrom
Bhanu73120:fix/mysql-error-1143
Oct 21, 2026
Merged

dimitri-yatsenko merged 1 commit into
datajoint:masterfrom
Bhanu73120:fix/mysql-error-1143

Conversation

@Bhanu73120

Copy link
Copy Markdown

Summary

Fixes #1586.

This PR updates the MySQL adapter's translate_error() method to recognize MySQL error code 1143 (column-level permission denied) and translate it into DataJoint's AccessError.

Changes

  • Added MySQL error code 1143 to the existing access-error handling.
  • Added a regression test in tests/unit/test_adapters.py.

Testing

  • Verified the regression test fails without the fix and passes with it.
  • Ran the adapter unit tests: 67 passed.
  • Ruff lint checks passed.
  • Ruff formatting checks passed.

Notes

The regression test simulates MySQL error 1143 without requiring a live database. A real MySQL permission-denial integration test has not been performed.

@dimitri-yatsenko dimitri-yatsenko added the bug Indicates an unexpected problem or unintended behavior label Oct 17, 2026
@dimitri-yatsenko dimitri-yatsenko added this to the v2.4 milestone Oct 17, 2026
@dimitri-yatsenko dimitri-yatsenko modified the milestones: v2.4, v2.3.5 Oct 17, 2026

@dimitri-yatsenko dimitri-yatsenko left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, this is the right fix. 1143 is the column-level form of 1142, and PostgreSQL already maps both denials to AccessError through 42501, so the backends now agree. The unit test covers the translation without a live server, which is enough for a one-code change.

The same commit, cherry-picked onto maint/2.3 in #1599 for v2.3.5, passes the full CI there.

@dimitri-yatsenko
dimitri-yatsenko merged commit 95573c6 into datajoint:master Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Indicates an unexpected problem or unintended behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MySQL error 1143 (column-level SELECT denied) is not translated to AccessError

2 participants