-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[Bug]: CleanupBrickTables maintenance task does not recognize bricks with capitalization in name #10427
Comments
Thanks a lot for reporting the issue. The issue was not considered by us as "Priority" or "Backlog", so we're not gonna work on that anytime soon. In case this is a bug report, please create a pull request fixing the issue, we'll then review it as soon as possible. If you're interested in contributing a feature, please contact us first here before creating a pull request, we'll then decide whether we'd accept it or not. Thanks for your understanding. |
Is this related: #12391 ? |
Hi @jdreesen! Sorry for my english. https://github.com/pimcore/pimcore/blob/11.x/lib/Maintenance/Tasks/CleanupBrickTablesTask.php#L51 |
MySQL 8 stores all tables names in lower case by default. ObjectBricks and fieldcollections are created case-sensitiv on the filesystem. The cleanup task uses names from the database, which are lower cased, and tries to find filenames, which are casesensitive.
Expected behavior
CleanupBrickTables runs smoothly, without any errors.
Actual behavior
I've managed to reproduce the problem from #5824.
Our devops used this manual and added lower_case_table_names=1 in accordance with it.
Unfortunately, he did it on the production DB, on Linux and on AWS, so I didn't even have access to mysql system settings and I wasn't aware of the changes.
My next morning started with shouts of angry users, who were completely unable to work with the website. After some research, I changed the actual table names to lower case (luckily, I had access to mysqldump/mysql on production).
So I appreciate the decision taken in Mysql 8 to disallow changing this setting if DB directory has already been initialized.
But now we're getting the error with CleanupBrickTables mentioned in #5824, and I was able to reproduce it on a fresh installation, see the steps to reproduce.
Steps to reproduce
Use Linux, set lower_case_table_names=1 in Mysql config. Create a new DataObject class, named with a capital letter. This creates tables with lower_case, but actual class files are still created case-sensitive. So CleanupBrickTables gets lower_cased Mysql table name and tries to look up a class with a lower_cased filename on a case-sensitive linux filesystem.
But even if we lower_case the filename of the class, datatype definitions (which are string literals in Pimcore) cannot be lower_cased - and Pimcore on Linux still tries to look them up in case-sensitive mode. It should not be a problem on Windows, though - datatype definitions and filenames can be CamelCased there, but CleanupBrickTables should still be able to get them, because the filesystem is case-insensitive there.
I've made a test using fresh & clean Pimcore installation, the result is shown here
The text was updated successfully, but these errors were encountered: