diff options
Diffstat (limited to 'sql/mysqld.cc')
-rw-r--r-- | sql/mysqld.cc | 57 |
1 files changed, 42 insertions, 15 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc index cb98af04af1..c43b384f169 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1,6 +1,5 @@ -/* Copyright (C) 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc. - 2010 Oracle and/or its affiliates - 2009-2011 Monty Program Ab +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. + Copyright (c) 2008-2011 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,8 @@ 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 St, Fifth Floor, Boston, MA 02110-1301 USA +*/ #define DEFINE_VARIABLES_LOG_SLOW // Declare variables in log_slow.h #include "mysql_priv.h" @@ -166,12 +166,12 @@ static void getvolumeID(BYTE *volumeName); int initgroups(const char *,unsigned int); #endif -#if defined(__FreeBSD__) && defined(HAVE_IEEEFP_H) +#if defined(__FreeBSD__) && defined(HAVE_IEEEFP_H) && !defined(HAVE_FEDISABLEEXCEPT) #include <ieeefp.h> #ifdef HAVE_FP_EXCEPT // Fix type conflict typedef fp_except fp_except_t; #endif -#endif /* __FreeBSD__ && HAVE_IEEEFP_H */ +#endif /* __FreeBSD__ && HAVE_IEEEFP_H && !HAVE_FEDISABLEEXCEPT */ #ifdef HAVE_SYS_FPU_H /* for IRIX to use set_fpc_csr() */ #include <sys/fpu.h> @@ -197,19 +197,24 @@ extern "C" my_bool reopen_fstreams(const char *filename, inline void setup_fpu() { -#if defined(__FreeBSD__) && defined(HAVE_IEEEFP_H) +#if defined(__FreeBSD__) && defined(HAVE_IEEEFP_H) && !defined(HAVE_FEDISABLEEXCEPT) /* We can't handle floating point exceptions with threads, so disable this on freebsd - Don't fall for overflow, underflow,divide-by-zero or loss of precision + Don't fall for overflow, underflow,divide-by-zero or loss of precision. + fpsetmask() is deprecated in favor of fedisableexcept() in C99. */ -#if defined(__i386__) +#if defined(FP_X_DNML) fpsetmask(~(FP_X_INV | FP_X_DNML | FP_X_OFL | FP_X_UFL | FP_X_DZ | FP_X_IMP)); #else fpsetmask(~(FP_X_INV | FP_X_OFL | FP_X_UFL | FP_X_DZ | FP_X_IMP)); -#endif /* __i386__ */ -#endif /* __FreeBSD__ && HAVE_IEEEFP_H */ +#endif /* FP_X_DNML */ +#endif /* __FreeBSD__ && HAVE_IEEEFP_H && !HAVE_FEDISABLEEXCEPT */ + +#ifdef HAVE_FEDISABLEEXCEPT + fedisableexcept(FE_ALL_EXCEPT); +#endif #ifdef HAVE_FESETROUND /* Set FPU rounding mode to "round-to-nearest" */ @@ -2100,6 +2105,12 @@ void unlink_thd(THD *thd) pthread_mutex_unlock(&LOCK_connection_count); (void) pthread_mutex_lock(&LOCK_thread_count); + /* + Used by binlog_reset_master. It would be cleaner to use + DEBUG_SYNC here, but that's not possible because the THD's debug + sync feature has been shut down at this point. + */ + DBUG_EXECUTE_IF("sleep_after_lock_thread_count_before_delete_thd", sleep(5);); thread_count--; delete thd; DBUG_VOID_RETURN; @@ -8426,11 +8437,11 @@ static void usage(void) print_version(); puts("\ Copyright (C) 2000-2008 MySQL AB, by Monty and others.\n\ -Copyright (C) 2008 Sun Microsystems, Inc.\n\ +Copyright (C) 2000, 2011 Oracle.\n\ Copyright (C) 2009-2011 Monty Program Ab.\n\ This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n\ and you are welcome to modify and redistribute it under the GPL license\n\n\ -Starts the MySQL database server.\n"); +Starts the MariaDB database server.\n"); printf("Usage: %s [OPTIONS]\n", my_progname); if (!opt_verbose) @@ -9753,12 +9764,15 @@ fn_format_relative_to_data_home(char * to, const char *name, bool is_secure_file_path(char *path) { char buff1[FN_REFLEN], buff2[FN_REFLEN]; + size_t opt_secure_file_priv_len; /* All paths are secure if opt_secure_file_path is 0 */ if (!opt_secure_file_priv) return TRUE; + opt_secure_file_priv_len= strlen(opt_secure_file_priv); + if (strlen(path) >= FN_REFLEN) return FALSE; @@ -9774,7 +9788,21 @@ bool is_secure_file_path(char *path) return FALSE; } convert_dirname(buff2, buff1, NullS); - return is_prefix(buff2, opt_secure_file_priv) ? TRUE : FALSE; + if (!lower_case_file_system) + { + if (strncmp(opt_secure_file_priv, buff2, opt_secure_file_priv_len)) + return FALSE; + } + else + { + if (files_charset_info->coll->strnncoll(files_charset_info, + (uchar *) buff2, strlen(buff2), + (uchar *) opt_secure_file_priv, + opt_secure_file_priv_len, + TRUE)) + return FALSE; + } + return TRUE; } @@ -9843,7 +9871,6 @@ static int fix_paths(void) { if (*opt_secure_file_priv == 0) { - /* For easy check later */ my_free(opt_secure_file_priv, MYF(0)); opt_secure_file_priv= 0; } |