Bug #33235 Failure of select and update query, when run within an infinite loop with sleep
Submitted: 14 Dec 2007 6:33 Modified: 14 Jan 2008 11:26
Reporter: Devesh Chandra Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: C API (client library) Severity:S1 (Critical)
Version:Server version: 5.0.37-max-log MySQL Com OS:Linux (SuSE (10.1))
Assigned to: CPU Architecture:Any

[14 Dec 2007 6:33] Devesh Chandra
Description:
We are using the C API ,where we are selecting the one element from the table.
See the table below

select * from OperationalParameters;
+-----------------+----------------+-------------------+
| ParameterName   | ParameterValue | ParameterState    |
+-----------------+----------------+-------------------+
| LASTVIOLATIONID |           2034 | NULL              |
| MOBSTATUS       |              0 | ACTIVE            |
| SENTVIOLATIONID |            116 | NULL              |
+-----------------+----------------+-------------------+

we are selecting the ParameterValue  for LASTVIOLATIONID within an threaded infinite loop with sleep. Add 1 to this value and write it back into the database.

The application is receiving the correct data, for some time but after 3-4 hour , it starts getting ACTIVE ( which I am suspecting memory corruption in the database ), which is ParameterState for MOBSTATUS. and when we convert it to ulong using strtoul(rowParameter[0], NULL, 10); we are getting 0, as it is equivalent to strtoul("ACTIVE", NULL, 10).

How to repeat:
You can repeat the same by creating the database and making an infinite loop select and update query through C APIs.

Suggested fix:
None
[14 Dec 2007 11:26] Hartmut Holzgraefe
Hi, 

could you provide source for a self contained test program showing this problem?

And could you test this against a current release? The 5.0.37 version you are using is about 9 month old by now and it might well be that whatever bug you are hitting has been fixed since then.
[15 Jan 2008 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".