diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-07-17 21:24:29 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-07-17 21:24:29 +0200 |
commit | 97e640b9ae83e07b444fceede6b0524256c7a3cc (patch) | |
tree | 8f48fbfaf88ea7895ce59fd3ac2fbe6184334387 /sql-common | |
parent | 2f6a2494a5eb2cf3ab06fbedd2584eca85d90230 (diff) | |
parent | c7973615e723b13c6457b494b72be2fac35bfd18 (diff) | |
download | mariadb-git-97e640b9ae83e07b444fceede6b0524256c7a3cc.tar.gz |
5.5 merge
Diffstat (limited to 'sql-common')
-rw-r--r-- | sql-common/client.c | 21 | ||||
-rw-r--r-- | sql-common/my_time.c | 13 | ||||
-rw-r--r-- | sql-common/pack.c | 2 |
3 files changed, 19 insertions, 17 deletions
diff --git a/sql-common/client.c b/sql-common/client.c index 956d735368c..b965c369a4c 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -1,5 +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 @@ -12,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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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) @@ -1142,6 +1142,7 @@ static const char *default_options[]= "ssl-cipher", "max-allowed-packet", "protocol", "shared-memory-base-name", "multi-results", "multi-statements", "multi-queries", "secure-auth", "report-data-truncation", "plugin-dir", "default-auth", + "enable-cleartext-plugin", NullS }; enum option_id { @@ -1153,6 +1154,7 @@ enum option_id { OPT_ssl_cipher, OPT_max_allowed_packet, OPT_protocol, OPT_shared_memory_base_name, OPT_multi_results, OPT_multi_statements, OPT_multi_queries, OPT_secure_auth, OPT_report_data_truncation, OPT_plugin_dir, OPT_default_auth, + OPT_enable_cleartext_plugin, OPT_keep_this_one_last }; @@ -1391,13 +1393,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); } 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])); } @@ -2217,7 +2221,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; @@ -3421,8 +3426,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, @@ -4228,6 +4233,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 d4093bb4df9..05dcd773321 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] && @@ -212,7 +212,7 @@ static uint skip_digits(const char **str, const char *end) 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 @@ -1154,12 +1154,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) { @@ -1238,7 +1233,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> |