Skip to content

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

@esutlie

Description

@esutlie

get_indexes_sql() in src/datajoint/adapters/mysql.py queries COALESCE(COLUMN_NAME, CONCAT('(', EXPRESSION, ')')) from information_schema.STATISTICS, but the EXPRESSION column only exists in MySQL 8.0.13+. On MySQL 5.7 or MariaDB, this fails with Unknown column 'EXPRESSION' in 'field list' the first time any table class is decorated with @schema.

Introduced in commit bd35a7e (PR #1338). Prior to that, the query just selected COLUMN_NAME directly.

A fallback for when EXPRESSION isn't available would fix this for both MySQL < 8.0.13 and MariaDB.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions