From 1a70e83a746dc827c66d3cb9de649c899012ba3d Mon Sep 17 00:00:00 2001 From: Brian Lopez Date: Tue, 3 Aug 2010 20:22:44 -0700 Subject: [PATCH] Revert "libmysql only allows one query be sent at a time per connection, bail early if that's attempted" This reverts commit 3ff7baa5f827efcbfd9434e27b4251f7c759e2ac. --- ext/mysql2/client.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/ext/mysql2/client.c b/ext/mysql2/client.c index f7783cd..9573e8f 100644 --- a/ext/mysql2/client.c +++ b/ext/mysql2/client.c @@ -225,9 +225,6 @@ static VALUE rb_mysql_client_async_result(VALUE self) { return Qnil; } - // we have a result, mark this connection inactive - rb_iv_set(self, "@active", Qfalse); - VALUE resultObj = rb_mysql_result_to_obj(result); // pass-through query options for result construction later rb_iv_set(resultObj, "@query_options", rb_obj_dup(rb_iv_get(self, "@query_options"))); @@ -243,22 +240,13 @@ static VALUE rb_mysql_client_query(int argc, VALUE * argv, VALUE self) { fd_set fdset; int fd, retval; int async = 0; - VALUE opts, defaults, active; + VALUE opts, defaults; MYSQL *client; Data_Get_Struct(self, MYSQL, client); REQUIRE_OPEN_DB(client); args.mysql = client; - active = rb_iv_get(self, "@active"); - // see if this connection is still waiting on a result from a previous query - if (NIL_P(active) || active == Qfalse) { - // mark this connection active - rb_iv_set(self, "@active", Qtrue); - } else { - rb_raise(cMysql2Error, "This connection is still waiting for a result, try again once you have the result"); - } - defaults = rb_iv_get(self, "@query_options"); if (rb_scan_args(argc, argv, "11", &args.sql, &opts) == 2) { opts = rb_funcall(defaults, intern_merge, 1, opts);