Bug #89139 | mysqlclient does not return correct mysql_insert_id after ping() | ||
---|---|---|---|
Submitted: | 8 Jan 2018 20:06 | Modified: | 16 Apr 2018 11:11 |
Reporter: | Daniël van Eeden (OCA) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: C API (client library) | Severity: | S3 (Non-critical) |
Version: | 5.7.20, 8.0.3 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | regression |
[8 Jan 2018 20:06]
Daniël van Eeden
[8 Jan 2018 20:25]
Daniël van Eeden
$ ./mysql_bug_insertid_80 Client compile version: 80003 Client runtime version: 8.0.3-rc Server version: 50718 Round 1 mysql->insert_id: 49 mysql->insert_id: 49 Got back insert id: 49 Round 2 mysql->insert_id: 50 ping mysql->insert_id: 0 Got back insert id: 0 mysql_bug_insertid_80: mysql_bug_insertid.c:41: main: Assertion `insertid > 0' failed. Aborted (core dumped)
[8 Jan 2018 20:53]
Daniël van Eeden
On 5.6.38: sql-common/client.c:4199 (in cli_read_query_result) is where mysql->insert_id is set. On 5.7.20: sql-common/client.c:751 (in read_ok_ex) is where mysql->insert_id is set. If I set a breakpoint on these then the breakpoint is hit twice for 5.6 and three times for 5.7. So after sending ping it sets mysql->insert_id while handling the response.
[9 Jan 2018 5:39]
MySQL Verification Team
Hello Daniël, Thank you for the report and test case. Thanks, Umesh
[12 Jan 2018 7:46]
Daniël van Eeden
https://github.com/mysql/mysql-server/pull/191
[12 Jan 2018 15:51]
OCA Admin
Contribution submitted via Github - Fix for Bug #89139 (*) Contribution by Daniël van Eeden (Github dveeden, mysql-server/pull/191#issuecomment-357236947): I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.
Contribution: git_patch_162563388.txt (text/plain), 821 bytes.
[16 Apr 2018 11:11]
Paul DuBois
Posted by developer: Updated: https://dev.mysql.com/doc/refman/5.7/en/mysql-insert-id.html https://dev.mysql.com/doc/refman/8.0/en/mysql-insert-id.html