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

Switch to MariaDB #10

Merged
merged 2 commits into from
Jan 26, 2021
Merged

Switch to MariaDB #10

merged 2 commits into from
Jan 26, 2021

Conversation

dfabulich
Copy link
Collaborator

@dfabulich dfabulich commented Jan 25, 2021

This PR switches the IFDB dev environment to MariaDB 10. It seemed to work when I smoke tested it.

Note that IFDB does not work with the current latest MySQL 8, which uses ICU regular expressions instead of MySQL 5 "Henry Spencer" regexes. https://dev.mysql.com/doc/refman/8.0/en/regexp.html#regexp-compatibility

For example, if you just change the mysql line in docker-compose.yml to mysql:8, searches by author fail http://localhost:8080/search?searchfor=author%3AEmily+Short because the query includes this "Henry Spencer" regex: author like '%Emily Short%' or author rlike '[[:<:]]E.*[[:space:]]+Short[[:>:]]'

I did confirm that search by author works as expected in MariaDB 10, but I think without a clear test plan, it's hard to be sure whether this is safe.

@dfabulich dfabulich mentioned this pull request Jan 25, 2021
@dfabulich
Copy link
Collaborator Author

Ah, I found another bug. Switching from MySQL 5 to MariaDB 10 introduces character encoding bugs, e.g. http://localhost:8080/viewlist?id=k7rrytlz3wihmx2o Recommendations by Pegbiter (Malmö, Sweden) which should say Malmö, Sweden

@dfabulich
Copy link
Collaborator Author

I think I've fixed the character encoding issues. MariaDB was defaulting to UTF-8 character encoding. I don't know why … according to this page https://mariadb.com/kb/en/server-system-variables/#character_set_server the default is latin1 (ISO-8859-1), which is what IFDB wants/expects.

But by forcing MariaDB to use latin1, the character encoding bugs seem to have fixed themselves.

@vaughany vaughany merged commit 3ba634d into main Jan 26, 2021
@vaughany vaughany deleted the mariadb branch January 26, 2021 20:28
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

Successfully merging this pull request may close these issues.

2 participants