Help with libdbi code

Colin Law clanlaw at
Sat May 7 06:22:05 EDT 2016

On 7 May 2016 at 10:09, Geert Janssens <geert.gnucash at> wrote:
> ...
> I'm not sure you need to do this when connecting to the mysql database (not
> table) and before creating the new database. At that point there is no data
> in the new database so there can't be any NULL in a date field either.
> On the other hand it may be that you do have to do this if MySQL already
> complains when writing the DB schema which I consider unlikely (yet not
> impossible).

I believe that it is necessary as the initial problem is encountered
when creating the database as one of the date fields has a default
value of zero.  In fact I have not found a case where the no_zero_date
option causes a problem other than when creating a new database, but I
have not tried very hard.  I had wondered whether an alternative
strategy of not providing a default value, but allowing the date to be
null in the database instead was possible, but I gather that would
involve significant work.  In addition it would cause problems when
upgrading gnucash as old databases would no longer be compatible.



More information about the gnucash-devel mailing list