I can't find working libdbi version

Christoph Holtermann c.holtermann at gmx.de
Thu Jan 27 07:04:59 EST 2011


Hello !

I wonder why the trace says :

* 11:40:38  INFO <gnc.backend.dbi> [mysql_error_fn] DBI error: 1367: Illegal double '797692e+307' value found during parsing

When i try to find that in the source i get to the line

result = dbi_conn_query( conn,
                              "INSERT INTO numtest VALUES (%lld, %llu, %17e)",
                               testlonglong, testulonglong, testdouble );

in function conn_test_dbi_library in backend/dbi/gnc-backend-dbi.c.

testdouble is 1.7976921348623157E+307



When i try to insert into mysql manually
mysql> CREATE TABLE test (d double);
mysql> insert into test values(797692e+307);
ERROR 1367 (22007): Illegal double '797692e+307' value found during parsing

That's the same error message. It makes conn_test_dbi_library fail and post the message about wrong dbi version if i get it right.
mysql> insert into test values(1.7976921348623157E+307);
Query OK, 1 row affected (0.01 sec)

So somehow the "1." is lost. And 1.7976921348623157E+307 gets 797692e+307. The latter is too big. Python calls it "inf" ;-)


Why does this happen ?

I inserted a line

PINFO( "INSERT INTO numtest VALUES (%lld, %llu, %17e)",
                               testlonglong, testulonglong, testdouble );

The log file states :
* 12:59:59  INFO <gnc.backend.dbi> [conn_test_dbi_library] INSERT INTO numtest VALUES (-9223372036854775807, 9223372036854775807,     1,797692e+307)

Could it be that "INSERT INTO numtest VALUES (-9223372036854775807, 9223372036854775807,     1,797692e+307)" is also
the string that is passed to MySQL ?

This string hold four values :
-9223372036854775807,
9223372036854775807,    
1,
797692e+307

That would explain the 797692e+307.

I leave that open as a question now because I'm hungry ;-)

regards,

Christoph Holtermann







More information about the gnucash-devel mailing list