This commit is contained in:
Nisha Gopalakrishnan 2017-02-16 11:49:13 +05:30
parent 6fce90e524
commit 7ec26b03a7

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. /* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -3790,12 +3790,15 @@ static void mysql_close_free(MYSQL *mysql)
*/ */
static void mysql_prune_stmt_list(MYSQL *mysql) static void mysql_prune_stmt_list(MYSQL *mysql)
{ {
LIST *element= mysql->stmts;
LIST *pruned_list= 0; LIST *pruned_list= 0;
for (; element; element= element->next) while(mysql->stmts)
{ {
MYSQL_STMT *stmt= (MYSQL_STMT *) element->data; LIST *element= mysql->stmts;
MYSQL_STMT *stmt;
mysql->stmts= list_delete(element, element);
stmt= (MYSQL_STMT *) element->data;
if (stmt->state != MYSQL_STMT_INIT_DONE) if (stmt->state != MYSQL_STMT_INIT_DONE)
{ {
stmt->mysql= 0; stmt->mysql= 0;