Re: [Maria-discuss] Restore from mysqldump fails with "Error in foreign key constraint"
How is providers in the `xu6gc_tj_notification_providers' table defined?
Is it also varchar(100) character sat uft8mbr collate utf8mb4-general-ci ??
The parent and child columns has to match exactly.
On June 3, 2023, at 7:55 AM, Alex
On Sat, Jun 3, 2023 at 11:07 AM mark f edwards wrote:
How is providers in the `xu6gc_tj_notification_providers' table defined?
Is it also varchar(100) character sat uft8mbr collate utf8mb4-general-ci ??
The parent and child columns has to match exactly.
I believe this is what you're asking for? 12798 CREATE TABLE `xu6gc_tj_notification_providers` ( 12799 `provider` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, 12800 `state` int(1) NOT NULL, 12801 PRIMARY KEY (`provider`) 12802 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci; How could the backup succeed (implying the data/schema was created successfully in the first place), but then the restore fails because of that same schema apparently being created incorrectly? Is this a bug that should be reported to Joomla? If so, how do I describe it so they will understand? I don't even really need this table for my testing, so I'll probably just delete it, but it concerns me that I can perform a backup that can't be restored.
https://dba.stackexchange.com/questions/203509/mysql-foreign-key-constraint-...
child says:
`provider` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_*general*_ci
NOT NULL,
parent says:
`provider` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_*unicode*_ci
NOT NULL,
notice collate does not match? mariadb is very particular on how the keys
have to match up perfectly.
this is really not so much as a Joomla issue as it might be when the db was
initially set up. Joomla really does not know (or care) how the data is
stored. i am guessing you can use any SQL like postgres although i have
not used Joomla very much. or maybe Joomla is LAMP only? i forget.
fwiw you could create a sed filter that does something like:
sed --script="s/`provider` varchar(100) CHARACTER SET utf8mb4 COLLATE
utf8mb4_general_ci NOT NULL,/`provider` varchar(100) CHARACTER SET utf8mb4
COLLATE utf8mb4_unicode_ci NOT NULL,/"
sorta a workaround?
and please don't feel alone dealing with this issue. you are in GOOD
COMPANY. many hours have been burned chasing down the foreign key
constraint problem.
Thank you,
Mark Edwards
On Sat, Jun 3, 2023 at 8:24 AM Alex
On Sat, Jun 3, 2023 at 11:07 AM mark f edwards wrote:
How is providers in the `xu6gc_tj_notification_providers' table defined?
Is it also varchar(100) character sat uft8mbr collate utf8mb4-general-ci ??
The parent and child columns has to match exactly.
I believe this is what you're asking for?
12798 CREATE TABLE `xu6gc_tj_notification_providers` ( 12799 `provider` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, 12800 `state` int(1) NOT NULL, 12801 PRIMARY KEY (`provider`) 12802 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
How could the backup succeed (implying the data/schema was created successfully in the first place), but then the restore fails because of that same schema apparently being created incorrectly?
Is this a bug that should be reported to Joomla? If so, how do I describe it so they will understand?
I don't even really need this table for my testing, so I'll probably just delete it, but it concerns me that I can perform a backup that can't be restored.
On 03.06.23 18:06, Mark Edwards wrote:
child says: `provider` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_*general*_ci NOT NULL,
parent says: `provider` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_*unicode*_ci NOT NULL,
notice collate does not match? mariadb is very particular on how the keys have to match up perfectly.
I missed the start of this thread, but this problem looks like https://jira.mariadb.org/browse/MDEV-31086 to me. -- Hartmut Holzgraefe, Principal Support Engineer (EMEA) MariaDB Corporation | http://www.mariadb.com/
Hi, On 6/5/23 6:07 AM, Hartmut Holzgraefe wrote:
On 03.06.23 18:06, Mark Edwards wrote:
child says: `provider` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_*general*_ci NOT NULL,
parent says: `provider` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_*unicode*_ci NOT NULL,
notice collate does not match? mariadb is very particular on how the keys have to match up perfectly.
I missed the start of this thread, but this problem looks like
Yep, that's it. Thanks so much. I suspect by the next time I need this backup for my test server, it'll have been fixed upstream. Thanks also to Mark Edwards for his awesome support.
participants (5)
-
Alex
-
Alex Regan
-
Hartmut Holzgraefe
-
Mark Edwards
-
mark f edwards