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

Schema change parser error with json indexes on MySQL 8 #1982

Closed
Marc3001 opened this issue Mar 1, 2023 · 1 comment
Closed

Schema change parser error with json indexes on MySQL 8 #1982

Marc3001 opened this issue Mar 1, 2023 · 1 comment

Comments

@Marc3001
Copy link

Marc3001 commented Mar 1, 2023

We are currently running Maxwell 1.39.3 to sync a MySQL8 instance to GCP PubSub.
We encountered issue when modifying some tables with json columns.

Maxwell schema parser seems to not like some index creation on JSON fields. It will crash with following error.
ERROR SchemaChange - Error parsing SQL: 'ALTER TABLE tournaments ADD INDEX idx_team_name (('$.teams.name'))'

I don't see any SQL error in this request and it has been successfully processed by MySQL engine.

osheroff added a commit that referenced this issue Mar 11, 2023
@osheroff
Copy link
Collaborator

ok i posted a patch, but i don't think that index isn't doing what you want -- that's literally just indexing the string '$.teams.name', you want something like:

add  INDEX idx ((CAST(data->>"$.teams.name" AS CHAR(30)) COLLATE utf8mb4_bin))

osheroff added a commit that referenced this issue Mar 11, 2023
osheroff added a commit that referenced this issue Mar 11, 2023
- Bugfix issue where SQL query would go missing (#1973)
- Various parser bugfixes (#1970, #1982, #1987)
- Fix issue with renaming a primary key column (#1977)
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

No branches or pull requests

2 participants