Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mysql 8.0 reports DESC etc. for columns in indexes #4293

Closed
sqlalchemy-bot opened this issue Jun 28, 2018 · 3 comments
Closed

mysql 8.0 reports DESC etc. for columns in indexes #4293

sqlalchemy-bot opened this issue Jun 28, 2018 · 3 comments
Labels
bug Something isn't working high priority mysql
Milestone

Comments

@sqlalchemy-bot
Copy link
Collaborator

Migrated issue, originally created by Michael Bayer (@zzzeek)

Postgresql dialect supports this, so for mysql8.0 we have to ramp up the parsing:

from sqlalchemy import *

m1 = MetaData()

t1 = Table(
    'add_ix', m1, Column('x', String(50)), mysql_engine='InnoDB')
Index('foo_idx', t1.c.x.desc())

for url in [
    "postgresql://scott:tiger@localhost/test",
    "mysql://scott:tiger@mysql57/test",
    "mysql://scott:tiger@mysql80/test",
]:

    e = create_engine(url)
    m1.drop_all(e)
    m1.create_all(e)

    insp = inspect(e)
    assert \
        insp.get_indexes("add_ix") == \
        [{'name': 'foo_idx', 'unique': False, 'column_names': ['x']}], \
        "failed on %s" % url


@sqlalchemy-bot
Copy link
Collaborator Author

Michael Bayer (@zzzeek) wrote:

Reflect ASC/DESC in MySQL index columns

Fixed bug in index reflection where on MySQL 8.0 an index that includes
ASC or DESC in an indexed column specfication would not be correctly
reflected, as MySQL 8.0 introduces support for returning this information
in a table definition string.

Change-Id: I21f64984ade690aac8c87dbe3aad0c1ee8e9727f
Fixes: #4293

9d2dc79

@sqlalchemy-bot
Copy link
Collaborator Author

Changes by Michael Bayer (@zzzeek):

  • changed status to closed

@sqlalchemy-bot
Copy link
Collaborator Author

Michael Bayer (@zzzeek) wrote:

Reflect ASC/DESC in MySQL index columns

Fixed bug in index reflection where on MySQL 8.0 an index that includes
ASC or DESC in an indexed column specfication would not be correctly
reflected, as MySQL 8.0 introduces support for returning this information
in a table definition string.

Change-Id: I21f64984ade690aac8c87dbe3aad0c1ee8e9727f
Fixes: #4293
(cherry picked from commit 9d2dc79)

2d5e206

@sqlalchemy-bot sqlalchemy-bot added high priority bug Something isn't working mysql labels Nov 27, 2018
@sqlalchemy-bot sqlalchemy-bot added this to the 1.2.x milestone Nov 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working high priority mysql
Projects
None yet
Development

No branches or pull requests

1 participant