Bug #104658 CLIENT_SESSION_TRACK results in inaccurate rows affected on single row inserts
Submitted: 18 Aug 2021 20:11 Modified: 25 Aug 2021 12:21
Reporter: Peter Farr Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:8.0 OS:Any
Assigned to: CPU Architecture:Any

[18 Aug 2021 20:11] Peter Farr
Description:
When the compatibility flag `CLIENT_SESSION_TRACK` is used, it changes the rows affected coming back from single row inserts.

Multi row inserts does return the correct rows affected value with this flag, however single row inserts returns either 0 rows affected, or the rows affected by the last successful multi-row insert, depending on the situation.

How to repeat:
Use the CLIENT_SESSION_TRACK flag and write a single row insert. Try it by itself, before a multi-row insert, and after a multi-row insert.

Suggested fix:
No idea
[19 Aug 2021 11:52] MySQL Verification Team
Hi Mr. Farr,

Thank you for your bug report.

However, your report is very ascetic on what you are really trying to achieve. Please read the following chapter in our Reference Manual:

"
5.1.18 Server Tracking of Client Session State
"

and let us know which of these flags have you used and how !!!!!!
[19 Aug 2021 17:51] Peter Farr
My goal isn't to tell you what I'm trying to achieve, it's to report a bug. The flag I'm using is the CLIENT_SESSION_TRACK flag, as outlined here:

https://dev.mysql.com/doc/internals/en/capability-flags.html

From my experience this is a very easy bug to replicate. If you need help replicating the bug, I can push up a demo application to a public repo on github and share that with you if necessary.
[20 Aug 2021 11:55] MySQL Verification Team
Hi Mr. Farr,

Thank you for your reply.

What we need from you is a repeatable test case. A test case that will consists of SQL statements which will show the bug.

We will test this batch of  SQL statements on our latest 8.0 release and see if it is repeatable.

More important than this is that it seems that this option is not supported fully. But, we shall get back to you on this one.
[23 Aug 2021 12:19] MySQL Verification Team
Hi,

This variable is fully supported and its use is explained here:

https://dev.mysql.com/doc/dev/mysql-server/latest/

Hence, if you follow the rules in the documentation 100 % and you still get wrong results, then do send us a repeatable test case, as explained in our previous comment.
[25 Aug 2021 12:21] MySQL Verification Team
Hi Mr. Farr,

Test case does not have to be ONLY in the form of the SQL statements. You can add your C API example , provided you have used that flag in the manner that is described in the documentation which we have provided for you.

Nobody can verify the bug based on the vague description. Everybody needs a full test case.

Hence, as it is , we can't repeat what you are experiencing .......