Created
June 26, 2010 03:36
-
-
Save asm/453744 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/do_mysql/ext/do_mysql/do_mysql.c b/do_mysql/ext/do_mysql/do_mysql.c | |
index acc3f2c..926f1a6 100755 | |
--- a/do_mysql/ext/do_mysql/do_mysql.c | |
+++ b/do_mysql/ext/do_mysql/do_mysql.c | |
@@ -450,6 +450,7 @@ static MYSQL_RES* cCommand_execute_async(VALUE self, VALUE connection, MYSQL* db | |
struct timeval start; | |
const char* str = rb_str_ptr_readonly(query); | |
size_t len = rb_str_len(query); | |
+ MYSQL_RES* result; | |
if((retval = mysql_ping(db)) && mysql_errno(db) == CR_SERVER_GONE_ERROR) { | |
full_connect(connection, db); | |
@@ -485,7 +486,12 @@ static MYSQL_RES* cCommand_execute_async(VALUE self, VALUE connection, MYSQL* db | |
CHECK_AND_RAISE(retval, query); | |
data_objects_debug(connection, query, &start); | |
- return mysql_store_result(db); | |
+ result = mysql_store_result(db); | |
+ | |
+ if (!result) | |
+ CHECK_AND_RAISE(mysql_errno(db), query); | |
+ | |
+ return result; | |
} | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment