Failure to save as postgresql database

Thomas Baumgart thb at net-bembel.de
Wed Jan 6 08:42:47 GMT 2021


On Mittwoch, 6. Januar 2021 01:14:32 CET Jack wrote:

> On 2021.01.05 08:22, Thomas Baumgart wrote:
> > I scanned the Qt source code and noticed, that the numerical suffix  
> > to qpsqlpstmt_ is to base 16 so hexadecimal. DE and F1 are perfect  
> > numbers then.
> 
> [snip...]
> 
> > So it seems to me, that exec is called in the wrong spot.
> But the whole thing works for sqlite and MySql/Mariadb, so I'm assuming  
> the problem is likely in postgres specifics of qsql.  

or in the way we use it. I still have the feeling that one of the calls
to prepare() fails and we don't take notice and then calling exec() 
causes the problem. Not sure though. Have not looked at our code lately
in that area.

> Also - it looks  
> like the same function (deleteKeyValuePaird) is called with identicaly  
> parameters more than once, on only one of those fails.  I'll read  
> through the debugging hints you provided before I decide how to proceed.

Again, this should not be the problem, as you mention it works for other
DB backends.

See commits

48c0b11efdcfa43217fc247443afda0d9b7a61c4
81c97785c1f985c09732923101feac64e59389c3
457e01f18d985d5e7121477df2dda2525e933d04

which I had to add to make it work with SQLite (I believe) which worked
just fine on MySQL.


> > To track this down (After all F1 identifies 241 iterations) I would  
> > derive a new result object from QPSQLResult or QSqlResult and  
> > override prepare() and exec() to keep track of the calls and their  
> > return code. Then use this object to add specific debugging  
> > code/output.
> 
> I think the only reason that number is so high is that I made a whole  
> lot of attempts within that ddd/gdb session.   I just started a new  
> session, and the first iteration I saw was _A, so I might try putting a  
> watch on that value, if it is something gdb can do.

Yes, GDB should be able to do that.

-- 

Regards

Thomas Baumgart

https://www.signal.org/       Signal, the better WhatsApp
-------------------------------------------------------------
The person who says it cannot be done
should not interrupt the person doing it!
-------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 868 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kmymoney-devel/attachments/20210106/67b19f61/attachment.sig>


More information about the KMyMoney-devel mailing list