Skip to content

Commit bb5f3aa

Browse files
committed
This completes the fix for PECL php#5827; we need to gobble up result sets in the
stmt dtor too.
1 parent 0f4137f commit bb5f3aa

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

ext/pdo_mysql/mysql_statement.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,16 @@ static int pdo_mysql_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC)
6666
efree(S->out_null);
6767
efree(S->out_length);
6868
}
69+
#endif
70+
#if HAVE_MYSQL_NEXT_RESULT
71+
while (mysql_more_results(S->H->server)) {
72+
if (mysql_next_result(S->H->server) == 0) {
73+
MYSQL_RES *res = mysql_store_result(S->H->server);
74+
if (res) {
75+
mysql_free_result(res);
76+
}
77+
}
78+
}
6979
#endif
7080
efree(S);
7181
return 1;

0 commit comments

Comments
 (0)