summaryrefslogtreecommitdiff
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-9466 : Exception handler on Windows does not output any text,Vladislav Vaintroub2016-02-031-1/+1
| | | | | | | | | | if mysqld runs as service The bug is caused by the attempt to write to filedescriptor 2 (STDERR_FILENO), however in case of a service stderr has different fd (debugging shows fileno(stderr) is 4 after freopen, and -1 before it) Fixed definition of STDERR_FILENO for Windows to be fileno(stderr).
* MDEV-9112: Non-blocking client API missing on non-x86 platformsGeorg Richter2016-02-011-1/+1
| | | | | | | The check for UCONTEXT in cmake was somehow become broken, disabling the fallback to ucontext. This caused the non-blocking client API to not be available for non-x86 platforms, on which no hand-crafted assembler implementation of my_context is available.
* MDEV-9249 MariaDB un-buildable on linux64: fails @ "error: ↵Sergei Golubchik2015-12-211-0/+4
| | | | | | | ‘ERR_remove_state’ was not declared in this scope" when linking against OpenSSL 1.0.2e ERR_remove_state is deprecated, use ERR_remove_thread_state if possible
* MDEV-8052 abi detection incorrect with clangSergei Golubchik2015-06-037-47/+0
| | | | don't include #include directives into .pp files
* MDEV-6916 REPAIR VIEW / mysql migrationOleksandr Byelkin2015-04-121-0/+1
| | | | from: r4407
* 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.
| * | merge bug#13708485 5.1->5.5Georgi Kodinov2012-06-291-3/+4
| |\ \ | | |/
| | * Bug #13708485: malformed resultset packet crashes clientGeorgi Kodinov2012-06-281-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several fixes : * sql-common/client.c Added a validity check of the fields metadata packet sent by the server. Now libmysql will check if the length of the data sent by the server matches what's expected by the protocol before using the data. * client/mysqltest.cc Fixed the error handling code in mysqltest to avoid sending new commands when the reading the result set failed (and there are unread data in the pipe). * sql_common.h + libmysql/libmysql.c + sql-common/client.c unpack_fields() now generates a proper error when it fails. Added a new argument to this function to support the error generation. * sql/protocol.cc Added a debug trigger to cause the server to send a NULL insted of the packet expected by the client for testing purposes.
| * | Bug#14238406 NEW COMPILATION WARNINGS WITH GCC 4.7 (-WERROR=NARROWING)Jon Olav Hauglid2012-06-291-2/+2
| |\ \ | | |/ | | | Manual merge from mysql-5.1 to mysql-5.5
| | * Bug#14238406 NEW COMPILATION WARNINGS WITH GCC 4.7 (-WERROR=NARROWING)Jon Olav Hauglid2012-06-291-2/+2
| | | | | | | | | | | | | | | This patch fixes various compilation warnings of the type "error: narrowing conversion of 'x' from 'datatype1' to 'datatype2'
| | * Bug#13635833: MULTIPLE CRASHES IN FOREIGN KEY CODE WITH CONCURRENT DDL/DMLAnnamalai Gurusami2012-03-011-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two threads. In one thread, dml operation is going on involving cascaded update operation. In another thread, alter table add foreign key constraint is happening. Under these circumstances, it is possible for the dml thread to access a dict_foreign_t object that has been freed by the ddl thread. The debug sync test case provides the sequence of operations. Without fix, the test case will crash the server (because of newly added assert). With fix, the alter table stmt will return an error message. Backporting the fix from MySQL 5.5 to 5.1 rb:961 rb:947
| * | Merge 5.5.24 back into main 5.5.Joerg Bruehe2012-05-072-8/+12
| |\ \ | | | | | | | | | | | | | | | | This is a weave merge, but without any conflicts. In 14 source files, the copyright year needed to be updated to 2012.
| | * | Bug#13635833: MULTIPLE CRASHES IN FOREIGN KEY CODE WITH CONCURRENT DDL/DMLAnnamalai Gurusami2012-02-271-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two threads. In one thread, dml operation is going on involving cascaded update operation. In another thread, alter table add foreign key constraint is happening. Under these circumstances, it is possible for the dml thread to access a dict_foreign_t object that has been freed by the ddl thread. The debug sync test case provides the sequence of operations. Without fix, the test case will crash the server (because of newly added assert). With fix, the alter table stmt will return an error message. rb:947 approved by Jimmy Yang
| | * | BUG#13431369 - MAIN.VARIABLES-NOTEMBEDDED CRASHES THE SERVER SPORADICALLY ON ↵Tatjana Azundris Nuernberg2012-02-191-0/+3
| | |\ \ | |/ / / | | | _ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | WINDOWS On shutdown(), Windows can drop traffic still queued for sending even if that wasn't specifically requested. As a result, fatal errors (those after signaling which the server will drop the connection) were sometimes only seen as "connection lost" on the client side, because the server-side shutdown() erraneously discarded the correct error message before sending it. If on Windows, we now use the Windows API to access the (non-broken) equivalent of shutdown(). Backport from trunk
| | * BUG#13431369 - MAIN.VARIABLES-NOTEMBEDDED CRASHES THE SERVER SPORADICALLY ON ↵Tatjana Azundris Nuernberg2012-02-171-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | WINDOWS On shutdown(), Windows can drop traffic still queued for sending even if that wasn't specifically requested. As a result, fatal errors (those after signaling which the server will drop the connection) were sometimes only seen as "connection lost" on the client side, because the server-side shutdown() erraneously discarded the correct error message before sending it. If on Windows, we now use the Windows API to access the (non-broken) equivalent of shutdown(). Backport from trunk
| | * merge mysql-5.1->mysql-5.1-securityGeorgi Kodinov2012-02-172-2/+2
| | |\