summaryrefslogtreecommitdiff
path: root/mysys
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'mariadb-10.0.26' into 10.0-galeraNirbhay Choubey2016-06-246-8/+15
|\
| * Merge branch '5.5' into bb-10.0Sergei Golubchik2016-06-215-6/+10
| |\
| | * MDEV-9433: [PATCH} cppcheck reported a number of minor coding errorsDaniel Black2016-06-141-0/+1
| | | | | | | | | | | | | | | | | | Fix cppwarning of va_args being opened but not closed. Signed-off-by: Vicențiu Ciorbaru <vicentiu@mariadb.org>
| | * MDEV-9433: [PATCH] cppcheck reported a number of minor coding errorsDaniel Black2016-06-141-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | Fix a bug in testhash.c that caused an out of bounds memory access when command line parameters specified 0 records to be inserted in the hashtable. Signed-off-by: Vicențiu Ciorbaru <vicentiu@mariadb.org>
| | * Merge branch 'mysql/5.5' into 5.5Sergei Golubchik2016-06-143-4/+6
| | |\
| | | * Bug#23251517: SEMISYNC REPLICATION HANGINGmysql-5.5.50Sujatha Sivakumar2016-05-162-16/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert following bug fix: Bug#20685029: SLAVE IO THREAD SHOULD STOP WHEN DISK IS FULL Bug#21753696: MAKE SHOW SLAVE STATUS NON BLOCKING IF IO THREAD WAITS FOR DISK SPACE This fix results in a deadlock between slave IO thread and SQL thread. (cherry picked from commit e3fea6c6dbb36c6ab21c4ab777224560e9608b53)
| | | * Bug#22897202: RPL_IO_THD_WAIT_FOR_DISK_SPACE HAS OCCASIONALSujatha Sivakumar2016-04-191-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FAILURES Analysis: ========= Test script is not ensuring that "assert_grep.inc" should be called only after 'Disk is full' error is written to the error log. Test checks for "Queueing master event to the relay log" state. But this state is set before invoking 'queue_event'. Actual 'Disk is full' error happens at a very lower level. It can happen that we might even reset the debug point before even the actual disk full simulation occurs and the "Disk is full" message will never appear in the error log. In order to guarentee that we must have some mechanism where in after we write "Disk is full" error messge into the error log we must signal the test to execute SSS and then reset the debug point. So that test is deterministic. Fix: === Added debug sync point to make script deterministic.
| | | * BUG#22594514: HANDLE_FATAL_SIGNAL (SIG=11) INNisha Gopalakrishnan2016-03-171-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | UNIQUE::~UNIQUE | SQL/UNIQUES.CC:355 Analysis ======== Enabling the sort_buffer_size with a large value can cause operations utilizing the sort buffer like DELETE as mentioned in the bug report to fail. 5.5 and 5.6 versions reports OOM error while in 5.7+, the server crashes. While initializing the mem_root for the sort buffer tree, the block size for the mem_root is determined from the 'sort_buffer_size' value. This unsigned long value is typecasted to unsigned int, hence it becomes zero. Further block_size computation while initializing the mem_root results in a very large block_size value. Hence while trying to allocate a block during the DELETE operation, an OOM error is reported. In case of 5.7+, the PFS instrumentation for memory allocation, overshoots the unsigned value and allocates a block of just one byte. While trying to free the block of the mem_root, the original block_size is used. This triggers the crash since the server tries to free unallocated memory. Fix: ==== In order to restrict usage of such unreasonable sort_buffer_size, the typecast of block size to 'unsigned int' is removed and hence reports OOM error across all versions for sizes exceeding unsigned int range.
| | | * Bug#20685029: SLAVE IO THREAD SHOULD STOP WHEN DISK ISSujatha Sivakumar2016-03-012-7/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FULL Bug#21753696: MAKE SHOW SLAVE STATUS NON BLOCKING IF IO THREAD WAITS FOR DISK SPACE Problem: ======== Currently SHOW SLAVE STATUS blocks if IO thread waits for disk space. This makes automation tools verifying server health block on taking relevant action. Finally this will create SHOW SLAVE STATUS piles. Analysis: ========= SHOW SLAVE STATUS hangs on mi->data_lock if relay log write is waiting for free disk space while holding mi->data_lock. mi->data_lock is needed to protect the format description event (mi->format_description_event) which is accessed by the clients running FLUSH LOGS and slave IO thread. Note relay log writes don't need to be protected by mi->data_lock, LOCK_log is used to protect relay log between IO and SQL thread (see MYSQL_BIN_LOG::append_event). The code takes mi->data_lock to protect mi->format_description_event during relay log rotate which might get triggered right after relay log write. Fix: ==== Release the data_lock just for the duration of writing into relay log. Made change to ensure the following lock order is maintained to avoid deadlocks. data_lock, LOCK_log data_lock is held during relay log rotations to protect the description event.
| | | * Bug#21770366 backport bug#21657078 to 5.5 and 5.6Jon Olav Hauglid2016-01-261-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Post-push fix: The problem was that condition variable timeouts could in some cases (slow machines and/or short timeouts) be infinite. When the number of milliseconds to wait is computed, the end time is computed before the now() time. This can result in the now() time being later than the end time, leading to negative timeout. Which after conversion to unsigned becomes ~infinite. This patch fixes the problem by explicitly checking if we get negative timeout and then using 0 if this is the case.
| * | | MDEV-10001 my_b_seek() may not work correctly after my_b_read() hits EOFSergei Golubchik2016-06-151-0/+3
| | | | | | | | | | | | | | | | applied the patch from David Gow
| * | | Merge branch 'mdev9991' into mdev9991-10.0Kristian Nielsen2016-06-081-2/+2
| |\ \ \ | | |/ /
| | * | Fix compiler check for stack unwind hintKristian Nielsen2016-06-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The check inserts a DWARF directive to tell stack unwinding that the bottom of the (co-routine) stack has been reached. Without this, stack traces may attempt to continue past the bottom of the stack. The GCC version check was incorrect, and failed to trigger for GCC version 5.[0123].
* | | | Merge branch '10.0' into 10.0-galeraNirbhay Choubey2016-04-298-9/+15
|\ \ \ \ | |/ / /
| * | | Merge branch '5.5' into 10.0Sergei Golubchik2016-04-261-1/+0
| |\ \ \ | | |/ /
| | * | MDEV-9748 Include Twin (mysys_err.h is included twice in mysys/my_copy.c)Sergei Golubchik2016-04-191-1/+0
| | | |
| * | | MDEV-9773: Memory corruption in mariadb_dyncol_unpackOleksandr Byelkin2016-03-241-1/+1
| | | | | | | | | | | | | | | | Fixed calculating pointer to memory allocated for names in numeric format in unpacking procedure.
| * | | Merge branch '5.5' into 10.0Sergei Golubchik2016-03-211-1/+8
| |\ \ \ | | |/ /
| | * | MDEV-9733 Server crashes in lf_pinbox_real_free on replication slavesSergei Golubchik2016-03-171-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | don't allocate all the stack, leave some stack for function calls. To test I added the following line: alloca_size = available_stack_size() - X at X=4096 or less mysqld crashed, at 8192 mtr test passed.
| * | | Fix spelling: occurred, execute, which etcOtto Kekäläinen2016-03-045-6/+6
| | | |
* | | | Merge tag 'mariadb-10.0.24' into 10.0-galeraNirbhay Choubey2016-02-237-16/+16
|\ \ \ \ | |/ / /
| * | | Merge branch '5.5' into 10.0Sergei Golubchik2016-02-155-12/+14
| |\ \ \ | | |/ /
| | * | fix my_gethwaddr() for solarisSergei Golubchik2016-02-151-1/+1
| | | | | | | | | | | | | | | | it caused feedback plugin tests to fail
| | * | Fix memory leak when failing to read config fileVicențiu Ciorbaru2016-02-141-0/+1
| | | | | | | | | | | | | | | | | | | | In the case of error during my_load_defaults, we would not free the args array.
| | * | Merge branch 'mysql/5.5' into 5.5Sergei Golubchik2016-02-092-2/+4
| | |\ \ | | | |/ | | | | | | | | | | | | reverted about half of commits as either not applicable or outright wrong
| | | * Bug#21770366 backport bug#21657078 to 5.5 and 5.6Ajo Robert2016-01-072-12/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem Statement ========= Fix various issues when building MySQL with Visual Studio 2015. Fix: ======= - Visual Studio 2015 adds support for timespec. Add check and related code to use this and only use our replacement if timespec is not defined. - Rename lfind/lsearch to my* to avoid redefinition problems. - Set default value for TMPDIR to "" on Windows as P_tmpdir no longer exists. - using VS definition of snprintf if available - tzname are now renamed to _tzname.
| | * | MDEV-9024 Build fails with VS2015Sergei Golubchik2016-02-061-20/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cherry-pick f1daf9ce from 10.0 branch ------------------------------------- Fix build failures caused by new C runtime library - isnan, snprintf, struct timespec are now defined, attempt to redefine them leads - P_tmpdir, tzname are no more defined - lfind() and lsearch() in lf_hash.c had to be renamed, declaration conflicts with some C runtime functions with the same name declared in a header included by stdlib.h Also fix couple of annoying warnings : - remove #define NOMINMAX from config.h to avoid "redefined" compiler warnings(NOMINMAX is already in compile flags) - disable incremental linker in Debug as well (feature not used much and compiler crashes often) Also simplify package building with Wix, require Wix 3.9 or later (VS2015 is not compatible with old Wix 3.5/3.6)
| | * | MDEV-4664 mysql_upgrade crashes if root's password contains an ↵Sergei Golubchik2016-02-061-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | apostrophe/single quotation mark fix dynstr_append_os_quoted() to escape single quotes correctly for a POSIX shell
| | * | unit test for dynstr_append_os_quoted()Sergei Golubchik2016-02-061-9/+7
| | | | | | | | | | | | | | | | and a trivial cleanup to avoid manually-specified lengths
| * | | Merge pull request #150 from grooverdan/10.0-my_rnd_cppVicențiu-Marian Ciorbaru2016-02-061-4/+0
| |\ \ \ | | | | | | | | | | MDEV-9433: mysys/my_rnd.c - remove #ifdef __cplusplus
| | * | | mysys/my_rnd.c - remove #ifdef __cplusplusDaniel Black2016-01-191-4/+0
| | | | |
| * | | | Merge branch '5.5' into 10.0Alexey Botchkov2016-01-251-0/+2
| |\ \ \ \ | | |/ / / | |/| / / | | |/ / | | | | Conflicts: plugin/server_audit/server_audit.c
| | * | MDEV-9106 Audit plugin compiled with MariaDB can't install on MySQL 5.7.Alexey Botchkov2016-01-121-0/+2
| | | | | | | | | | | | | | | | | | | | The audit API was seriously changed in MySQL 5.7. so we had to adapt the plugin's code to that.
* | | | Merge tag 'mariadb-10.0.23' into 10.0-galeraNirbhay Choubey2015-12-197-30/+54
|\ \ \ \ | |/ / /
| * | | MDEV-8378 - Debian: the Lintian complains about many "shlib-calls-exit" in manymariadb-10.0.23Sergey Vojtovich2015-12-161-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | of the plugins Removed exit() from daemon_example, pass error to caller instead. Also removed unused my_abort_hook.
| * | | MDEV-9167: COLUMN_CHECK fails on valid decimal dataOleksandr Byelkin2015-12-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Check now allows zero length decimals too. (backporting Adam Chainz patch to 10.0)
| * | | Merge branch '5.5' into 10.0Sergei Golubchik2015-12-131-1/+1
| |\ \ \ | | |/ /
| | * | Merge branch 'mysql/5.5' into 5.5Sergei Golubchik2015-12-091-1/+1
| | |\ \ | | | |/
| | | * Bug #21503595 : --QUERY-ALLOC-BLOCK-SIZE=-1125899906842624 +Arun Kuruvila2015-09-041-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PID_FILE CHECK LEADS TO OOM SIG 11 Description:- A server started with 'query_alloc_block_size' option set to a certain range of negative values on a machine without enough memory may lead to OOM. Analysis:- Server uses 'strtoull()' to convert server variable values of type 'GET_UINT', 'GET_ULONG' or 'GET_ULL' from string to unsigned long long. According to the man page, 'strtoull()' function returns either the result of the conversion or, if there was a leading minus sign, the negation of the result of the conversion represented as an unsigned value, unless the original(nonnegated) value would overflow; in the latter case, strtoull() returns ULLONG_MAX and sets errno to ERANGE. So 'strtoull()' converts a small negative value to a larger postive value. For example string '-1125899906842624' will be converted to an unsigned value, '18445618173802708992' (ulonglong typecast of '-1125899906842624'). So a server started with 'query_alloc_block_size' set to "-1125899906842624" on a machine without enough memory will lead to OOM since server allocates '18445618173802708992' bytes(17178820608 GB) for query allocation block. Fix:- When server is started with any server variable, of type "GET_UINT", "GET_ULONG" or "GET_ULL", set to a negative value, a warning, "option xxx: value -yyy adjusted to zzz" is thrown and the value is adjusted to the lowest possible value for that variable. The dynamic server variable which is configured through the client exhibit the same behavior as fix made for variables configured during the server start up.
| | | * Bug# 20376760: STACK-BUFFER-OVERFLOW WITH LONG PATHS TO CERTAIN VARIABLESYashwant Sahu2015-06-241-2/+2
| | | |
| * | | MDEV-8521 Drastic loss of precision in COLUMN_JSON() on DOUBLEsOleksandr Byelkin2015-12-101-1/+3
| | | | | | | | | | | | | | | | fixed conversion
| * | | MDEV-8401 COLUMN_CREATE(name, value as DOUBLE) results in stringOleksandr Byelkin2015-12-101-4/+0
| | | | | | | | | | | | | | | | Double representation fixed (JSON is valid even with 'e' in the number)
| * | | Fixes to get all test to run on MacosX Lion 10.7Monty2015-11-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This includes fixing all utilities to not have any memory leaks, as safemalloc warnings stopped tests from passing on MacOSX. - Ensure that all clients takes character-set-dir, as the libmysqlclient library will use it. - mysql-test-run now passes character-set-dir to all external clients. - Changed dynstr_free() so that it can be called twice (made freeing code easier) - Changed rpl_global_gtid_slave_state to be allocated dynamicly as it includes a mutex that needs to be initizlied/destroyed before my_end() is called. - Removed rpl_slave_state::init() and rpl_slave_stage::deinit() as their job are better handling by constructor and delete. - Print alias instead of table_name in check_duplicate_key as table_name may have been converted to lower case. Other things: - Fixed a case in time_to_datetime_with_warn() where we where using && instead of & in tests
| * | | MDEV-9024 Build fails with VS2015Vladislav Vaintroub2015-11-062-21/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix build failures caused by new C runtime library - isnan, snprintf, struct timespec are now defined, attempt to redefine them leads - P_tmpdir, tzname are no more defined - lfind() and lsearch() in lf_hash.c had to be renamed, declaration conflicts with some C runtime functions with the same name declared in a header included by stdlib.h Also fix couple of annoying warnings : - remove #define NOMINMAX from config.h to avoid "redefined" compiler warnings(NOMINMAX is already in compile flags) - disable incremental linker in Debug as well (feature not used much and compiler crashes often) Also simplify package building with Wix, require Wix 3.9 or later (VS2015 is not compatible with old Wix 3.5/3.6)
| * | | MDEV-8692 prefschema test failures on ARM (on Debian build system)Alexander Barkov2015-10-301-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | A few tests assumes that the CYCLE timer is always available, which is not true on some platforms (e.g. ARM). Fixing the tests not to reply on the CYCLE availability.
* | | | Merge tag 'mariadb-10.0.22' into 10.0-galeraNirbhay Choubey2015-10-313-13/+63
|\ \ \ \ | |/ / /
| * | | MDEV-8565: COLUMN_CHECK fails on valid dataOleksandr Byelkin2015-10-191-2/+4
| | | | | | | | | | | | | | | | Check allows zero lengts int/uint now.
| * | | Fixed overrun in key cache if one tried to allocate a key cacheMonty2015-08-132-11/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Merge branch '5.5-galera' into 10.0-galeraNirbhay Choubey2015-09-251-1/+4
|\ \ \ \
| * | | | MDEV-8208: Sporadic SEGFAULT on startupNirbhay Choubey2015-09-251-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Addendum: * Before calling THD::init_for_queries(), flip the current_thd to wsrep thread so that memory gets allocated for the right THD. * Use wsrep_creating_startup_threads instead of plugins_are_initialized as the condition for the execution of THD::init_for_queries() within start_wsrep_THD(), as use of latter could still leave some room for race.