summaryrefslogtreecommitdiff
path: root/sql-common
diff options
context:
space:
mode:
authorunknown <jimw@mysql.com>2005-04-04 23:03:56 -0700
committerunknown <jimw@mysql.com>2005-04-04 23:03:56 -0700
commit66e6808ed0b31f085eab4187fa835cb1168e8aa9 (patch)
tree6ad8acc6094f563caca17989c7e15c8f1d599987 /sql-common
parent2cb2374b78b8bab2655a3f45d9e4f657c2250336 (diff)
parent682baee2316f194108587ce0da4aa44ea1a481ab (diff)
downloadmariadb-git-66e6808ed0b31f085eab4187fa835cb1168e8aa9.tar.gz
Merge
mysql-test/r/join_outer.result: Auto merged mysql-test/t/join_outer.test: Auto merged sql-common/client.c: Auto merged sql/mysqld.cc: 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 f28ea65fabf..df7a3fe4974 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -2211,6 +2211,29 @@ my_bool mysql_reconnect(MYSQL *mysql)
}
tmp_mysql.reconnect= 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;
@@ -2299,6 +2322,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)))