Hi, developers.

db.query for insert query should return the success insert count as string,
but sometimes it returns unprintable string.

For trunk, the implementation is connQuery().
At line 2339, PQcmdTuples() will get the count string as "ret".
But this string is internal buffer of "result". After PQclear() memory of
"result" is freed and "ret" should be unavailable.
Usually the memory is still accessible and remains untouched. This is why
most time we get a correct answer. If memory manager decide to modify
content for booking purpose we will get unprintable string. We have to make
a copy of the string before it's cleared.

I've attached a fix for trunk, this problem also exist in 4.x and 5.0.x.

Best regards,
Peifeng Qiu

Attachment: patch
Description: Binary data

_______________________________________________
PyGreSQL mailing list
[email protected]
https://mail.vex.net/mailman/listinfo.cgi/pygresql

Reply via email to