GNOME Bugzilla – Bug 769115
db name isn't escaped well
Last modified: 2018-06-29 23:49:59 UTC
When trying to save to a sql backend using a databas like "db-1", an error is generated: The server at URL mysql://db-user-1@***/db-1 experienced an error or encountered bad or corrupt data. /tmp/gnucash.trace says: * 17:06:38 CRIT <gnc.backend.dbi> [mysql_error_fn()] 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 '-1' at line 1 * 17:06:38 CRIT <gnc.backend.dbi> conn_table_operation: assertion 'table_name_list != NULL' failed * 17:06:38 CRIT <gnc.backend.dbi> conn_table_operation: assertion 'table_name_list != NULL' failed * 17:06:47 CRIT <gnc.backend.dbi> [mysql_error_fn()] 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 '-1 LIKE 'gnclock'' at line 1 * 17:06:47 WARN <gnc.backend.dbi> [gnc_dbi_unlock()] No lock table in database, so not unlocking it. * 17:07:59 CRIT <gnc.backend.dbi> [gnc_dbi_mysql_session_begin()] Unable to connect to database '/***/db-1'
Fixed in master, for the next major release (2.8, planned for early 2018). Fixing this requires significant rearrangement of code, which we've already accomplished in master as part of the C++ rewrite but which can't be done cleanly in the release-series C implementation.
*** Bug 771254 has been marked as a duplicate of this bug. ***
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=769115. Please update any external references or bookmarks.