summaryrefslogtreecommitdiff
path: root/mysys
Commit message (Collapse)AuthorAgeFilesLines
* Bug#16865959 - PLEASE BACKPORT BUG 14749800.Praveenkumar Hulakund2013-07-241-2/+4
| | | | | | | | | | | | Since log_throttle is not available in 5.5. Logging of error message for failure of thread to create new connection in "create_thread_to_handle_connection" is not backported. Since, function "my_plugin_log_message" is not available in 5.5 version and since there is incompatibility between sql_print_XXX function compiled with g++ and alog files with gcc to use sql_print_error, changes related to audit log plugin is not backported.
* merge back to the 5.5 tree and fix indentationGeorgi Kodinov2013-06-281-1/+11
|\
| * Bug #16996656: UNIQUE OPTION PREFIXES NOT DEPRECATED IN 5.5+Georgi Kodinov2013-06-261-1/+11
|/ | | Backported the deprecation warnings from WL#6978 to 5.5
* Bug#16729109: FIX COMPILATION WARNINGS WITH GCC 4.8Tor Didriksen2013-06-141-1/+6
| | | | | Backport to 5.5 (external Bug#69407 Build warnings with mysql)
* Bug#16194302: SUPPORT FOR FLOATING-POINT SYSTEM VARIABLESAshish Agarwal2013-05-191-5/+38
| | | | | | | | | | | | | | | | | | 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.
* Bug#16626742 IN MY_MD5FINAL IN MYSYS/MD5.C, CTX IS NOT PROPERLY ZEROED AS ↵Tor Didriksen2013-04-171-1/+1
| | | | | | INTENDED Zero out the entire struct, rather than the first sizeof(void*) bytes.
* Merge from mysql-5.1 to mysql-5.5Sujatha Sivakumar2013-03-282-2/+13
|\
| * Bug#14324766:PARTIALLY WRITTEN INSERT STATEMENT IN BINLOGSujatha Sivakumar2013-03-282-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NO ERRORS REPORTED Problem: ======= Errors from my_b_fill are ignored. MYSQL_BIN_LOG::write_cache code assumes that 0 returned from my_b_fill always means end-of-cache, but that is incorrect. It can result in error and the error is ignored. Other callers of my_b_fill don't check for error: my_b_copy_to_file, maybe my_b_gets. Fix: === An error handler is already present to check the "cache" error that is reported during "MYSQL_BIN_LOG::write_cache" call. Hence error handlers are added for "my_b_copy_to_file" and "my_b_gets". During my_b_fill() function call, when the cache read fails info->error= -1 is set. Hence a check for "info->error" is added for the above to callers upon their return.
| * Bug 16395495 - OLD FSF ADDRESS IN GPL HEADERMurthy Narkedimilli2013-03-1975-75/+75
| |
| * Updated/added copyright headers.Murthy Narkedimilli2013-02-2581-85/+81
| |
* | Fix for Bug 16395495 - OLD FSF ADDRESS IN GPL HEADERMurthy Narkedimilli2013-03-1929-29/+29
| |
* | BUG#11753923-SQL THREAD CRASHES ON DISK FULLVenkatesh Duggirala2013-03-012-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixing post push issue Simulator name used needs to be changed to make it work properly. Analysis: Debug control list addition (ListAddDel function dbug.c file) code was written in such a way that if new element is subset of already existing element, then the new element is not added. i.e., set @@global.debug = '+d,abcd', is existing in the list then you cannot add "a" or "ab" or "abc" in the list.
* | Bug #11752803 SERVER CRASHES IF MAX_CONNECTIONS DECREASED BELOW Venkata Sidagam2013-01-241-14/+8
|\ \ | |/ | | | | | | CERTAIN LEVEL Merging from 5.1 to 5.5
| * Bug #11752803 SERVER CRASHES IF MAX_CONNECTIONS DECREASED BELOW Venkata Sidagam2013-01-241-14/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CERTAIN LEVEL Problem description: mysqld crashes when we update the max_connections variable to lesser value than the number of currently open connections. Analysis: The "alarm_queue.max_elements" size will be decided at the server start time and it will get modified if we change max_connections value. In the current scenario the value of "alarm_queue.max_elements" is decremented when the max_connections is set to 2. When updating the "alarm_queue.max_elements" value we are not updating "max_used_alarms" value. Hence, instead of getting the warning "thr_alarm queue is full" it is ending up in asserting the server at the time of inserting new elements in the queue. Fix: the fix is to dynamically increase the size of the alarm_queue. In order to do that, queue_insert_safe() should be used instead if queue_insert().
* | Bug#11757464:SERVER CRASH IN RECURSIVE CALL WHEN OOMNisha Gopalakrishnan2013-01-154-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Analysis: --------- When the server is out of memory, an error is raised to indicate the same. Handling the error requires more memory to be allocated which fails, hence the error handling loops in a recursion and causes the server to crash. Fix: --- a) Prevents pushing the 'out of memory' error condition to the diagnostic area as it requires memory allocation. GET DIAGNOSTICS, SHOW WARNINGS and SHOW ERRORS statements will not show information about this error. However the 'out of memory' error is returned to the client. b) It sets the ME_FATALERROR flag when 'out of memory' errors are reported (for places where the flag is not already set). This flag prevents activation of SP error handlers which also require memory allocation and therefore are likely to fail.
* | Merge of patch for Bug#16066243 from mysql-5.1.Nirbhay Choubey2013-01-072-6/+8
|\ \ | |/
| * Bug#16066243 PB2 FAILURES I_MAIN.BUG15912213 ANDNirbhay Choubey2013-01-072-6/+8
| | | | | | | | | | | | I_MAIN.CTYPE_UTF8 FOR MACOSX10.6 FOR 5.1 Part 2: Fix for test failures on Windows.
* | Merge of patch for bug#16066243 from mysql-5.1.Nirbhay Choubey2013-01-041-2/+3
|\ \ | |/
| * Bug#16066243 PB2 FAILURES I_MAIN.BUG15912213 ANDNirbhay Choubey2013-01-041-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I_MAIN.CTYPE_UTF8 FOR MACOSX10.6 FOR 5.1 While converting directory name to filename, a file separator (FN_LIBCHAR) might get appended to the resulting file name. This can result in off-by-one error when length of the input string is equal to FN_REFLEN. In this case, the terminating '\0' gets written beyond the buffer allocated to store the result. Fixed by incrementing the dst buffer size by 1. As extra safety, switched to strnmov() and added a debug assert to check the length of the input file name. No test case added as the scenario is already covered by the test cases added for bugs in the description.
* | BUG#11753923-SQL THREAD CRASHES ON DISK FULLVenkatesh Duggirala2013-01-023-6/+44
|\ \ | |/ | | Merging fix from mysql-5.1
| * BUG#11753923-SQL THREAD CRASHES ON DISK FULLVenkatesh Duggirala2013-01-023-6/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | BUG#14727815 - CRASH IN PTHREAD_RWLOCK_WRLOCK/SRW_UNLOCKAhmad Abdullateef2012-12-181-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IN QUERY CACHE CODE DESCRIPTION: MySQL Server crashes sporadically when Query Caching is on and the server has high contention among clients. ANALYSIS : Scenario 1: In Query_cache::move_by_type() when handling RESULT or its related blocks, Write Lock is acquired on its parent Query block. However the next and prev pointers are cached in local variables before lock acquisition. In an extremely high contention scenario there exists a possibility that Query_cache::append_result_data() is operating on the same query block and as a consequence might append a new Result block to the end of Result blocks Linked List of the Query. This would manipulate the next, prev pointers of the Block being processed in move_by_type(), however the local pointers still point to previous nodes there by causing Data Corruption leading to crash. Scenario 2: In Windows SDK "BOOL" is typedefed as "int" and BOOLEAN is typedefed as "usigned char". The function pointer definition "srw_bool_func" mistakenly uses BOOL instead of BOOLEAN thereby virtually making the function my_TryAcquireSRWLockExclusive() always succeed because only the LSB of EAX has the actual result of the call, however due to type mismatch all bytes of EAX are used for evaluation. Again during high contention scenarios in Query_cache::free_old_query() calls try_lock_writing() on a Query, this call always succeeds and the query is freed, even though it is used by some other thread, in this case Query_cache::send_result_to_client() was using it and the code causes a crash because it accessed free or reallocated memory. FIX : Scenario 1: The next, prev pointers are now accessed only after Lock acquisition in Query_cache::move_by_type(). Scenario 2: In the definition of "srw_bool_func" BOOL has been replaced with "BOOLEAN"
* | Merging from 5.1 to 5.5 for bug#11761752Ravinder Thakur2012-12-131-0/+64
|\ \ | |/
| * bug#11761752: DO NOT ALLOW USE OF ALTERNATE DATA STREAMS ON NTFS FILESYSTEM.Ravinder Thakur2012-12-133-0/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 #14399795 : ISSUES RELATED TO SETTING AUDIT_LOG_STRATEGY Georgi Kodinov2012-08-171-0/+5
| | | | | | | | | | | | | | | | | | | | DURING SERVER STARTUP The options parser now correctly checks for ambiguous prefixes in enumerated variables and emits an error when the value supplied is ambiguous. No test added since mysql-test-run.pl can't handle server startup failures as an expected state.
* | Follow up patch for BUG#13961678. Fixing compilation warning given below.Sujatha Sivakumar2012-07-251-1/+1
| | | | | | "warning: integer constant is too large for 'long' type"
* | Bug#13961678:MULTI-STATEMENT TRANSACTION REQUIRED MORE THANSujatha Sivakumar2012-07-241-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'MAX_BINLOG_CACHE_SIZE' ERROR Problem: ======= MySQL returns following error in win64. "ERROR 1197 (HY000): Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again" when user tries to load >4G file even if max_binlog_cache_size set to maximum value. On Linux everything works fine. Analysis: ======== The `max_binlog_cache_size' variable is of type `ulonglong'. This value is set to `ULONGLONG_MAX' at the time of server start up. The above value is stored in an intermediate variable named `saved_max_binlog_cache_size' which is of type `ulong'. In visual c++ complier the `ulong' type is of 4bytes in size and hence the value is getting truncated to '4GB' and the cache is not able to grow beyond 4GB size. The same limitation is observed with "max_binlog_stmt_cache_size" as well. Similar fix has been applied. Fix: === As part of fix the type "ulong" is replaced with "my_off_t" which is of type "ulonglong".
* | merge from 5.1 to 5.5Sujatha Sivakumar2012-07-101-1/+5
|\ \ | |/
| * BUG#11762670:MY_B_WRITE RETURN VALUE IGNOREDSujatha Sivakumar2012-07-101-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: ======= The return value from my_b_write is ignored by: `my_b_write_quoted', `my_b_write_bit',`Query_log_event::print_query_header' Most callers of `my_b_printf' ignore the return value. `log_event.cc' has many calls to it. Analysis: ======== `my_b_write' is used to write data into a file. If the write fails it sets appropriate error number and error message through my_error() function call and sets the IO_CACHE::error == -1. `my_b_printf' function is also used to write data into a file, it internally invokes my_b_write to do the write operation. Upon success it returns number of characters written to file and on error it returns -1 and sets the error through my_error() and also sets IO_CACHE::error == -1. Most of the event specific print functions for example `Create_file_log_event::print', `Execute_load_log_event::print' etc are the ones which make several calls to the above two functions and they do not check for the return value after the 'print' call. All the above mentioned abuse cases deal with the client side. Fix: === As part of bug fix a check for IO_CACHE::error == -1 has been added at a very high level after the call to the 'print' function. There are few more places where the return value of "my_b_write" is ignored those are mentioned below. +++ mysys/mf_iocache2.c 2012-06-04 07:03:15 +0000 @@ -430,7 +430,8 @@ memset(buffz, '0', minimum_width - length2); else memset(buffz, ' ', minimum_width - length2); - my_b_write(info, buffz, minimum_width - length2); +++ sql/log.cc 2012-06-08 09:04:46 +0000 @@ -2388,7 +2388,12 @@ { end= strxmov(buff, "# administrator command: ", NullS); buff_len= (ulong) (end - buff); - my_b_write(&log_file, (uchar*) buff, buff_len); At these places appropriate return value handlers have been added.
* | mergeGeorgi Kodinov2012-07-051-1/+2
|\ \ | |/
| * Bug #13889741: HANDLE_FATAL_SIGNAL IN _DB_ENTER_ |Georgi Kodinov2012-07-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | HANDLE_FATAL_SIGNAL IN STRNLEN Fixed the following bounds checking problems : 1. in check_if_legal_filename() make sure the null terminated string is long enough before accessing the bytes in it. Prevents pottential read-past-buffer-end 2. in my_wc_mb_filename() of the filename charset check for the end of the destination buffer before sending single byte characters into it. Prevents write-past-end-of-buffer (and garbaling stack in the cases reported here) errors. Added test cases.
* | upmerge from mysql-5.1 branch -> mysql-5.5 branchRohit Kalhans2012-05-291-0/+5
|\ \ | |/
| * Bug#11762667: MYSQLBINLOG IGNORES ERRORS WHILE WRITING OUTPUTRohit Kalhans2012-05-291-1/+11
| | | | | | | | | | | | | | | | | | | | Problem: mysqlbinlog exits without any error code in case of file write error. It is because of the fact that the calls to Log_event::print() method does not return a value and the thus any error were being ignored. Resolution: We resolve this problem by checking for the IO_CACHE::error == -1 after every call to Log_event:: print() and terminating the further execution.
| * merge mysql-5.1->mysql-5.1-securityGeorgi Kodinov2012-03-081-1/+1
| |\
| * | Bug#13635833: MULTIPLE CRASHES IN FOREIGN KEY CODE WITH CONCURRENT DDL/DMLAnnamalai Gurusami2012-03-011-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 mysql-5.5->mysql-5.5-securityGeorgi Kodinov2012-04-101-2/+5
|\ \ \
| * | | Bug#13898343 THREAD LOOPS ENDLESSLY IN LF_PINBOX_PUT_PINS WHILE HOLDINGMarc Alff2012-03-281-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LOCK_THREAD_COUNT When using the performance schema file io instrumentation in MySQL 5.5, a thread would loop forever inside lf_pinbox_put_pins, when disconnecting. It would also hold LOCK_thread_count while doing so, effectively killing the server. The root cause of the loop in lf_pinbox_put_pins() is a leak of LF_PINS, when used with the filename_hash LF_HASH table in the performance schema. This fix contains the following changes: 1) Added the missing call to lf_hash_search_unpin(), to prevent the leak. 2) In mysys/lf_alloc-pin.c, there was some extra debugging code (MY_LF_EXTRA_DEBUG) written to detect precisely this kind of issues, but it was never used. Replaced MY_LF_EXTRA_DEBUG with DBUG_OFF, so that leaks similar to this one can be always detected in regular debug builds. 3) Backported the fix for the following bug, from 5.6 to 5.5: Bug#13417446 - 63339: INCORRECT FILE PATH IN PEFORMANCE_SCHEMA ON WINDOWS
* | | | merge mysql-5.5->mysql-5.5-securityGeorgi Kodinov2012-03-081-1/+1
|\ \ \ \ | |/ / /
| * | | Merge 5.1 => 5.5Tor Didriksen2012-03-061-1/+1
| |\ \ \ | | | |/ | | |/|
| | * | Bug#11761576 54082: HANDLE_SEGFAULT MAKES USE OF UNSAFE FUNCTIONSTor Didriksen2012-03-061-1/+1
| | |/ | | | | | | | | | Post-push fixes.
* | | Bug#13635833: MULTIPLE CRASHES IN FOREIGN KEY CODE WITH CONCURRENT DDL/DMLAnnamalai Gurusami2012-02-271-4/+5
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Updated/added copyright headersMySQL Build Team2012-02-163-4/+3
|\ \ | |/
| * Updated/added copyright headersKent Boortz2012-02-152-2/+2
| |\
| | * Updated/added copyright headersMySQL Build Team2012-02-153-5/+3
| | |
| | * Fix for BUG#13596377: MYSQL CRASHES ON STARTUP ON FREEBSD IN PB2Ramil Kalimullin2012-01-301-4/+6
| | | | | | | | | | | | Fix for #36428/#38364 backported into 5.0.
| | * Merge from mysql-5.0.94-releaseSunanda Menon2011-07-061-1/+16
| | |\
| | * \ Updated/added copyright headersKent Boortz2011-06-307-294/+111
| | |\ \
* | | \ \ Merging Bug#11752408 from mysql-5.1Alexander Barkov2012-01-231-0/+2
|\ \ \ \ \ | |/ / / /
| * | | | Bug#11752408 - 43593: DUMP/BACKUP/RESTORE/UPGRADE TOOLS FAILS BECAUSE OF ↵Alexander Barkov2012-01-231-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | UTF8_GENERAL_CI Introducing new collations: utf8_general_mysql500_ci and ucs2_general_mysql500_ci, to reproduce behaviour of utf8_general_ci and ucs2_general_ci from mysql-5.1.23 (and earlier). The collations are added to simplify upgrade from mysql-5.1.23 and earlier. Note: The patch does not make new server start over old data automatically. Some manual upgrade procedures are assumed. Paul: please get in touch with me to discuss upgrade procedures when documenting this bug. modified: include/m_ctype.h mysql-test/r/ctype_utf8.result mysql-test/t/ctype_utf8.test mysys/charset-def.c strings/ctype-ucs2.c strings/ctype-utf8.c
| * | | | Bug#11761576 54082: HANDLE_SEGFAULT MAKES USE OF UNSAFE FUNCTIONSTor Didriksen2011-11-301-65/+276
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | handle_segfault is the signal handler code of mysqld. however, it makes calls to potentially unsafe functions localtime_r, fprintf, fflush.