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

[MM-58341] db/migrations: mysql-8.4 fix for 000027_create_status #27080

Merged
merged 4 commits into from
Jun 5, 2024

Conversation

isacikgoz
Copy link
Member

Summary

MySQL v8.4 introduces a new reserved work for Manual hence it was causing errors during creating the new Status table. This issue was affecting new installations using mysql-8.4.

Ticket Link

https://mattermost.atlassian.net/browse/MM-58341

Release Note

NONE

@isacikgoz isacikgoz added the 2: Dev Review Requires review by a developer label May 21, 2024
@isacikgoz isacikgoz requested a review from a team as a code owner May 21, 2024 10:53
@mm-cloud-bot mm-cloud-bot added the release-note-none Denotes a PR that doesn't merit a release note. label May 21, 2024
Copy link
Member

@agnivade agnivade left a comment

Choose a reason for hiding this comment

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

MySQL is dead. Long live MySQL.

Copy link
Member

@harshilsharma63 harshilsharma63 left a comment

Choose a reason for hiding this comment

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

While this fixes the migration, we also need to make the same change wherever we're querying this column in SQL store. For example, running this branch generates this error on opening webapp when the server tries to update user's status-

{
  "timestamp": "2024-05-23 09:04:18.344 +05:30",
  "level": "warn",
  "msg": "Failed to save status",
  "caller": "platform/status.go:288",
  "user_id": "ctgbai6zc3fyupk6zpynzdrsme",
  "error": "failed to upsert Status: Error 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Manual,LastActivityAt,DNDEndTime,PrevStatus) VALUES (?,?,?,?,?,?) ON DUPLICATE K' at line 1"
}

So, we need to handle this in other places as well.

@agnivade
Copy link
Member

Ah nice catch Harshil

Copy link

⚠️ One or more flaky tests detected ⚠️

@isacikgoz
Copy link
Member Author

/update-branch

@isacikgoz isacikgoz merged commit 179d28e into master Jun 5, 2024
41 checks passed
@isacikgoz isacikgoz deleted the MM-58341 branch June 5, 2024 16:52
@amyblais amyblais added Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation labels Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2: Dev Review Requires review by a developer Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation release-note-none Denotes a PR that doesn't merit a release note.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants