Skip to content

Instantly share code, notes, and snippets.

View methodmissing's full-sized avatar

Lourens Naudé methodmissing

View GitHub Profile
diff --git a/ext/mysql.c b/ext/mysql.c
index b804723..d957978 100644
--- a/ext/mysql.c
+++ b/ext/mysql.c
@@ -798,13 +798,16 @@ static VALUE send_query(VALUE obj, VALUE sql)
{
MYSQL* m = GetHandler(obj);
+ free_old_query(m);
+
require File.dirname(__FILE__) + '/test_helper'
c = Mysql.real_connect('localhost','root')
c.send_query('select sleep(1)')
c.send_query('select sleep(1)')
diff --git a/ext/mysql.c b/ext/mysql.c
index b804723..372edf4 100644
--- a/ext/mysql.c
+++ b/ext/mysql.c
@@ -61,6 +61,7 @@ struct mysql {
char connection;
char query_with_result;
char blocking;
+ char query_sent;
};
diff --git a/ext/mysql.c b/ext/mysql.c
index b804723..472f0eb 100644
--- a/ext/mysql.c
+++ b/ext/mysql.c
@@ -61,6 +61,7 @@ struct mysql {
char connection;
char query_with_result;
char blocking;
+ char query_sent;
};
diff --git a/ext/mysql.c b/ext/mysql.c
index b804723..b6a3227 100644
--- a/ext/mysql.c
+++ b/ext/mysql.c
@@ -61,6 +61,7 @@ struct mysql {
char connection;
char query_with_result;
char blocking;
+ int async_in_progress;
};
require File.dirname(__FILE__) + '/test_helper'
m = Mysql.real_connect('localhost','root')
class << m
def safe_query( query )
begin
send_query( query )
rescue => e
diff --git a/ext/mysql.c b/ext/mysql.c
index b804723..3f1a908 100644
--- a/ext/mysql.c
+++ b/ext/mysql.c
@@ -61,6 +61,7 @@ struct mysql {
char connection;
char query_with_result;
char blocking;
+ int async_in_progress;
};
# Sequentially step through all of the available initialization routines,
# in order (view execution order in source).
def process
Rails.configuration = configuration
check_ruby_version
install_gem_spec_stubs
set_load_path
add_gem_load_paths
diff --git a/ext/mysql.c b/ext/mysql.c
index b804723..de9d435 100644
--- a/ext/mysql.c
+++ b/ext/mysql.c
@@ -61,6 +61,7 @@ struct mysql {
char connection;
char query_with_result;
char blocking;
+ int async_in_progress;
};
HoptoadNotifier::Catcher.class_eval do
alias :original_send_to_hoptoad :send_to_hoptoad
def send_to_hoptoad data
async_hoptoad_notification? ? async_send_to_hoptoad( data ) : original_send_to_hoptoad( data )
end
def async_hoptoad_notification?
if Object.const_defined?(:EventMachine)