summaryrefslogtreecommitdiff
path: root/sql-common
diff options
context:
space:
mode:
authorunknown <jimw@mysql.com>2005-04-04 18:26:39 -0700
committerunknown <jimw@mysql.com>2005-04-04 18:26:39 -0700
commitfe02ce98aff518eb31f9b69764b42c91fd79b57d (patch)
treeecbb322a2b8879e277f89812056ec140c0984690 /sql-common
parenta1112ca0563313c8274c9dc2eda6f734ea06da1a (diff)
parent92db4a838f9198ab0924b8b876b5991bfe00e8d9 (diff)
downloadmariadb-git-fe02ce98aff518eb31f9b69764b42c91fd79b57d.tar.gz
Merge mysql.com:/home/jimw/my/mysql-4.1-8866
into mysql.com:/home/jimw/my/mysql-4.1-clean client/mysqltest.c: Auto merged sql-common/client.c: Auto merged
Diffstat (limited to 'sql-common')
-rw-r--r--sql-common/client.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/sql-common/client.c b/sql-common/client.c
index 1a41ba5e5ed..c25e0e3de8f 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -2190,6 +2190,29 @@ my_bool mysql_reconnect(MYSQL *mysql)
DBUG_RETURN(1);
}
tmp_mysql.free_me= mysql->free_me;
+
+ /*
+ For each stmt in mysql->stmts, move it to tmp_mysql if it is
+ in state MYSQL_STMT_INIT_DONE, otherwise close it.
+ */
+ {
+ LIST *element= mysql->stmts;
+ for (; element; element= element->next)
+ {
+ MYSQL_STMT *stmt= (MYSQL_STMT *) element->data;
+ if (stmt->state != MYSQL_STMT_INIT_DONE)
+ {
+ stmt->mysql= 0;
+ }
+ else
+ {
+ tmp_mysql.stmts= list_add(tmp_mysql.stmts, &stmt->list);
+ }
+ /* No need to call list_delete for statement here */
+ }
+ mysql->stmts= NULL;
+ }
+
/* Don't free options as these are now used in tmp_mysql */
bzero((char*) &mysql->options,sizeof(mysql->options));
mysql->free_me=0;
@@ -2278,6 +2301,10 @@ static void mysql_close_free(MYSQL *mysql)
SYNOPSYS
mysql_detach_stmt_list()
stmt_list pointer to mysql->stmts
+
+ NOTE
+ There is similar code in mysql_reconnect(), so changes here
+ should also be reflected there.
*/
void mysql_detach_stmt_list(LIST **stmt_list __attribute__((unused)))