On 03/18/18 07:29, Erik P. Olsen wrote: > My installation is the following: > > Fedora 27 fully upgraded > mariadb-10.2.13-2.fc27.x86_64 > bacula-director-9.0.6-2.fc27.x86_64 > > I've just upgraded Fedora from 26 to 27 which also did an upgrade of bacula > from 7.4.7 to > 9.0.6 and therefore I ran update_bacula_tables with success, so everything > should be OK. > > However, when I attempted a backup I got "ERR=Field 'StartTime' doesn't have > a default > value". I have been warned that such error might occur and did the following > afterwards > to try to correct the database: > > 1. Stopped bacula > 2. dropped the database > 3. created the database > 4. imported the catalogue from the last backup > 5. updated the tables > 6. started bacula > > Did again a backup but the error was still there. I think it should be > possible to add a > default value to the 'StartTime' field but since I no nothing about sql > programming I am > unable to fix it. I hope someone on the list would tell me which commands > would do the > trick.
As Josip alreadp pointed out, the issue here is not the Bacula update, it is the MariaDB update. While MariaDB is diverging from MySQL, MariaDB 10.2 does follow the stricter SQL compliance of MySQL 5.7. There's two issues here: 1. MySQL has historically allowed columns to be declared NOT NULL without a DEFAULT. This is wrong and has always been wrong (because you're telling MySQL a column may not be left empty, then not telling it what to put in it if you don't supply a value). MySQL 5.7 and MariaDB 10.2, out of the box, don't allow it any more. 2. MySQL has historically allowed zero parts in date fields, and accepted '00-00-0000' as a valid date (including as part of a DATETIME default). This is wrong and has always been wrong (because there is no year 0, month 0, or day 0). MySQL 5.7 and MariaDB 10.2, out of the box, don't allow it any more. I infer that PostgreSQL still does, since nobody has run into this problem with PostgreSQL. Unfortunately you can't actually fix both of these errors in the Bacula schema because certain pieces of the Bacula codebase depend on '00-00-0000' being a valid datetime value meaning "it's never happened". So, as Josip explained, you need to remove NO_ZERO_DATE and NO_ZERO_IN_DATE from SQL_MODE. However, you should be able to safely use the following: sql_mode = NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,STRICT_ALL_TABLES I have endeavored on my own installation (which is currently running MariaDB 1.2.13, clustered) to clean up the schemas to allow the strictest SQL compliance, but cannot because of the code dependencies on zero dates. So for now, the above is the best you can do. -- Phil Stracchino Babylon Communications ph...@caerllewys.net p...@co.ordinate.org Landline: +1.603.293.8485 Mobile: +1.603.998.6958 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users