From 36d647345df3c98a2cc1ad24af31e73aaff4a2e9 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Tue, 31 May 2016 08:15:29 +0200 Subject: [PATCH] Fix bug #1849 MySQL does not accept 0 for DATETIME default --- bacula/src/cats/make_mysql_tables.in | 34 ++++++++++++++-------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/bacula/src/cats/make_mysql_tables.in b/bacula/src/cats/make_mysql_tables.in index 788617de31..8ed859834c 100644 --- a/bacula/src/cats/make_mysql_tables.in +++ b/bacula/src/cats/make_mysql_tables.in @@ -118,7 +118,7 @@ CREATE TABLE Device ( DevWriteTime BIGINT UNSIGNED DEFAULT 0, DevReadTimeSinceCleaning BIGINT UNSIGNED DEFAULT 0, DevWriteTimeSinceCleaning BIGINT UNSIGNED DEFAULT 0, - CleaningDate DATETIME DEFAULT 0, + CleaningDate DATETIME, CleaningPeriod BIGINT UNSIGNED DEFAULT 0, PRIMARY KEY(DeviceId) ); @@ -132,10 +132,10 @@ CREATE TABLE Job ( Level BINARY(1) NOT NULL, ClientId INTEGER DEFAULT 0 REFERENCES Client, JobStatus BINARY(1) NOT NULL, - SchedTime DATETIME DEFAULT 0, - StartTime DATETIME DEFAULT 0, - EndTime DATETIME DEFAULT 0, - RealEndTime DATETIME DEFAULT 0, + SchedTime DATETIME, + StartTime DATETIME, + EndTime DATETIME, + RealEndTime DATETIME, JobTDate BIGINT UNSIGNED DEFAULT 0, VolSessionId INTEGER UNSIGNED DEFAULT 0, VolSessionTime INTEGER UNSIGNED DEFAULT 0, @@ -166,10 +166,10 @@ CREATE TABLE JobHisto ( Level BINARY(1) NOT NULL, ClientId INTEGER DEFAULT 0, JobStatus BINARY(1) NOT NULL, - SchedTime DATETIME DEFAULT 0, - StartTime DATETIME DEFAULT 0, - EndTime DATETIME DEFAULT 0, - RealEndTime DATETIME DEFAULT 0, + SchedTime DATETIME, + StartTime DATETIME, + EndTime DATETIME, + RealEndTime DATETIME, JobTDate BIGINT UNSIGNED DEFAULT 0, VolSessionId INTEGER UNSIGNED DEFAULT 0, VolSessionTime INTEGER UNSIGNED DEFAULT 0, @@ -202,7 +202,7 @@ CREATE TABLE Location ( CREATE TABLE LocationLog ( LocLogId INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, - Date DATETIME DEFAULT 0, + Date DATETIME, Comment BLOB NOT NULL, MediaId INTEGER UNSIGNED DEFAULT 0 REFERENCES Media, LocationId INTEGER UNSIGNED DEFAULT 0 REFERENCES Location, @@ -218,7 +218,7 @@ CREATE TABLE FileSet ( FileSetId INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, FileSet TINYBLOB NOT NULL, MD5 TINYBLOB, - CreateTime DATETIME DEFAULT 0, + CreateTime DATETIME, PRIMARY KEY(FileSetId) ); @@ -246,9 +246,9 @@ CREATE TABLE Media ( MediaType TINYBLOB NOT NULL, MediaTypeId INTEGER UNSIGNED DEFAULT 0 REFERENCES MediaType, LabelType TINYINT DEFAULT 0, - FirstWritten DATETIME DEFAULT 0, - LastWritten DATETIME DEFAULT 0, - LabelDate DATETIME DEFAULT 0, + FirstWritten DATETIME, + LastWritten DATETIME, + LabelDate DATETIME, VolJobs INTEGER UNSIGNED DEFAULT 0, VolFiles INTEGER UNSIGNED DEFAULT 0, VolBlocks INTEGER UNSIGNED DEFAULT 0, @@ -282,7 +282,7 @@ CREATE TABLE Media ( EndBlock INTEGER UNSIGNED DEFAULT 0, LocationId INTEGER UNSIGNED DEFAULT 0 REFERENCES Location, RecycleCount INTEGER UNSIGNED DEFAULT 0, - InitialWrite DATETIME DEFAULT 0, + InitialWrite DATETIME, ScratchPoolId INTEGER UNSIGNED DEFAULT 0 REFERENCES Pool, RecyclePoolId INTEGER UNSIGNED DEFAULT 0 REFERENCES Pool, Comment BLOB, @@ -337,7 +337,7 @@ CREATE TABLE Client ( CREATE TABLE Log ( LogId INTEGER UNSIGNED AUTO_INCREMENT, JobId INTEGER UNSIGNED DEFAULT 0 REFERENCES Job, - Time DATETIME DEFAULT 0, + Time DATETIME, LogText BLOB NOT NULL, PRIMARY KEY(LogId), INDEX (JobId) @@ -376,7 +376,7 @@ CREATE TABLE Counters ( CREATE TABLE CDImages ( MediaId INTEGER UNSIGNED NOT NULL, - LastBurn DATETIME NOT NULL, + LastBurn DATETIME, PRIMARY KEY (MediaId) ); -- 2.39.5