Bug #101407 | cant get a exist data. even no error throw by api(php) | ||
---|---|---|---|
Submitted: | 31 Oct 2020 12:44 | Modified: | 4 Nov 2020 4:15 |
Reporter: | BB DD | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: C API (client library) | Severity: | S3 (Non-critical) |
Version: | 5.7 | OS: | Linux |
Assigned to: | CPU Architecture: | Any |
[31 Oct 2020 12:44]
BB DD
[31 Oct 2020 16:57]
MySQL Verification Team
Thank you for the bug report. Please try and provide a test case with C, PHP isn't supported here. Thanks.
[1 Nov 2020 8:09]
BB DD
thanks for you can paste "How to repeat:" to show this error, please. because PHP uses C API to call MySQL. I have not a C test case. I still a new C language developer
[1 Nov 2020 8:16]
BB DD
use Mysql can show this error(how to repeat): then will give a deadlock even though I do not think it should happen but use errorCode by C API can't found this deadlock happened and the Mysql Error log has nothing. that's why I mention PHP here sorry
[2 Nov 2020 12:50]
MySQL Verification Team
HI Mr. DD, Thank you for your bug report. However, this is not a bug. What you have provided us with is a typical scenario for the deadlock. The fact that InnoDB Storage Engine is detecting a deadlock is a proof that it works correctly. Not a bug.
[4 Nov 2020 4:09]
BB DD
but not give any error when can't get a existing data in API. how do I know the deadlock happened? and i want insert a absolute new data. my idea is get a X lock first . then insert a new. select .. order by id desc for update. insert .... now you tell me that's a typical scenario for the deadlock. i just want to insert absolute new data. so how should i do?
[4 Nov 2020 4:15]
BB DD
select .. order by id desc limit 1 for update or select max(id) .. for update. in fact, if I not use "max(id) or order by id desc" that's correct. but how do I get absolute new data?
[4 Nov 2020 12:49]
MySQL Verification Team
Hi, For your information, deadlock returns the error, which you should check on each DML statement. You should also read our Reference Manual on which locks need to be taken by INSERT command. Since this is not a bug, but a request for the explanation of how InnoDB SE functions, please read carefully the next comment.
[4 Nov 2020 12:49]
MySQL Verification Team
We're sorry, but the bug system is not the appropriate forum for asking help on using MySQL products. Your problem is not the result of a bug. For details on getting support for MySQL products see http://www.mysql.com/support/ You can also check our forums (free) at http://forums.mysql.com/ Thank you for your interest in MySQL.