Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

Commit

Permalink
Move location of debugging so it shows up earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
dbussink committed Nov 12, 2009
1 parent d41cde0 commit 1992ea9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 5 additions & 7 deletions do_mysql/ext/do_mysql_ext/do_mysql_ext.c
Expand Up @@ -448,10 +448,10 @@ static MYSQL_RES* cCommand_execute_sync(VALUE self, MYSQL* db, VALUE query) {
}
gettimeofday(&start, NULL);
retval = mysql_real_query(db, str, len);
CHECK_AND_RAISE(retval, query);

data_objects_debug(query, &start);

CHECK_AND_RAISE(retval, query);

return mysql_store_result(db);
}
#else
Expand All @@ -474,6 +474,8 @@ static MYSQL_RES* cCommand_execute_async(VALUE self, MYSQL* db, VALUE query) {

socket_fd = db->net.fd;

data_objects_debug(query, &start);

for(;;) {
FD_ZERO(&rset);
FD_SET(socket_fd, &rset);
Expand All @@ -496,8 +498,6 @@ static MYSQL_RES* cCommand_execute_async(VALUE self, MYSQL* db, VALUE query) {
retval = mysql_read_query_result(db);
CHECK_AND_RAISE(retval, query);

data_objects_debug(query, &start);

return mysql_store_result(db);
}
#endif
Expand Down Expand Up @@ -989,9 +989,7 @@ static VALUE cReader_values(VALUE self) {
if ( state == Qnil || state == Qfalse ) {
rb_raise(eDataError, "Reader is not initialized");
}
else {
return rb_iv_get(self, "@values");
}
return rb_iv_get(self, "@values");
}

static VALUE cReader_fields(VALUE self) {
Expand Down
6 changes: 4 additions & 2 deletions do_postgres/ext/do_postgres_ext/do_postgres_ext.c
Expand Up @@ -563,6 +563,8 @@ static PGresult* cCommand_execute_sync(VALUE self, PGconn *db, VALUE query) {

response = PQexec(db, str);

data_objects_debug(query, &start);

if (response == NULL) {
if(PQstatus(db) != CONNECTION_OK) {
PQreset(db);
Expand All @@ -580,7 +582,6 @@ static PGresult* cCommand_execute_sync(VALUE self, PGconn *db, VALUE query) {
}
}

data_objects_debug(query, &start);
return response;
}
#else
Expand Down Expand Up @@ -618,6 +619,8 @@ static PGresult* cCommand_execute_async(VALUE self, PGconn *db, VALUE query) {
gettimeofday(&start, NULL);
socket_fd = PQsocket(db);

data_objects_debug(query, &start);

for(;;) {
FD_ZERO(&rset);
FD_SET(socket_fd, &rset);
Expand All @@ -639,7 +642,6 @@ static PGresult* cCommand_execute_async(VALUE self, PGconn *db, VALUE query) {
}
}

data_objects_debug(query, &start);
return PQgetResult(db);
}
#endif
Expand Down

0 comments on commit 1992ea9

Please sign in to comment.