Help with libdbi code

Geert Janssens geert.gnucash at
Sat May 7 05:09:41 EDT 2016

On Saturday 07 May 2016 08:32:18 Colin Law wrote:
> On 6 May 2016 at 22:38, John Ralls <jralls at> wrote:
> >> On May 6, 2016, at 5:29 PM, Colin Law <clanlaw at> wrote:
> >> 
> >> I don't fully follow what you are saying
> >> about SUPER privileges, but will go away and think about it some
> >> more.> 
> > See the bit in
> >
> > ng about GLOBAL vs. SESSION mode.
> I don't need to set the global values, just the session, in fact I
> must not set the global settings as that would affect other users and
> applications.  I mis-spake when I said I needed to adjust the settings
> before connecting to the database, that assertion was made on the
> assumption that the code connected to the server and then to the
> database.  Now that I understand that is not the case I understand
> why it connects to the mysql table before creating the gnucash
> database, connecting to the mysql table is a means of getting round
> the problem that one cannot simply connect to the server and create a
> db.  In fact what I need to do is, in the case where the database
> exists, adjust the session settings after connecting to the db but
> before using it, and in the case where the db does not exist adjust
> the settings after connecting to the mysql table but before creating
> the new database.

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 guess I will then have to do it again when
> connecting to the new database as this will be a new session.
I would try with this one alone first and if it turns out not to be sufficient, you can add it during 
the initial connection to the mysql database as well.



More information about the gnucash-devel mailing list