Skip to content

fix: remove EXPRESSION column dependency in get_indexes_sql()#1437

Open
dimitri-yatsenko wants to merge 1 commit intomasterfrom
fix/1436-indexes-expression-column
Open

fix: remove EXPRESSION column dependency in get_indexes_sql()#1437
dimitri-yatsenko wants to merge 1 commit intomasterfrom
fix/1436-indexes-expression-column

Conversation

@dimitri-yatsenko
Copy link
Copy Markdown
Member

Summary

  • get_indexes_sql() referenced the EXPRESSION column in information_schema.STATISTICS, which only exists in MySQL 8.0.13+
  • This broke @schema decoration on MySQL < 8.0.13 and MariaDB with Unknown column 'EXPRESSION'
  • Use COLUMN_NAME directly — functional indexes (NULL column name) are already filtered out in heading.py

Fixes #1436

Test plan

  • Verify @schema decoration works on MySQL 5.7 or MariaDB
  • Verify secondary indexes are still correctly read on MySQL 8.0+
  • Verify tables with functional indexes don't cause errors (functional index entries are skipped)

@dimitri-yatsenko
Copy link
Copy Markdown
Member Author

Note: DataJoint has not yet explicitly supported functional indexes — that would be a future feature, maybe. So dropping the EXPRESSION reference doesn't lose any current functionality.

The EXPRESSION column in information_schema.STATISTICS only exists in
MySQL 8.0.13+. Add a fallback query without EXPRESSION for MySQL < 8.0.13
and MariaDB. heading.py catches the error and retries with the fallback.

Fixes #1436
@dimitri-yatsenko dimitri-yatsenko force-pushed the fix/1436-indexes-expression-column branch from faa6ccd to aff54de Compare April 23, 2026 04:01
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.

get_indexes_sql() fails on MySQL < 8.0.13 and MariaDB (missing EXPRESSION column)

1 participant