summaryrefslogtreecommitdiff
path: root/sql-common
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-07-18 16:46:57 +0200
committerSergei Golubchik <sergii@pisem.net>2013-07-18 16:46:57 +0200
commit5f6380adde2dac3f32b40339b9b702c0135eb7d6 (patch)
tree31068acc0b39c208d35d524688a5985831af0447 /sql-common
parent8a23ae088dc38f591efeab9eccdef5eb9094add9 (diff)
parent97e640b9ae83e07b444fceede6b0524256c7a3cc (diff)
downloadmariadb-git-5f6380adde2dac3f32b40339b9b702c0135eb7d6.tar.gz
10.0-base merge
Diffstat (limited to 'sql-common')
-rw-r--r--sql-common/client.c22
-rw-r--r--sql-common/my_time.c13
-rw-r--r--sql-common/pack.c2
3 files changed, 19 insertions, 18 deletions
diff --git a/sql-common/client.c b/sql-common/client.c
index a3df782a937..d9d0f2fd095 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -1,6 +1,5 @@
-/*
- Copyright (c) 2003, 2012, Oracle and/or its affiliates.
- Copyright (c) 2009, 2012, Monty Program Ab.
+/* Copyright (c) 2003, 2013, Oracle and/or its affiliates.
+ Copyright (c) 2009, 2013, Monty Program Ab
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
@@ -13,7 +12,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
/*
This file is included by both libmysql.c (the MySQL client C API)
@@ -1171,6 +1170,7 @@ static const char *default_options[]=
"multi-results", "multi-statements", "multi-queries", "secure-auth",
"report-data-truncation", "plugin-dir", "default-auth",
"bind-address", "ssl-crl", "ssl-crlpath",
+ "enable-cleartext-plugin",
NullS
};
enum option_id {
@@ -1183,6 +1183,7 @@ enum option_id {
OPT_multi_results, OPT_multi_statements, OPT_multi_queries, OPT_secure_auth,
OPT_report_data_truncation, OPT_plugin_dir, OPT_default_auth,
OPT_bind_address, OPT_ssl_crl, OPT_ssl_crlpath,
+ OPT_enable_cleartext_plugin,
OPT_keep_this_one_last
};
@@ -1424,13 +1425,15 @@ void mysql_read_default_options(struct st_mysql_options *options,
opt_arg));
break;
}
- convert_dirname(buff, buff2, NULL);
+ convert_dirname(buff2, buff, NULL);
EXTENSION_SET_STRING(options, plugin_dir, buff2_ptr);
}
break;
case OPT_default_auth:
EXTENSION_SET_STRING(options, default_auth, opt_arg);
break;
+ case OPT_enable_cleartext_plugin:
+ break;
default:
DBUG_PRINT("warning",("unknown option: %s",option[0]));
}
@@ -2256,7 +2259,8 @@ mysql_autodetect_character_set(MYSQL *mysql)
}
#endif
- my_free(mysql->options.charset_name);
+ if (mysql->options.charset_name)
+ my_free(mysql->options.charset_name);
if (!(mysql->options.charset_name= my_strdup(csname, MYF(MY_WME))))
return 1;
return 0;
@@ -3469,8 +3473,8 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
mysql->port=port;
/*
- remove the rpl hack from the version string, see RPL_VERSION_HACK
- comment
+ remove the rpl hack from the version string,
+ see RPL_VERSION_HACK comment
*/
if ((mysql->server_capabilities & CLIENT_PLUGIN_AUTH) &&
strncmp(mysql->server_version, RPL_VERSION_HACK,
@@ -4276,6 +4280,8 @@ mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg)
case MYSQL_DEFAULT_AUTH:
EXTENSION_SET_STRING(&mysql->options, default_auth, arg);
break;
+ case MYSQL_ENABLE_CLEARTEXT_PLUGIN:
+ break;
case MYSQL_PROGRESS_CALLBACK:
if (!mysql->options.extension)
mysql->options.extension= (struct st_mysql_options_extention *)
diff --git a/sql-common/my_time.c b/sql-common/my_time.c
index b19f4d1d149..109bea7b4dd 100644
--- a/sql-common/my_time.c
+++ b/sql-common/my_time.c
@@ -83,7 +83,7 @@ my_bool check_date(const MYSQL_TIME *ltime, my_bool not_zero_date,
{
if (not_zero_date)
{
- if ((((flags & TIME_NO_ZERO_IN_DATE) || !(flags & TIME_FUZZY_DATE)) &&
+ if (((flags & TIME_NO_ZERO_IN_DATE) &&
(ltime->month == 0 || ltime->day == 0)) || ltime->neg ||
(!(flags & TIME_INVALID_DATES) &&
ltime->month && ltime->day > days_in_month[ltime->month-1] &&
@@ -252,7 +252,7 @@ static void get_microseconds(ulong *val, MYSQL_TIME_STATUS *status,
length Length of string
l_time Date is stored here
flags Bitmap of following items
- TIME_FUZZY_DATE Set if we should allow partial dates
+ TIME_FUZZY_DATE
TIME_DATETIME_ONLY Set if we only allow full datetimes.
TIME_NO_ZERO_IN_DATE Don't allow partial dates
TIME_NO_ZERO_DATE Don't allow 0000-00-00 date
@@ -1230,12 +1230,7 @@ longlong number_to_datetime(longlong nr, ulong sec_part, MYSQL_TIME *time_res,
nr= (nr+19000000L)*1000000L; /* YYMMDD, year: 1970-1999 */
goto ok;
}
- /*
- Though officially we support DATE values from 1000-01-01 only, one can
- easily insert a value like 1-1-1. So, for consistency reasons such dates
- are allowed when TIME_FUZZY_DATE is set.
- */
- if (nr < 10000101L && !(flags & TIME_FUZZY_DATE))
+ if (nr < 10000101L)
goto err;
if (nr <= 99991231L)
{
@@ -1314,7 +1309,7 @@ int number_to_time(my_bool neg, longlong nr, ulong sec_part,
if (nr > 9999999 && neg == 0)
{
if (number_to_datetime(nr, sec_part, ltime,
- TIME_FUZZY_DATE | TIME_INVALID_DATES, was_cut) < 0)
+ TIME_INVALID_DATES, was_cut) < 0)
return -1;
ltime->year= ltime->month= ltime->day= 0;
diff --git a/sql-common/pack.c b/sql-common/pack.c
index 69ab7ac9e17..9c920279cf8 100644
--- a/sql-common/pack.c
+++ b/sql-common/pack.c
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
#include <my_global.h>
#include <mysql_com.h>