summaryrefslogtreecommitdiff
path: root/sql-common
diff options
context:
space:
mode:
authorunknown <msvensson@neptunus.(none)>2006-01-30 10:57:42 +0100
committerunknown <msvensson@neptunus.(none)>2006-01-30 10:57:42 +0100
commitbb0cdc20af00f2b89174c88384d9b675c52ebb33 (patch)
treebd46d9102045982b29645c6e7960add5040402cc /sql-common
parentded8417d58c96f05c6327ef8eceaf90482cbfd5e (diff)
parentf220f892124878c8ef202b847f292f7f05d83d2e (diff)
downloadmariadb-git-bb0cdc20af00f2b89174c88384d9b675c52ebb33.tar.gz
Merge neptunus.(none):/home/msvensson/mysql/bug15719/my50-bug15719
into neptunus.(none):/home/msvensson/mysql/bug15719/my51-bug15719 sql-common/client.c: Auto merged tests/mysql_client_test.c: Auto merged
Diffstat (limited to 'sql-common')
-rw-r--r--sql-common/client.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/sql-common/client.c b/sql-common/client.c
index 8e55cf7c2b7..5d0370d950a 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -1456,6 +1456,24 @@ mysql_init(MYSQL *mysql)
mysql->options.methods_to_use= MYSQL_OPT_GUESS_CONNECTION;
mysql->options.report_data_truncation= TRUE; /* default */
+
+ /*
+ By default we don't reconnect because it could silently corrupt data (after
+ reconnection you potentially lose table locks, user variables, session
+ variables (transactions but they are specifically dealt with in
+ mysql_reconnect()).
+ This is a change: < 5.0.3 mysql->reconnect was set to 1 by default.
+ How this change impacts existing apps:
+ - existing apps which relyed on the default will see a behaviour change;
+ they will have to set reconnect=1 after mysql_real_connect().
+ - existing apps which explicitely asked for reconnection (the only way they
+ could do it was by setting mysql.reconnect to 1 after mysql_real_connect())
+ will not see a behaviour change.
+ - existing apps which explicitely asked for no reconnection
+ (mysql.reconnect=0) will not see a behaviour change.
+ */
+ mysql->reconnect= 0;
+
return mysql;
}
@@ -1625,23 +1643,6 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
port=mysql->options.port;
if (!unix_socket)
unix_socket=mysql->options.unix_socket;
-
- /*
- By default we don't reconnect because it could silently corrupt data (after
- reconnection you potentially lose table locks, user variables, session
- variables (transactions but they are specifically dealt with in
- mysql_reconnect()).
- This is a change: < 5.0.3 mysql->reconnect was set to 1 by default.
- How this change impacts existing apps:
- - existing apps which relyed on the default will see a behaviour change;
- they will have to set reconnect=1 after mysql_real_connect().
- - existing apps which explicitely asked for reconnection (the only way they
- could do it was by setting mysql.reconnect to 1 after mysql_real_connect())
- will not see a behaviour change.
- - existing apps which explicitely asked for no reconnection
- (mysql.reconnect=0) will not see a behaviour change.
- */
- mysql->reconnect= 0;
mysql->server_status=SERVER_STATUS_AUTOCOMMIT;