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

Remove "CHARSET" config option for MySQL, always use "utf8mb4" #25413

Merged
merged 3 commits into from
Jun 21, 2023

Conversation

wxiaoguang
Copy link
Contributor

@wxiaoguang wxiaoguang commented Jun 21, 2023

In modern days, there is no reason to make users set "charset" anymore.

Close #25378

⚠️ BREAKING

The key [database].CHARSET was removed completely as every newer (>10years) MySQL database supports utf8mb4 already.
There is a (deliberately) undocumented new fallback option if anyone still needs to use it, but we don't recommend using it as it simply causes problems.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jun 21, 2023
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 21, 2023
@techknowlogick techknowlogick added the pr/breaking Merging this PR means builds will break. Needs a description what exactly breaks, and how to fix it! label Jun 21, 2023
@wxiaoguang wxiaoguang added the backport/v1.20 This PR should be backported to Gitea 1.20 label Jun 21, 2023
@wxiaoguang
Copy link
Contributor Author

@techknowlogick I do not think this is "breaking"

@techknowlogick
Copy link
Member

techknowlogick commented Jun 21, 2023

Marking as breaking so that should any user still have just utf8 in their config we can add a note to the blog post with a link to the doctor documentation.

Edit, it also changes the config variable name.

@wxiaoguang
Copy link
Contributor Author

Marking as breaking so that should any user still have just utf8 in their config we can add a note to the blog post with a link to the doctor documentation

I do not see a case how this change would affect end users, so I do not think it's worth to mark it as breaking or make end users spend time on reading it.

@wxiaoguang
Copy link
Contributor Author

Edit, it also changes the config variable name.

The new "MYSQL_CHARSET" is just a hidden fallback in case some users really really like to do something, but, I think we should never mention it. Just like I_AM_BEING_UNSAFE_RUNNING_.....

I do not think any one really needs it.

@techknowlogick
Copy link
Member

It fully removes an option that users may have been using (even if they should be using the newer version), and also, due to the rename it means that users will have to use a new key in the future.

@wxiaoguang
Copy link
Contributor Author

It fully removes an option that users may have been using (even if they should be using the newer version), and also, due to the rename it means that users will have to use a new key in the future.

I am pretty sure the removal affects nothing.

The "rename" won't be exposed for end users in any case.

@lunny
Copy link
Member

lunny commented Jun 21, 2023

It fully removes an option that users may have been using (even if they should be using the newer version), and also, due to the rename it means that users will have to use a new key in the future.

I am pretty sure the removal affects nothing.

The "rename" won't be exposed for end users in any case.

The Gitea instance will not work if database is utf8 but the connection string is utf8mb4

@wxiaoguang
Copy link
Contributor Author

The Gitea instance will not work if database is utf8 but the connection string is utf8mb4

I have tested, it works flawlessly

If you have a bad case, please help me to know.

@lunny
Copy link
Member

lunny commented Jun 21, 2023

The Gitea instance will not work if database is utf8 but the connection string is utf8mb4

I have tested, it works flawlessly

If you have a bad case, please help me to know.

Have you tested inputting an emoji? Maybe we just need to say on the release blog that you need to convert your database from utf8 -> utf8mb4 manually.

@wxiaoguang
Copy link
Contributor Author

wxiaoguang commented Jun 21, 2023

Have you tested inputting an emoji? Maybe we just need to say on the release blog that you need to convert your database from utf8 -> utf8mb4 manually.

That's a longstanding problem. Not related to this PR (nothing changes)

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jun 21, 2023
@lunny
Copy link
Member

lunny commented Jun 21, 2023

I don't think it's necessary to backport to v1.20

@wxiaoguang
Copy link
Contributor Author

I don't think it's necessary to backport to v1.20

Then 1.20 still needs other fix

@wxiaoguang wxiaoguang removed pr/breaking Merging this PR means builds will break. Needs a description what exactly breaks, and how to fix it! backport/v1.20 This PR should be backported to Gitea 1.20 labels Jun 21, 2023
@delvh
Copy link
Member

delvh commented Jun 21, 2023

But yes, we should document it as breaking when we don't use a key anymore.
And let it just be so that users can remove it from their config.

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jun 21, 2023
@delvh delvh added the pr/breaking Merging this PR means builds will break. Needs a description what exactly breaks, and how to fix it! label Jun 21, 2023
@delvh
Copy link
Member

delvh commented Jun 21, 2023

Oh, perhaps we should also remove the FAQ entry now.

@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jun 21, 2023
@lunny lunny enabled auto-merge (squash) June 21, 2023 10:33
@lunny lunny merged commit ce46834 into go-gitea:main Jun 21, 2023
23 checks passed
@GiteaBot GiteaBot added this to the 1.21.0 milestone Jun 21, 2023
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jun 21, 2023
@wxiaoguang wxiaoguang deleted the fix-install-mysql branch June 21, 2023 13:10
silverwind added a commit to silverwind/gitea that referenced this pull request Jun 21, 2023
* origin/main: (47 commits)
  Move some regexp out of functions (go-gitea#25430)
  Show outdated comments in files changed tab (go-gitea#24936)
  Remove "CHARSET" config option for MySQL, always use "utf8mb4" (go-gitea#25413)
  Fine tune project board label colors and modal content background (go-gitea#25419)
  Fix missing commit message body when the message has leading newlines (go-gitea#25418)
  add python/poetry to devcontainer (go-gitea#25407)
  Refactor path & config system (go-gitea#25330)
  Add actor and status dropdowns to run list (go-gitea#25118)
  Use the new download domain replace the old (go-gitea#25405)
  Avoid polluting config file when "save" (go-gitea#25395)
  Fix dropdown icon layout on diff page (go-gitea#25397)
  Support configuration variables on Gitea Actions (go-gitea#24724)
  Substitute variables in path names of template repos too (go-gitea#25294)
  Navbar styling rework (go-gitea#25343)
  Fix blank dir message when uploading files from web editor (go-gitea#25391)
  Add git-lfs support to devcontainer (go-gitea#25385)
  Use qwtel.sqlite-viewer instead of alexcvzz.vscode-sqlite (go-gitea#25386)
  Use Actions git context instead of dynamically created buildkit one (go-gitea#25381)
  rename tributeValues to mentionValues (go-gitea#25375)
  Fix LDAP sync when Username Attribute is empty (go-gitea#25278)
  ...
6543 pushed a commit that referenced this pull request Jun 22, 2023
TBH, I don't see much difference from `Remove "CHARSET" config option
for MySQL, always use "utf8mb4"` #25413

Close #25413
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Sep 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. pr/breaking Merging this PR means builds will break. Needs a description what exactly breaks, and how to fix it! size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Newly installed instance could use incorrect "utf8" charset for MySQL
5 participants