From: Eric Bollengier Date: Tue, 15 Dec 2020 12:48:27 +0000 (+0100) Subject: Fix MySQL update procedure with incorrect handling of the FileIndex type X-Git-Tag: Release-11.3.2~793 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7ef5101b302ac6fdb3236387924c494bb48ef5c3;p=thirdparty%2Fbacula.git Fix MySQL update procedure with incorrect handling of the FileIndex type Upgrade fails as follows: This script will update a Bacula MySQL database from any from version 12-15 or 1014-1021 to version 1022 which is needed to convert from any Bacula Enterprise version 4.0.x or later to version 12.4.x or Bacula Community versions 5.0.x, 5.2.x, 7.4.x, 9.x.x to Community version 11.0 Depending on the current version of your catalog, you may have to run this script multiple times ERROR 1264 (22003) at line 24: Out of range value for column 'FileIndex' at row 1 Update of Bacula MySQL tables from 16 to 1017 failed. This would indicate that the file_temp table is using an unsigned version of FileIndex however it should be signed, so changing the schema of that temp table makes it go further, --- diff --git a/bacula/src/cats/update_mysql_tables.in b/bacula/src/cats/update_mysql_tables.in index c3703c398..be73b3e6a 100644 --- a/bacula/src/cats/update_mysql_tables.in +++ b/bacula/src/cats/update_mysql_tables.in @@ -171,7 +171,7 @@ DROP INDEX JobId_2 on File; CREATE TABLE file_temp ( FileId BIGINT UNSIGNED NOT NULL, - FileIndex INTEGER UNSIGNED DEFAULT 0, + FileIndex INTEGER DEFAULT 0, JobId INTEGER UNSIGNED NOT NULL, PathId INTEGER UNSIGNED NOT NULL, Filename BLOB NOT NULL, @@ -221,7 +221,7 @@ DROP INDEX JobId_2 on File; CREATE TABLE file_temp ( FileId BIGINT UNSIGNED NOT NULL, - FileIndex INTEGER UNSIGNED DEFAULT 0, + FileIndex INTEGER DEFAULT 0, JobId INTEGER UNSIGNED NOT NULL, PathId INTEGER UNSIGNED NOT NULL, Filename BLOB NOT NULL,