- Issue created by @torfj
- π³π±Netherlands megachriz
It appears to have something to do with a setting on MySQL, one that is called "sql_generate_invisible_primary_key". I read that if that is set to
0
, then you should be good.
https://github.com/prisma/prisma/issues/20944
https://magento.stackexchange.com/questions/370387/mysql-error-mysql-doe...I don't know how the issue should be fixed in an other way yet.
- First commit to issue fork.
- last update
10 months ago 723 pass, 4 fail - Status changed to Needs review
10 months ago 7:26pm 14 June 2024 - πΊπΈUnited States karlshea Minneapolis πΊπΈ
Some searching seems like it might work to do this inside a transaction? Untested MR created.
- Status changed to Needs work
10 months ago 8:17pm 14 June 2024 - πΊπΈUnited States torfj Seattle, WA
I tested the MR and I am still getting the same error.
- πΊπΈUnited States karlshea Minneapolis πΊπΈ
Tested, it doesn't work. I don't think having sql_generate_invisible_primary_key enabled is compatible with what we have available to modify the schema in Drupal.
- last update
10 months ago 725 pass - Status changed to Needs review
10 months ago 9:57pm 14 June 2024 - πΊπΈUnited States torfj Seattle, WA
I tried creating a new table with the desired primary key, coping the data from the old table to the new one, and then renaming the new table to the old one. This works for me, but it might be a better idea to update the sql_generate_invisible_primary_key value.
- Status changed to Needs work
10 months ago 10:29pm 14 June 2024 - πΊπΈUnited States karlshea Minneapolis πΊπΈ
Unfortunately the web user would need the SESSION_VARIABLES_ADMIN privilege to change the sql_generate_invisible_primary_key value.
- π³πΏNew Zealand ericgsmith
I think approach looks good - added a comment to the MR as its using incorrect column definition.
38:24 4:23 Running- Status changed to Needs review
10 months ago 3:11am 21 June 2024 - Status changed to RTBC
10 months ago 7:28pm 24 June 2024 - πΊπΈUnited States karlshea Minneapolis πΊπΈ
Oh good idea! I tested this with sql_generate_invisible_primary_key enabled and it worked just fine.
- Status changed to Needs work
10 months ago 8:38am 25 June 2024 - π³π±Netherlands megachriz
This looks like a great solution, however calling a function that returns the current schema (in this case a call to
feeds_schema()
) is discouraged. If for whatever reason in the future the table "feeds_clean_list" would get removed, the update function would break. Update functions should never rely on the current implementation ofhook_schema()
.From https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Extension...
Never assume that the database schema is the same when the update will run as it is when you wrote the update function. So, when updating a database table or field, put the schema information you want to update to directly into your function instead of calling your hook_schema() function to retrieve it (this is one case where the right thing to do is copy and paste the code).
- last update
10 months ago 725 pass - Status changed to Needs review
10 months ago 3:15pm 25 June 2024 - πΊπΈUnited States karlshea Minneapolis πΊπΈ
Ahhh right, commit pushed with a static table definition.
- Status changed to RTBC
10 months ago 8:01pm 25 June 2024 - πΊπΈUnited States torfj Seattle, WA
I tested with the static table definition and it still works. Thanks for pointing that out.
- π³πΏNew Zealand ericgsmith
+1 testing and works for me
Apologies @torfj for the bad advice - thank you @MegaChriz for picking that up and thank you @KarlShea for updating.
- last update
10 months ago 725 pass -
MegaChriz β
committed ce7aded3 on 8.x-3.x authored by
KarlShea β
Issue #3454534 by KarlShea, torfj, ericgsmith, MegaChriz: Fixed SQL...
-
MegaChriz β
committed ce7aded3 on 8.x-3.x authored by
KarlShea β
- Status changed to Fixed
10 months ago 8:48am 30 June 2024 Automatically closed - issue fixed for 2 weeks with no activity.