From edbc81199798aa084365a1845188aa24e6ad010b Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Mon, 24 Apr 2023 12:28:46 +0000 Subject: [PATCH] Bug 33584: (follow-up) Remove DEFAULT_GENERATED from column info MySQL 8 returns this additional information for a timestamp such as the timestamp2 in the Commenter test. Which results in the following alter: ALTER TABLE koha_myclone.database_commenter_1 MODIFY COLUMN `timestamp2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP DEFAULT_GENERATED COMMENT 'Column_5' And that statement fails again on that keyword. For now, it seems sufficient to ignore this keyword when building the alter statement. Test plan: Run t/db_dependent/Koha/Database/Commenter.t Signed-off-by: Marcel de Rooy Did test it now under MySQL 8. Signed-off-by: Tomas Cohen Arazi --- Koha/Database/Commenter.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/Koha/Database/Commenter.pm b/Koha/Database/Commenter.pm index c349deffa9..7987b668b9 100644 --- a/Koha/Database/Commenter.pm +++ b/Koha/Database/Commenter.pm @@ -245,6 +245,7 @@ sub _change_column { } # Extra (like autoincrement) + $info->{Extra} =~ s/DEFAULT_GENERATED//; # need to remove it for mysql8 timestamps $rv .= $info->{Extra}. ' ' if $info->{Extra}; # Comment if passed; not passing means clearing actually. -- 2.39.5