When running single queries using drizzle_query_add and drizzle_query_run, occasionally drizzle_run_query returns DRIZZLE_RETURN_NO_ACTIVE_CONNECTIONS. The cause is that if things are timed correctly, the initial call to drizzle_query (query.c:219) returns DRIZZLE_RETURN_OK, instead of DRIZZLE_RETURN_IO_WAIT. In this case, the code needs to call drizzle_result_buffer. This gets complicated, because it duplicates the code in the switch below.

I've added a patch to my branch. It is probably incorrect in some way, but works for me. It moves the query state machine switch into its own function. The initialization and the loop then both use this state machine function.

See:

http://bazaar.launchpad.net/~evanj/libdrizzle/dev/revision/139


Evan

--
Evan Jones
http://evanjones.ca/

_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help   : https://help.launchpad.net/ListHelp

Reply via email to