After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 769115 - db name isn't escaped well
db name isn't escaped well
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Backend - SQL
2.6.13
Other Linux
: Normal normal
: ---
Assigned To: gnucash-core-maint
gnucash-core-maint
: 771254 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2016-07-23 16:47 UTC by johann.fot
Modified: 2018-06-29 23:49 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description johann.fot 2016-07-23 16:47:29 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'
Comment 1 John Ralls 2016-08-09 19:06:46 UTC
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.
Comment 2 John Ralls 2016-09-11 18:45:23 UTC
*** Bug 771254 has been marked as a duplicate of this bug. ***
Comment 3 John Ralls 2018-06-29 23:49:59 UTC
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.