Skip to content

Commit 5c921b7

Browse files
committed
Merge branch 'master' of git://github.com/mariano/node-db-mysql
2 parents dcd3ac6 + b86bc68 commit 5c921b7

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

binding.gyp

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"targets": [
3+
{
4+
"target_name": "mysql_bindings",
5+
'include_dirs': [
6+
'lib/',
7+
'.',
8+
'<!@(mysql_config --include)'
9+
],
10+
'cflags': [
11+
'<!@(mysql_config --cflags)'
12+
],
13+
'cflags!': [
14+
'-fno-exceptions'
15+
],
16+
'cflags_cc!': [
17+
'-fno-exceptions'
18+
],
19+
"sources": [
20+
"lib/node-db/exception.cc",
21+
"lib/node-db/binding.cc",
22+
"lib/node-db/connection.cc",
23+
"lib/node-db/events.cc",
24+
"lib/node-db/query.cc",
25+
"lib/node-db/result.cc",
26+
"src/connection.cc",
27+
"src/mysql.cc",
28+
"src/query.cc",
29+
"src/result.cc",
30+
"src/mysql_bindings.cc"
31+
],
32+
'link_settings': {
33+
'libraries': [
34+
'<!@(mysql_config --libs_r)'
35+
]
36+
}
37+
}
38+
]
39+
}

src/result.cc

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

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

0 commit comments

Comments
 (0)