summaryrefslogtreecommitdiff
path: root/mysys
Commit message (Collapse)AuthorAgeFilesLines
* MariaDB made be compiled by gcc 4.8.1unknown2013-10-291-1/+1
| | | | | | There was 2 problems: 1) coping/moving of the same type (usually casting) as sizeof() (solved in different ways depends on the cause); 2) using 'const' in SSL_CTX::getVerifyCallback() which return object (not reference) and so copy of the object will be created and 'const' has no sens.
* MDEV-4811 Assertion `offset < 0x1f' fails in type_and_offset_store on COLUMN_ADDunknown2013-08-011-9/+18
| | | | | | MDEV-4812 Valgrind warnings (Invalid write) in dynamic_column_update_many on COLUMN_ADD Fixed problem of working on wrong data (do not allow offset to out of string length).
* 5.2 mergeSergei Golubchik2013-07-151-23/+14
|\
| * MDEV-4409 - Fix deadlock in MySQL key cache code, that can happen if there ↵Vladislav Vaintroub2013-07-091-23/+14
| | | | | | | | | | | | | | is a key cache resize running in parallel with an update. If there is a key cache resize,a thread writing to key cache, will pause waiting until resize finishes. However this thread is won't be woken, because resize does not signaling waiters anymore. This is a regression introduced in WL#86(segmented MyISAM key cache) The fix is to unconditionally release threads waiting on resize_queue when resize finishes, as in pre-WL#86 code.
* | 5.2 -> 5.3Sergei Golubchik2013-02-284-12/+16
|\ \ | |/
| * 5.1 -> 5.2 mergeSergei Golubchik2013-02-284-12/+16
| |\
| | * mysql-5.1 mergeSergei Golubchik2013-02-284-11/+15
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mysys/errors.c: revert upstream's fix. use a much simpler one mysys/my_write.c: revert upstream's fix. use a simpler one sql/item_xmlfunc.cc: useless, but ok sql/mysqld.cc: simplify upstream's fix storage/heap/hp_delete.c: remove upstream's fix. we'll use a much less expensive approach.
| | | * 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.
| | | * 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
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | | * 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.
| | * | MDEV-4194: Fix typo (missing comma) in mysys error messagesVladislav Vaintroub2013-02-211-1/+1
| | | |
* | | | 5.2->5.3 mergeSergei Golubchik2013-01-101-7/+3
|\ \ \ \ | |/ / /
| * | | mergeVladislav Vaintroub2012-12-211-7/+3
| |\ \ \ | | |/ /
| | * | MDEV-3918: myisamchk bogus error for files larger than 4GB.Vladislav Vaintroub2012-12-061-7/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The failure is caused by failing stat() call . C Runtime function stat() uses old struct with 32bit st_size member, and since Visual Studio 2010 , it returns an error on st_size overflow (i.e on files larger than 4GB) Fix replaces stat() by my_stat(), the later is backed by 64bit-able stat64().
* | | | Merge MariaDB 5.2->5.3unknown2012-11-201-7/+7
|\ \ \ \ | |/ / /
| * | | Merge MariaDB 5.1->5.2.unknown2012-11-201-7/+7
| |\ \ \ | | |/ /
| | * | MDEV-3849 - 1 bytes stack overwrite in normalize_dirname().Vladislav Vaintroub2012-11-101-7/+7
| | | | | | | | | | | | | | | | | | | | Take into account that length of strings passed down to this function can be up to FN_REFLEN+1 bytes. including terminating zero. The overwrite was caused by incomplete fix to MySQL Bug # 44834
| | * | Fix compiler warningsunknown2012-08-241-1/+1
| | | |
| | * | Merge with latest 5.1.unknown2012-08-241-3/+51
| | |\ \
| * | \ \ Merge into latest 5.2.unknown2012-08-241-3/+51
| |\ \ \ \
* | | | | | MDEV-381: fdatasync() does not correctly flush growing binlog file.unknown2012-08-301-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we append data to the binlog file, we use fdatasync() to ensure the data gets to disk so that crash recovery can work. Unfortunately there seems to be a bug in ext3/ext4 on linux, so that fdatasync() does not correctly sync all data when the size of a file is increased. This causes crash recovery to not work correctly (it loses transactions from the binlog). As a work-around, use fsync() for the binlog, not fdatasync(). Since we are increasing the file size, (correct) fdatasync() will most likely not be faster than fsync() on any file system, and fsync() does work correctly on ext3/ext4. This avoids the need to try to detect if we are running on buggy ext3/ext4.
* | | | | | Merge into latest 5.3unknown2012-08-241-3/+51
|\ \ \ \ \ \
| * \ \ \ \ \ merge from 5.2unknown2012-08-241-3/+51
| |\ \ \ \ \ \ | | | |/ / / / | | |/| | | |
| | * | | | | Merge from 5.1.unknown2012-08-241-3/+51
| | |\ \ \ \ \ | | | | |_|/ / | | | |/| | |
| | | * | | | MDEV-382: Incorrect quotingunknown2012-08-241-3/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Various places in the server replication code was incorrectly quoting strings, which could lead to incorrect SQL on the slave/mysqlbinlog.
* | | | | | | 5.2 merge.Sergei Golubchik2012-08-223-2/+18
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | / / / | | |_|/ / / | |/| | | | | | | | | | | | | | | | two tests still fail: main.innodb_icp and main.range_vs_index_merge_innodb call records_in_range() with both range ends being open (which triggers an assert)
| * | | | | 5.1 mergeSergei Golubchik2012-08-223-3/+18
| |\ \ \ \ \ | | |/ / / / | |/| | / / | | | |/ / | | |/| | increase xtradb verson from 13.0 to 13.01
| | * | | merge with MySQL 5.1.65Sergei Golubchik2012-08-223-3/+18
| | |\ \ \ | | | |/ / | | |/| / | | | |/
| | | * 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. client/mysqlbinlog.cc: check for IO_CACHE::error == -1 has been added after the call to the event specific print functions mysys/mf_iocache2.c: Added handler to check the written value of `my_b_write' sql/log.cc: Added handler to check the written value of `my_b_write' sql/log_event.cc: Added error simulation statements in `Create_file_log_event::print` and `Execute_load_query_log_event::print' sql/rpl_utility.h: Removed the extra ';'
| | | * 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.
| | | * 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. client/mysqlbinlog.cc: - handled error conditions during event->print() calls - added check for error in end_io_cache() mysys/my_write.c: Added debug code to simulate file write error. error returned will be ENOSPC=> error no space on the disk sql/log_event.cc: Added debug code to simulate file write error, by reducing the size of io cache.
* | | | Merge 5.2->5.3Sergey Petrunya2012-06-181-55/+197
|\ \ \ \ | |/ / /
| * | | Fixed LP bug #1008293.Igor Babaev2012-06-111-55/+197
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One of the reported problems manifested itself in the scenario when one thread tried to to get statistics on a key cache while the second thread had not finished initialization of the key cache structure yet. The problem was resolved by forcing serialization of such operations on key caches. To serialize function calls to perform certain operations over a key cache a new mutex associated with the key cache now is used. It is stored in the field op_lock of the KEY_CACHE structure. It is locked when the operation is performed. Some of the serialized key cache operations utilize calls for other key cache operations. To avoid recursive locking of op_lock the new functions that perform the operations of key cache initialization, destruction and re-partitioning with an additional parameter were introduced. The parameter says whether the operation over op_lock are to be performed or are to be omitted. The old functions for the operations of key cache initialization, destruction,and re-partitioning now just call the corresponding new functions with the additional parameter set to true requesting to use op_lock while all other calls of these new function have this parameter set to false. Another problem reported in the bug entry concerned the operation of assigning an index to a key cache. This operation can be called while the key cache structures are not initialized yet. In this case any call of flush_key_blocks() should return without any actions. No test case is provided with this patch.
* | | | 5.2 mergeSergei Golubchik2012-05-201-2/+3
|\ \ \ \ | |/ / /
| * | | 5.1 mergeSergei Golubchik2012-05-181-1/+4
| |\ \ \ | | |/ /
| | * | merge with mysql-5.1.63Sergei Golubchik2012-05-171-1/+4
| | |\ \ | | | |/
| | | * merge mysql-5.1->mysql-5.1-securityGeorgi Kodinov2012-03-081-1/+1
| | | |\
| | | | * Bug#11761576 54082: HANDLE_SEGFAULT MAKES USE OF UNSAFE FUNCTIONSTor Didriksen2012-03-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Post-push fixes. mysys/stacktrace.c: Missing comma after "%s" format specifier. sql/mysqld.cc: Move #define to signal_handler.cc sql/signal_handler.cc: Missing #define UNSAFE_DEFAULT_LINUX_THREADS 200
| | | * | 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
* | | | mergeSergei Golubchik2012-04-052-2/+4
|\ \ \ \ | |/ / /
| * | | mergeSergei Golubchik2012-04-052-2/+4
| |\ \ \ | | |/ /
| | * | mysql-5.1.62 mergeSergei Golubchik2012-04-052-2/+4
| | |\ \ | | | |/
| | | * 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
| | | | |\ \
| | | * | | | 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
* | | | | | | Compatibility fixes by U OrsiniMichael Widenius2012-03-301-1/+1
| | | | | | |