mysq_error() returns 0, mysql_sqlstate(0) returns '00000'. Other similar queries return success and the offending queris return success in different sessions so it's pretty much random. There is nothing in the .err file. How do I go about this?
One other thing to note is that the offending queries reach the database allright. They also seem to all be duplicates (the sha256, sha1 and md5 rows are defined as UNIQUE). They are reported as duplicates at other times (these offending duplicates occur more than once).
Maybe it's also worth noting that my app has multiple threads inserting data simultaneously. Can this be because of queries containing duplicate keys being sent to the server simultaneously?
In my original post I wrote "the offending queries return success in different sessions". Sorry for misleading you, I meant that in other sessions mysql_errno() returns the expected value for the duplicates, MYSQL_DUPLICATE_KEY_ERROR_CODE.
And it looks like I narrowed it down. My initial supposition was right: it doesn't happen when only one thread is inserting data. Still, to me this doesn't sound like normal behavior. Or...?