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 634392 - File->SaveAs sqlite3 brings up "already exists" box in error
File->SaveAs sqlite3 brings up "already exists" box in error
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Backend - SQL
2.3.x
Other Linux
: Normal normal
: ---
Assigned To: John Ralls
Chris Shoemaker
Depends on:
Blocks:
 
 
Reported: 2010-11-09 08:56 UTC by rbh00
Modified: 2018-06-29 22:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description rbh00 2010-11-09 08:56:51 UTC
My large register file named 'current' is gzipped XML.  When I follow these steps to convert it to a sqlite3 file named 'kurrent' I get in error a box saying 'kurrent' already exists.

To reproduce:
1. Bring up the check register file "current"
2. Click File -> Save As
3. Select type of sqlite
4. Type filename of 'kurrent'
5. Hit "Save"
6. Observe the file is *not yet* created.  (Why not?? it should be!  Perhaps this is the bug?)  Make this observation by using the Linux ls(1) command which shows the 'current' file exists but the 'kurrent' file does not exist.
7. Hit "Save" again.
8. Observe the appearance of an error box which says "The file sqlite3:///home/blah/blah/kurrent.gnucash already exists.  Are you sure you want to overwrite it?"

With correct operation, step 6 will show that the file is created and step 7 will be unnecessary.

Operating System is Fedora 13.
Comment 1 Mike Evans 2010-11-09 09:35:06 UTC
I can confirm this behavior in Fedora12.  Except...
Hitting "Save As" (in the dialog) the first time creates the file. 
If I select 'NO' to overwrite, the file only contains the GNCLOCK table.
Comment 2 Mike Evans 2010-11-09 09:52:36 UTC
Similar behavior with MySql.  Again the only table is GNCLOCK.  Additionally the error dialog shows the password in clear text.
Comment 3 John Ralls 2010-11-09 18:45:16 UTC
Rich, what distro are you using? 

Can each of you go through the exercise again and attach the relevant bits of the gnucash.trace?
Comment 4 John Ralls 2010-11-09 19:06:25 UTC
Never mind. I just replicated it in Debian, and I know what's happening: The lock routine is happening before the existence check.
Comment 5 John Ralls 2010-11-11 06:13:43 UTC
This fix is a threefer: Not only is this bug fixed, but so are the ones mentioned in IRC about the password showing up in the "already open" dialog and the new file/database not being in history.

Fixed in r19798, tested with Sqlite3 and MySql.
Comment 6 Mike Evans 2010-11-11 12:23:29 UTC
This breaks the python bindings with:

gnucash_core.c: In function '_wrap_qof_session_begin':
gnucash_core.c:14238: error: too few arguments to function 'qof_session_begin'
make[5]: *** [_gnucash_core_c_la-gnucash_core.lo] Error 1

I've also made a note in Bug 634165 regarding this.
Comment 7 Mike Evans 2010-11-11 12:56:09 UTC
Apologies to John, it seems that make and make clean doesn't rebuild src/optional/python-bindings/gnucash_core.c
Comment 8 John Ralls 2018-06-29 22:47:00 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=634392. Please update any external references or bookmarks.