[Dev-C++] (OT:) SQLExecDirect fails on good statements
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Ed C. <em...@to...> - 2003-10-25 21:49:13
|
Hi all, =20 This is probably going to be too abstract to get an answer, but here = goes: in an application I'm working on, lots (usually thousands) of database queries are issued of the form =20 "SELECT division_id FROM my_db.my_table WHERE division=3D'var1' and division_id =3D var2" =20 I'm building these queries using sprintf(), then running them with SQLExecDirect; about 99.98% of the time, this works perfectly. The = remaining .02% of queries will fail, randomly. For example, the query "SELECT division_id FROM my_db.my_table WHERE division=3D'FOO' and division_id = =3D 1" will work almost every time, but fail .02% of the time. =20 These queries are being created and executed by (a user-defined number = of) threads, but not asynchronously, and the database server is not having = any problems. As I've said, the failures are not on (or immediately) = following specific queries, but seem to be randomly distributed throughout the thousands of queries being executing. I put in a little error check, so = that if SQLExecDirect does not return SQL_SUCCESS, I get a display of the = failed query, and I can verify that the data is not being corrupted, I don't = have any buffer overflows, etc. The database server is MySQL-max-nt. =20 I'm sorry, but I can't post full source code, for various reasons. I'm = just wondering if anybody knows why perfectly valid SQL statements would = fail, once in every 5,000 tries, when the server itself is not being = overwhelmed. =20 -Ed |