Good catch, Gord!

On 2021-02-01 10:36, gnu Gord wrote:
…It appears that mysql (or somewhere in the backend of gnuCash) does not
like a back slash character as the last character in a field. The data I
was trying to save had one entry with a 'notes' field that …  was
"2 books one for A one for\".…

Here are the relevant lines from the 'gnucash.trace' file:

* 09:09:43 ERROR <gnc.backend.dbi> [error_handler()] DBI error: 1064: You
have an error in your SQL syntax; check the manual that corresponds to your
MariaDB server version for the right syntax to use near '1970-01-01
00:00:00',0,1)' at line 1
* 09:09:43 ERROR <gnc.backend.dbi>
[GncDbiSqlConnection::execute_nonselect_statement()] Error executing SQL
INSERT INTO
slots(obj_guid,name,slot_type,int64_val,string_val,timespec_val,numeric_val_num,numeric_val_denom)
VALUES('c4f3c08454534822a2ff8cbb662b44cf','notes',4,0,'2 books one for A
one for\','1970-01-01 00:00:00',0,1)
* 09:09:43 ERROR <gnc.backend.sql>
[GncSqlBackend::execute_nonselect_statement()] SQL error: INSERT INTO
slots(obj_guid,name,slot_type,int64_val,string_val,timespec_val,numeric_val_num,numeric_val_denom)
VALUES('c4f3c08454534822a2ff8cbb662b44cf','notes',4,0,'2 books one for A
one for\','1970-01-01 00:00:00',0,1)
* 09:09:43 ERROR <gnc.backend.sql> [GncSqlTransBackend::commit()]
Transaction Chapters dated 2011-02-21 in account Gifts not saved due to
Slots save failed. Check trace log for SQL errors.

I encourage you to write a bug report in the GnuCash bug tracker about this problem. As a general matter, GnuCash should not let any text you type into a Notes field turn into a syntax error for the database. It should wrap the Notes text in a way that prevents the syntax error from happening. I suspect that GnuCash does this kind of wrapping the XML way if the backend is XML, but doesn't do it the SQL way if the database is SQL.

It's good to have people turn up errors with nice solid evidence like you collected. Thanks!

Best regard,
     —Jim DeLaHunt

_______________________________________________
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.

Reply via email to