[Beta] MySQL/MariaDB Database Compatibility #1038
Labels
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: joomla/Component-Builder#1038
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Steps to reproduce the issue
Install on any newer version of MySQL or MariaDB
Expected result
Actual result
System information (as much as possible)
Additional comments
It's not a Joomla issue, it's a MySQL/MariaDB issue. The error is an SQL error regarding the structure of the SQL statement missing a required value. I haven't been able to apply the prescribed fixes successfully, however.
https://mariadb.com/kb/en/sql-mode/
STRICT_TRANS_TABLES
bla-bla-bla...Statements with invalid or missing data are aborted and rolled back
Unfortunately, even disabling STRICT_TRANS_TABLES doesn't resolve this issue. So I'm still fighting this.
So, it is a JCB issue in that a field is defined NOT NULL but does not have a defined default value, AND it is a MySQL/MariaDB issue in that the configuration to bypass the issue prescribed by the project doesn't seem to work (anymore?).
Looking at install.mysql.utf8.sql, we can see that the addcontributors entry has the NOT NULL flag but no default value.
That's the first item in the SQL to have that issue, which is why the installation halts there. Only a few lines later there is "cwrowdin_account_api_key" which also has the issue. I didn't bother to count the number of times this occurs, because it's in the hundreds. The solution remains the same, either fix the issue with the SQL or force the database server to ignore it.
Fixing the SQL would be relatively simple, any item that doesn't have a default value could be null. Just remove the NOT NULL flag because it's going to be blank anyway. Another option would be to insert a default value depending on type. Text = "", *int = 0, etc...
Forcing the DB server to behave like versions past would be the easiest solution, but not all installations may have access to these types of DB configurations.
I agree lets fix the SQL statments and lets add the correct either default or null value.
The database stuff is being build in the BETA branch at this one huge method (that has not been refactored to a class yet, but will be):
What is nice is it all happens right here ;)
I am also sure we can easy move this to a class now... and in the process refine it some more, all its dependencies are already in their own classes:
These are the dependencies:
Here you can see each class (boring for the most part):
CFactory::_('Compiler.Builder.Database.Tables')->
classCFactory::_('Config')->
classCFactory::_('Registry')->
classCFactory::_('Compiler.Builder.Update.Mysql')->
classCFactory::_('Compiler.Builder.Field.Names')->
classCFactory::_('Compiler.Builder.Access.Switch')->
classCFactory::_('Compiler.Builder.Meta.Data')->
classCFactory::_('Compiler.Builder.Database.Unique.Keys')->
classCFactory::_('Compiler.Builder.Database.Keys')->
classCFactory::_('Compiler.Builder.Mysql.Table.Setting')->
classCFactory::_('Customcode.Dispenser')->
classCFactory::_('Placeholder')->
classCFactory::_('Utilities.Counter')->
classThey are already all added to the container via their respective service providers.
I will do this since only I currently have the mapped JCB instance, but on the side of improving the function so that it will meet the new objectives, take a look at the code and tell me where you would change it, and how... if you have time 👍
MySQL/MariaDB Database Compatibilityto [Beta] MySQL/MariaDB Database Compatibility@stutteringp0et we have a code sprint planned tomorrow evening at 9pm (GMT +2) where we would like to go over this part of the compiler and speak about all the angles we need to consider.
Would be great if you can be there!
This has been fixed so this issue seems resolved, let me know if this is not the case.