summaryrefslogtreecommitdiff
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* remove unneded #include's that had a dubious explanationSergei Golubchik2015-10-241-0/+8
|
* MDEV-8379 - SUSE mariadb patchesSergey Vojtovich2015-10-014-13/+13
| | | | | | | | | | | | | | | | | | | | | | Fixed unclean prototype declaration. According to ISO/IEC 9899:TC2: ... 10. The special case of an unnamed parameter of type void as the only item in the list specifies that the function has no parameters. ... 14. An identifier list declares only the identifiers of the parameters of the function. An empty list in a function declarator that is part of a definition of that function specifies that the function has no parameters. The empty list in a function declarator that is not part of a definition of that function specifies that no information about the number or types of the parameters is supplied. 124) ... 6.11.6 Function declarators The use of function declarators with empty parentheses (not prototype-format parameter type declarators) is an obsolescent feature. ... Patch contributed by Michal Hrusecky.
* MDEV-8450: PATCH] Wrong macro expansion in Query_cache::send_result_to_client()Oleksandr Byelkin2015-09-064-8/+8
| | | | Expression in macro protected by ()
* Fixed overrun in key cache if one tried to allocate a key cacheMonty2015-08-131-0/+1
| | | | | | | | | | | | | | of more than 45G with a key_cache_block_size of 1024 or less. The problem was that some of the arguments to my_multi_malloc() got to be more than 4G. Fix: - Inntroduced my_multi_malloc_large() that can handle big regions. - Changed MyISAM and Aria key caches to use my_multi_malloc_large(). I didn't change the default my_multi_malloc() as this would be a too big patch and we don't allocate 4G blocks anywhere else.
* MDEV-7398 mysqld segfaults on FreeBSD 10.1 i386 when built with clang 3.4Sergei Golubchik2015-06-162-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | in cmake tests let's treat clang like gcc (same options, same builtins) in many cases. * don't check the compiler when * testing for -fvisibility=hidden support * testing for HAVE_ABI_CXA_DEMANGLE * testing for HAVE_GCC_ATOMIC_BUILTINS * when removing options with string(replace) * when running ${CC} --version (ignore the error instead) * run ABI checks for clang * use "canonical" gcc flags for clang * fix groonga too Also: * add cmake detection for gcc __atomic_* builtins. they might be supported (__ATOMIC_SEQ_CST is defined), but not for all operand sizes. In particular, 64-bit atomic load is problematic on i386 * cache check results for Windows * remove the test for HAVE_CXXABI_H (HAVE_ABI_CXA_DEMANGLE is suffifient)
* Merge branch '5.5' into 10.0Sergei Golubchik2015-06-117-59/+0
|\
| * MDEV-8052 abi detection incorrect with clangSergei Golubchik2015-06-037-47/+0
| | | | | | | | don't include #include directives into .pp files
* | perfschema 5.6.24Sergei Golubchik2015-05-055-79/+32
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | including the big commit commit 305130361bf72726de220f3d2b2787395e10be61 Author: Marc Alff <marc.alff@oracle.com> Date: Tue Feb 10 11:31:32 2015 +0100 WL#8354 BACKPORT DIGEST IMPROVEMENTS TO MYSQL 5.6 (with the following commits) and related changes in sql/
| * | 5.6.24Sergei Golubchik2015-05-045-79/+32
| | |
* | | Merge branch '5.5' into 10.0Sergei Golubchik2015-05-041-0/+1
|\ \ \ | | |/ | |/|
| * | MDEV-6916 REPAIR VIEW / mysql migrationOleksandr Byelkin2015-04-121-0/+1
| | | | | | | | | | | | from: r4407
* | | SSL: Verbosely report SSL initialization errorsSergei Golubchik2015-05-031-1/+1
| | | | | | | | | | | | And don't ignore SSL_CTX_set_tmp_dh() failures
* | | Merge remote-tracking branch 'origin/10.0' into 10.0Sergei Golubchik2015-02-221-1/+4
|\ \ \
| * | | fix a case where automatic procedure grant was changing user's passwordSergei Golubchik2015-02-171-1/+4
| | | | | | | | | | | | | | | | phase out make_password_from_salt() to be removed in 10.1
* | | | Merge branch '5.5' into 10.0Sergei Golubchik2015-02-183-3/+11
|\ \ \ \ | |/ / / |/| / / | |/ /
| * | MDEV-7419 Function cli_safe_read not exportedmariadb-5.5.42Sergei Golubchik2015-02-132-0/+8
| | | | | | | | | | | | | | | | | | Start the client API for low-level protocol access: * unsigned long mysql_net_read_packet(MYSQL *mysql); * unsigned long mysql_net_field_length(unsigned char **packet);
| * | Merge remote-tracking branch 'mysql/5.5' into bb-5.5-merge @ mysql-5.5.42Sergei Golubchik2015-02-111-3/+3
| |\ \
| | * | Updated the copyright year in the welcome message for MySQLmysql-5.5.42Bala2015-01-061-2/+2
| | | |
| | * | Bug #18808072 MYSQLBINLOG USES LOCALTIME() TO PRINT EVENTS, CAUSES KERNEL ↵Venkatesh Duggirala2014-10-081-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MUTEX CONTENTION Problem: For every event read, mysqlbinlog calls localtime() which in turn calls stat(/etc/localtime) which is causing kernel mutex contention. Analysis and Fix: localtime() calls stat(/etc/localtime) for every instance of the call where as localtime_r() the reentrant version was optimized to store the read only tz internal structure. Hence it will not call stat(/etc/localtime). It will call only once at the beginning. The mysql server is calling localtime_r() and mysqlbinlog tool is one place where we are still using localtime(). Once the process (mysqlbinlog) is started if timezone is changed it will be not picked up the the process and it will continue with the same values as the beginning of the process. This behavior is in-lined with mysql server. Also adding localtime_r() and gmtime_r() support for windows.
| | * | Bug#17283409 4-WAY DEADLOCK: ZOMBIES, PURGING BINLOGS,Venkatesh Duggirala2014-05-081-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SHOW PROCESSLIST, SHOW BINLOGS Problem: A deadlock was occurring when 4 threads were involved in acquiring locks in the following way Thread 1: Dump thread ( Slave is reconnecting, so on Master, a new dump thread is trying kill zombie dump threads. It acquired thread's LOCK_thd_data and it is about to acquire mysys_var->current_mutex ( which LOCK_log) Thread 2: Application thread is executing show binlogs and acquired LOCK_log and it is about to acquire LOCK_index. Thread 3: Application thread is executing Purge binary logs and acquired LOCK_index and it is about to acquire LOCK_thread_count. Thread 4: Application thread is executing show processlist and acquired LOCK_thread_count and it is about to acquire zombie dump thread's LOCK_thd_data. Deadlock Cycle: Thread 1 -> Thread 2 -> Thread 3-> Thread 4 ->Thread 1 The same above deadlock was observed even when thread 4 is executing 'SELECT * FROM information_schema.processlist' command and acquired LOCK_thread_count and it is about to acquire zombie dump thread's LOCK_thd_data. Analysis: There are four locks involved in the deadlock. LOCK_log, LOCK_thread_count, LOCK_index and LOCK_thd_data. LOCK_log, LOCK_thread_count, LOCK_index are global mutexes where as LOCK_thd_data is local to a thread. We can divide these four locks in two groups. Group 1 consists of LOCK_log and LOCK_index and the order should be LOCK_log followed by LOCK_index. Group 2 consists of other two mutexes LOCK_thread_count, LOCK_thd_data and the order should be LOCK_thread_count followed by LOCK_thd_data. Unfortunately, there is no specific predefined lock order defined to follow in the MySQL system when it comes to locks across these two groups. In the above problematic example, there is no problem in the way we are acquiring the locks if you see each thread individually. But If you combine all 4 threads, they end up in a deadlock. Fix: Since everything seems to be fine in the way threads are taking locks, In this patch We are changing the duration of the locks in Thread 4 to break the deadlock. i.e., before the patch, Thread 4 ('show processlist' command) mysqld_list_processes() function acquires LOCK_thread_count for the complete duration of the function and it also acquires/releases each thread's LOCK_thd_data. LOCK_thread_count is used to protect addition and deletion of threads in global threads list. While show process list is looping through all the existing threads, it will be a problem if a thread is exited but there is no problem if a new thread is added to the system. Hence a new mutex is introduced "LOCK_thd_remove" which will protect deletion of a thread from global threads list. All threads which are getting exited should acquire LOCK_thd_remove followed by LOCK_thread_count. (It should take LOCK_thread_count also because other places of the code still thinks that exit thread is protected with LOCK_thread_count. In this fix, we are changing only 'show process list' query logic ) (Eg: unlink_thd logic will be protected with LOCK_thd_remove). Logic of mysqld_list_processes(or file_schema_processlist) will now be protected with 'LOCK_thd_remove' instead of 'LOCK_thread_count'. Now the new locking order after this patch is: LOCK_thd_remove -> LOCK_thd_data -> LOCK_log -> LOCK_index -> LOCK_thread_count
| | * | BUG#18080920: CRASH; MY_REALLOC_STR DEREFERENCES NEGATIVE VALUE Nisha Gopalakrishnan2014-04-241-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | INTO CLIENT_ERRORS ARRAY Analysis: -------- The client may crash while executing a statement due to the missing mapping of the server error to it's equivalent client error. When trying to reallocate memory for the packet buffer, if the system is out of memory or the packet buffer is large, the server errors 'ER_OUT_OF_RESOURCES' or 'ER_PACKET_TOO_LARGE' is returned respectively. The client error number calculated is negative and when trying to dereference the array of client error messages with the calculated error number, the client crashes. Fix: ---- Map the server error returned to it's equivalent client error prior to dereferencing the array of client error messages. Note: Test case is not added since it is difficult to simulate the error condition.
| | * | Updated/added copyright header. Added line "use is subject to license terms" Murthy Narkedimilli2014-02-171-0/+1
| | | | | | | | | | | | | | | | to copyright header.
| | * | Fixing the bug 18184414: WRONG COPYRIGHT TO FILE INCLUDE/MYSQL_VERSION.H.INMurthy Narkedimilli2014-02-061-3/+4
| | | |
| | * | Bug #17760379 COLLATIONS WITH CONTRACTIONS BUFFER-OVERFLOW THEMSELVES IN THE ↵Venkata Sidagam2014-01-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FOOT Description: A typo in create_tailoring() causes the "contraction_flags" to be written into cs->contractions in the wrong place. This causes two problems: (1) Anyone relying on `contraction_flags` to decide "could this character be part of a contraction" is 100% broken. (2) Anyone relying on `contractions` to determine the weight of a contraction is mostly broken Analysis: When we are preparing the contraction in create_tailoring(), we are corrupting the cs->contractions memory location which is supposed to store the weights(8k) + contraction information(256 bytes). We started storing the contraction information after the 4k location. This is because of logic flaw in the code. Fix: When we create the contractions, we need to calculate the contraction with (char*) (cs->contractions + 0x40*0x40) from ((char*) cs->contractions) + 0x40*0x40. This makes the "cs->contractions" to move to 8k bytes and stores the contraction information from there. Similarly when we are calculating it for like range queries we need to calculate it from the 8k bytes onwards, this can be done by changing the logic to (const char*) (cs->contractions + 0x40*0x40). And for ucs2 charsets we need to modify the my_cs_can_be_contraction_head() and my_cs_can_be_contraction_tail() to point to 8k+ locations.
| | * | updating the current copyright year which reflects in the MySQL welcome message.Murthy Narkedimilli2014-01-091-2/+2
| | | |
| | * | Updated/added copyright headersMurthy Narkedimilli2014-01-065-5/+5
| | | |
| | * | Bug#17702677 WRONG INSTRUMENTATION INTERFACE FOR MYSQL_COND_TIMEDWAITChristopher Powers2013-11-071-2/+2
| | | | | | | | | | | | Fix Windows build break
| | * | Bug#17702677 WRONG INSTRUMENTATION INTERFACE FOR MYSQL_COND_TIMEDWAITMarc Alff2013-11-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pthread_cond_timedwait(3P) api uses a const struct timespec for parameter 3. The instrumentation api for the same, mysql_cond_timedwait, which expands to inline_mysql_cond_timedwait, should also take a const parameter for the timespec. This fix add the missing const to inline_mysql_cond_timedwait.
| | * | Bug#17513737 INTRODUCE CHECK TABLE...QUICKAnil Toshniwal2013-10-172-46/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | --Implemented CHECK TABLE...QUICK. Introduce CHECK TABLE...QUICK that would skip the btr_validate_index() and btr_search_validate() call, and count the no. of records in each index. Approved by Marko and Kevin. (rb#3567).
| | * | WL#7076: Backporting wl6715 to support both formats in 5.5, 5.6, 5.7Ashish Agarwal2013-07-022-1/+9
| | | | | | | | | | | | Backporting wl6715 to mysql-5.5
| | * | Bug#16729109: FIX COMPILATION WARNINGS WITH GCC 4.8Tor Didriksen2013-06-141-2/+2
| | | | | | | | | | | | | | | | | | | | Backport to 5.5 (external Bug#69407 Build warnings with mysql)
| | * | Bug#16194302: SUPPORT FOR FLOATING-POINT SYSTEM VARIABLESAshish Agarwal2013-05-192-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | USING THE PLUGIN INTERFACE. ISSUE: No support for floating-point plugin system variables. SOLUTION: Allowing plugins to define and expose floating-point system variables of type double. MYSQL_SYSVAR_DOUBLE and MYSQL_THDVAR_DOUBLE are added. ISSUE: Fractional part of the def, min, max values of system variables are ignored. SOLUTION: Adding functions that are used to store the raw representation of a double in the raw bits of unsigned longlong in a way that the binary representation remains the same.
| | * | Fix for Bug 16395495 - OLD FSF ADDRESS IN GPL HEADERMurthy Narkedimilli2013-03-1914-14/+14
| | | |
| | * | Updated/added copyright headersMurthy Narkedimilli2013-02-2615-15/+21
| | |\ \
| | | * | Updated/added copyright headers.Murthy Narkedimilli2013-02-2536-38/+36
| | | | |
| | * | | BUG#14303860 - EXECUTING A SELECT QUERY WITH TOO Neeraj Bisht2013-01-141-0/+2
| | |\ \ \ | | | |/ / | | | | | | | | | | MANY WILDCARDS CAUSES A SEGFAULT Back port from 5.6 and trunk
| | | * | BUG#14303860 - EXECUTING A SELECT QUERY WITH TOO Neeraj Bisht2013-01-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | MANY WILDCARDS CAUSES A SEGFAULT Back port from 5.6 and trunk
| | * | | BUG#11753923-SQL THREAD CRASHES ON DISK FULLVenkatesh Duggirala2013-01-021-0/+2
| | |\ \ \ | | | |/ / | | | | | Merging fix from mysql-5.1
| | | * | BUG#11753923-SQL THREAD CRASHES ON DISK FULLVenkatesh Duggirala2013-01-021-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | | Updated README and client executables copyright year to 2013Kent Boortz2013-01-011-2/+2
| | |\ \ \ | | | |/ /
| | | * | Updated README and client executables copyright year to 2013Kent Boortz2013-01-011-2/+2
| | | | |
| | * | | Bug#15960005 VALGRIND WARNINGS IN PROCESS_ARGSTor Didriksen2012-12-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Both <width> and <precision> can be specified as numbers or '*'. If an asterisk is used, an argument of type int is consumed.
| | * | | Merging from 5.1 to 5.5 for bug#11761752Ravinder Thakur2012-12-131-0/+1
| | |\ \ \ | | | |/ /
| | | * | bug#11761752: DO NOT ALLOW USE OF ALTERNATE DATA STREAMS ON NTFS FILESYSTEM.Ravinder Thakur2012-12-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | | BUG#14458232 - CRASH IN THD_IS_TRANSACTION_ACTIVE DURINGThayumanavar2012-11-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | | Bug#14549809 LINKING PROBLEM IN 5.5.28 BUILDS WITH THREADPOOL PLUGINTor Didriksen2012-08-281-18/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The use of Thread_iterator did not work on windows (linking problems). Solution: Change the interface between the thread_pool and the server to only use simple free functions. This patch is for 5.5 only (mimicks similar solution in 5.6)
| | * | | Merge of patch for Bug#13928675 from mysql-5.1.Nirbhay Choubey2012-08-071-8/+13
| | |\ \ \ | | | |/ /
| | | * | Bug#13928675 MYSQL CLIENT COPYRIGHT NOTICE MUSTNirbhay Choubey2012-08-071-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SHOW 2012 INSTEAD OF 2011 * Added a new macro to hold the current year : COPYRIGHT_NOTICE_CURRENT_YEAR * Modified ORACLE_WELCOME_COPYRIGHT_NOTICE macro to take the initial year as parameter and pick current year from the above mentioned macro.
| | * | | Bug#13699303 - THREAD POOL PLUGIN IGNORES TIMEOUT.Thayumanavar2012-07-251-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PROBLEM: mysql provides a feature where in a session which is idle for a period specified by the wait_timeout variable (whose value is in seconds), the session is closed This feature is not present when we use thread pool. FIX: This patch implements the interface functions which is required to implement the wait_timeout functionality in the thread pool plugin.
| | * | | Bug #12998841: libmysql divulges plaintext password upon request in 5.5Georgi Kodinov2012-07-053-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Clear text password client plugin disabled by default. 2. Added an environment variable LIBMYSQL_ENABLE_CLEARTEXT_PLUGIN, that when set to something starting with '1', 'Y' or 'y' will enable the clear text plugin for all connections. 3. Added a new mysql_options() option : MYSQL_ENABLE_CLEARTEXT_PLUGIN that takes an my_bool argument. When the value of the argument is non-zero the clear text plugin is enabled for this connection only. 4. Added an enable-cleartext-plugin config file option that takes a numeric argument. If the numeric value of the numeric argument is non-zero the clear text plugin is enabled for the connection 5. Added a boolean command line option "--enable_cleartext_plugin" to mysql, mysqlslap and mysqladmin. When specified it will call mysql_options with the effect of #3 6. Added a new CLEARTEXT option to the connect command in mysqltest. When specified it will enable the cleartext plugin for usage. 7. Added test cases and updated existing ones that need the clear text plugin.