From 53455866809feadc88b81f547b96376d15f7a038 Mon Sep 17 00:00:00 2001 From: Thayumanavar Date: Fri, 9 Nov 2012 14:54:35 +0530 Subject: BUG#14458232 - CRASH IN THD_IS_TRANSACTION_ACTIVE DURING THREAD POOLING STRESS TEST PROBLEM: Connection stress tests which consists of concurrent kill connections interleaved with mysql ping queries cause the mysqld server which uses thread pool scheduler to crash. FIX: Killing a connection involves shutdown and close of client socket and this can cause EPOLLHUP(or EPOLLERR) events to be to be queued and handled after disarming and cleanup of of the connection object (THD) is being done.We disarm the the connection by modifying the epoll mask to zero which ensure no events come and release the ownership of waiting thread that collect events and then do the cleanup of THD. object.As per the linux kernel epoll source code ( http://lxr.linux.no/linux+*/fs/eventpoll.c#L1771), EPOLLHUP (or EPOLLERR) can't be masked even if we set EPOLL mask to zero. So we disarm the connection and thus prevent execution of any query processing handler/queueing to client ctx. queue by removing the client fd from the epoll set via EPOLL_CTL_DEL. Also there is a race condition which involve the following threads: 1) Thread X executing KILL CONNECTION Y and is in THD::awake and using mysys_var (holding LOCK_thd_data). 2) Thread Y in tp_process_event executing and is being killed. 3) Thread Z receives KILL flag internally and possible call the tp_thd_cleanup function which set thread session variable and changing mysys_var. The fix for the above race is to set thread session variable under LOCK_thd_data. We also do not call THD::awake if we found the thread in the thread list that is to be killed but it's KILL_CONNECTION flag set thus avoiding any possible concurrent cleanup. This patch is approved by Mikael Ronstrom via email review. --- include/mysql/thread_pool_priv.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/mysql/thread_pool_priv.h b/include/mysql/thread_pool_priv.h index babe0ab6c08..1368c8c52be 100644 --- a/include/mysql/thread_pool_priv.h +++ b/include/mysql/thread_pool_priv.h @@ -61,6 +61,7 @@ uint thd_get_net_read_write(THD *thd); void thd_set_mysys_var(THD *thd, st_my_thread_var *mysys_var); ulong thd_get_net_wait_timeout(THD *thd); my_socket thd_get_fd(THD *thd); +int thd_store_globals(THD* thd); THD *first_global_thread(); THD *next_global_thread(THD *thd); -- cgit v1.2.1 From 8cd60993716707a6c9af4fcc9d6d6d26b9b155e3 Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Mon, 10 Dec 2012 09:55:08 +0100 Subject: Bug#15960005 VALGRIND WARNINGS IN PROCESS_ARGS Both and can be specified as numbers or '*'. If an asterisk is used, an argument of type int is consumed. --- include/mysql/service_my_snprintf.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/mysql/service_my_snprintf.h b/include/mysql/service_my_snprintf.h index fd55944ed67..c7a03893d2e 100644 --- a/include/mysql/service_my_snprintf.h +++ b/include/mysql/service_my_snprintf.h @@ -49,6 +49,7 @@ string will be quoted according to MySQL identifier quoting rules. Both and can be specified as numbers or '*'. + If an asterisk is used, an argument of type int is consumed. can be 'l', 'll', or 'z'. -- cgit v1.2.1 From 2d16c5bd4b6a0fb9f3cd325d0ae8c3805c1ac62c Mon Sep 17 00:00:00 2001 From: Ravinder Thakur Date: Thu, 13 Dec 2012 20:33:44 +0530 Subject: bug#11761752: DO NOT ALLOW USE OF ALTERNATE DATA STREAMS ON NTFS FILESYSTEM. File names with colon are being disallowed because of the Alternate Data Stream (ADS) feature of NTFS that could be misused. ADS allows data to be written to alternate streams of a normal file. The data in alternate streams cannot be seen by normal tools on Windows (explorer, cmd.exe). As a result someone can use this feature to hide large amount of data in alternate streams and admins will have no easy way of figuring out the files that are using that disk space. The fix also disallows ADS in the scenarios where file name is passed as some dynamic variable. An important thing about the fix is that it DOES NOT disallow ADS file names if they are not dynamic (i.e. if the file is created by using some option that needs local access to the MySQL server, for example error log file). The reasoning is that if some MySQL option related to files requires access to the local machine (it is not dynamic), then user can very well create data in ADS by some other means. This fixes only those scenarios which can allow users to create data in ADS over the wire. File names with colon are being disallowed only on Windows. UNIX (Linux in particular) supports NTFS, but it will not be a common scenario for someone to configure a NTFS file system to store MySQL data on Linux. Changes in file bug11761752-master.opt are needed due to bug number 15937938. --- include/my_sys.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/my_sys.h b/include/my_sys.h index f6cd9dada99..6bdb95e9707 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -649,6 +649,7 @@ extern File my_sopen(const char *path, int oflag, int shflag, int pmode); #endif extern int check_if_legal_filename(const char *path); extern int check_if_legal_tablename(const char *path); +extern my_bool is_filename_allowed(const char *name, size_t length); #if defined(__WIN__) && defined(__NT__) extern int nt_share_delete(const char *name,myf MyFlags); -- cgit v1.2.1 From 10f8266d50ec134e72d9562e29d676c00249d9bb Mon Sep 17 00:00:00 2001 From: Kent Boortz Date: Tue, 1 Jan 2013 03:33:40 +0100 Subject: Updated README and client executables copyright year to 2013 --- include/welcome_copyright_notice.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/welcome_copyright_notice.h b/include/welcome_copyright_notice.h index ef4b08d4c0d..15d11bf3664 100644 --- a/include/welcome_copyright_notice.h +++ b/include/welcome_copyright_notice.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. 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 @@ -16,7 +16,7 @@ #ifndef _welcome_copyright_notice_h_ #define _welcome_copyright_notice_h_ -#define COPYRIGHT_NOTICE_CURRENT_YEAR "2012" +#define COPYRIGHT_NOTICE_CURRENT_YEAR "2013" /* This define specifies copyright notice which is displayed by every MySQL -- cgit v1.2.1 From 39323920302a039ac7e3a80052fbd68d31e5e75d Mon Sep 17 00:00:00 2001 From: Venkatesh Duggirala Date: Wed, 2 Jan 2013 16:31:58 +0530 Subject: BUG#11753923-SQL THREAD CRASHES ON DISK FULL Problem:If Disk becomes full while writing into the binlog, then the server instance hangs till someone frees the space. After user frees up the disk space, mysql server crashes with an assert (m_status != DA_EMPTY) Analysis: wait_for_free_space is being called in an infinite loop i.e., server instance will hang until someone frees up the space. So there is no need to set status bit in diagnostic area. Fix: Replace my_error/my_printf_error with sql_print_warning() which prints the warning in error log. include/my_sys.h: Provision to call sql_print_warning from mysys files mysys/errors.c: Replace my_error/my_printf_error with sql_print_warning() which prints the warning in error log. mysys/my_error.c: implementation of my_printf_warning mysys/my_write.c: Adding logic to break infinite loop in the simulation sql/mysqld.cc: Provision to call sql_print_warning from mysys files --- include/my_sys.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/my_sys.h b/include/my_sys.h index 6bdb95e9707..1973f07ac13 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -234,6 +234,7 @@ extern char *home_dir; /* Home directory for user */ extern const char *my_progname; /* program-name (printed in errors) */ extern char NEAR curr_dir[]; /* Current directory for user */ extern int (*error_handler_hook)(uint my_err, const char *str,myf MyFlags); +extern void(*sql_print_warning_hook)(const char *format,...); extern int (*fatal_error_handler_hook)(uint my_err, const char *str, myf MyFlags); extern uint my_file_limit; @@ -675,6 +676,7 @@ extern int my_error _VARARGS((int nr,myf MyFlags, ...)); extern int my_printf_error _VARARGS((uint my_err, const char *format, myf MyFlags, ...)) ATTRIBUTE_FORMAT(printf, 2, 4); +extern void my_printf_warning _VARARGS((const char * format, ...)); extern int my_error_register(const char **errmsgs, int first, int last); extern const char **my_error_unregister(int first, int last); extern int my_message(uint my_err, const char *str,myf MyFlags); -- cgit v1.2.1 From 3bfd88d1d65d4f2fa13f84260fba22347538cdc0 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 6 Mar 2013 09:32:13 +0100 Subject: MDEV-4068 rpm scriptlet chown command dangerous add --mysqld option to my_print_defaults change server-postin script to use that --- include/mysqld_default_groups.h | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 include/mysqld_default_groups.h (limited to 'include') diff --git a/include/mysqld_default_groups.h b/include/mysqld_default_groups.h new file mode 100644 index 00000000000..a2e94ddd854 --- /dev/null +++ b/include/mysqld_default_groups.h @@ -0,0 +1,8 @@ +const char *load_default_groups[]= { +#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE +"mysql_cluster", +#endif +"mysqld", "server", MYSQL_BASE_VERSION, +"mariadb", MARIADB_BASE_VERSION, +"client-server", +0, 0}; -- cgit v1.2.1 From 9d8ee74b38c5db13dc4466e76b7ad2eb8ce36a5a Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 8 Mar 2013 19:09:45 +0100 Subject: MDEV-4186 Test case main.myisampack fails on ppc32 (only) fix the declaration to use the correct type for st_handler_check_param::sort_buffer_length. remove redundant casts. --- include/myisamchk.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/myisamchk.h b/include/myisamchk.h index 9478936c748..0ee03c03c49 100644 --- a/include/myisamchk.h +++ b/include/myisamchk.h @@ -138,9 +138,9 @@ typedef struct st_handler_check_param /* Following is used to check if rows are visible */ ulonglong max_trid, max_found_trid; ulonglong not_visible_rows_found; + ulonglong sort_buffer_length; ulonglong use_buffers; /* Used as param to getopt() */ - size_t read_buffer_length, write_buffer_length; - size_t sort_buffer_length, sort_key_blocks; + size_t read_buffer_length, write_buffer_length, sort_key_blocks; time_t backup_time; /* To sign backup files */ ulong rec_per_key_part[HA_MAX_KEY_SEG * HA_MAX_POSSIBLE_KEY]; double new_rec_per_key_part[HA_MAX_KEY_SEG * HA_MAX_POSSIBLE_KEY]; -- cgit v1.2.1