Is there any method to interrupt a mysql_real_query() call?
Posted by: Alvin Chan
Date: September 01, 2005 09:12PM

Hi everyone,

I'm testing on the C API and figuring out if there's any method to interrupt a query.

To bring out the test, I write a simple program acting as a proxy between the sql client and server. After establising connections, I trigger the proxy to ignore any data sending from the client, so as to simulate the server fail to response to queries.

After doing this, I let the client send out a query using the mysql_real_query() API. What I find out is that the client is blocked by the API and hangs there forever. If I try to interrupt the call by using mysql_close() from another thread, the client even crashses immediately due to segmentation fault.

So is there any method to interrupt a mysql_real_query() call, or at least setting a timeout value so that the calling thread won't be blocked forever when the server went wrong?

Regards,
Alvin

Options: ReplyQuote


Subject
Views
Written By
Posted
Is there any method to interrupt a mysql_real_query() call?
1634
September 01, 2005 09:12PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.