summaryrefslogtreecommitdiff
path: root/sql-common
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-09-09 08:33:08 +0200
committerSergei Golubchik <serg@mariadb.org>2016-09-09 08:33:08 +0200
commit06b7fce9f24116080168b924d17f71b979fc3a14 (patch)
tree5ff9f5684bb118abbee5a9fd3b838d0841661287 /sql-common
parent1f2ff25eba6c089b2698cd0dab96155ccbf2afd2 (diff)
parent8494039757a2f6353cc161e7824aab4fe2312d2a (diff)
downloadmariadb-git-06b7fce9f24116080168b924d17f71b979fc3a14.tar.gz
Merge branch '10.1' into 10.2
Diffstat (limited to 'sql-common')
-rw-r--r--sql-common/client.c5
-rw-r--r--sql-common/my_time.c4
-rw-r--r--sql-common/mysql_async.c6
3 files changed, 11 insertions, 4 deletions
diff --git a/sql-common/client.c b/sql-common/client.c
index fdb17a63ba5..e73d9bdbe0b 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -3643,6 +3643,9 @@ error:
/* Free alloced memory */
end_server(mysql);
mysql_close_free(mysql);
+ if (!(client_flag & CLIENT_REMEMBER_OPTIONS) &&
+ !mysql->options.extension->async_context)
+ mysql_close_free_options(mysql);
}
DBUG_RETURN(0);
}
@@ -3713,7 +3716,7 @@ my_bool mysql_reconnect(MYSQL *mysql)
}
if (!mysql_real_connect(&tmp_mysql,mysql->host,mysql->user,mysql->passwd,
mysql->db, mysql->port, mysql->unix_socket,
- mysql->client_flag))
+ mysql->client_flag | CLIENT_REMEMBER_OPTIONS))
{
if (ctxt)
my_context_install_suspend_resume_hook(ctxt, NULL, NULL);
diff --git a/sql-common/my_time.c b/sql-common/my_time.c
index 28757a2c96c..7cf8692a3f6 100644
--- a/sql-common/my_time.c
+++ b/sql-common/my_time.c
@@ -224,7 +224,7 @@ my_bool check_datetime_range(const MYSQL_TIME *ltime)
ltime->minute > 59 || ltime->second > 59 ||
ltime->second_part > TIME_MAX_SECOND_PART ||
(ltime->hour >
- (ltime->time_type == MYSQL_TIMESTAMP_TIME ? TIME_MAX_HOUR : 23));
+ (uint) (ltime->time_type == MYSQL_TIMESTAMP_TIME ? TIME_MAX_HOUR : 23));
}
@@ -237,7 +237,7 @@ static void get_microseconds(ulong *val, MYSQL_TIME_STATUS *status,
if (get_digits(&tmp, number_of_fields, str, end, 6))
status->warnings|= MYSQL_TIME_WARN_TRUNCATED;
if ((status->precision= (*str - start)) < 6)
- *val= tmp * log_10_int[6 - (*str - start)];
+ *val= (ulong) (tmp * log_10_int[6 - (*str - start)]);
else
*val= tmp;
if (skip_digits(str, end))
diff --git a/sql-common/mysql_async.c b/sql-common/mysql_async.c
index 80b4f390641..decf48e0e69 100644
--- a/sql-common/mysql_async.c
+++ b/sql-common/mysql_async.c
@@ -455,7 +455,11 @@ MK_ASYNC_START_BODY(
parms.db= db;
parms.port= port;
parms.unix_socket= unix_socket;
- parms.client_flags= client_flags;
+ /*
+ async wrapper enforce the CLIENT_REMEMBER_OPTIONS flag to be
+ functional (otherwise it can't operate)
+ */
+ parms.client_flags= client_flags | CLIENT_REMEMBER_OPTIONS;
},
NULL,
r_ptr,