Skip to content

Commit 119ebef

Browse files
committed
Handling of multiple results (resolves issue mariano#100)
1 parent e556506 commit 119ebef

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/result.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,15 @@ node_db_mysql::Result::Result(MYSQL* connection) throw(node_db::Exception&)
7777
nextRow(NULL) {
7878
this->result = mysql_store_result(this->connection);
7979

80+
MYSQL_RES* tmp_result;
81+
while (mysql_more_results(this->connection)) {
82+
if (mysql_next_result(this->connection)) {
83+
tmp_result = mysql_use_result(this->connection);
84+
mysql_free_result(tmp_result);
85+
}
86+
}
87+
tmp_result = NULL;
88+
8089
try {
8190
if (result == NULL && mysql_field_count(this->connection) != 0) {
8291
throw node_db::Exception(mysql_error(this->connection));

0 commit comments

Comments
 (0)