Query returning wrong record
Posted: Fri Jul 27, 2007 12:27 pm
Get this..
1. record_id is a primary key..
2. The original value of field_one was foo
3. field_one has been updated to bar with a replace into query.
The following results are returned with queries ran from PHP scripts..
When ran from a terminal, all queries return bar, which is the correct result. Obviously a cache issue, but this makes for some real fun when tracking down bugs. It appears that replace into queries aren't clearing the cache.
MySQL Version 5.0.37
1. record_id is a primary key..
2. The original value of field_one was foo
3. field_one has been updated to bar with a replace into query.
The following results are returned with queries ran from PHP scripts..
Code: Select all
select field_one from table_one where record_id = 162; -- returns foo
select field_one from table_one where record_id = 162; -- returns bar
select SQL_NO_CACHE field_one from table_one where record_id = 162; -- returns bar
select field_one from table_one where record_id = '162'; -- returns bar
MySQL Version 5.0.37