summaryrefslogtreecommitdiff
path: root/mysys/my_write.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch '10.3' into 10.4Oleksandr Byelkin2019-05-191-1/+1
|\
| * Merge branch '5.5' into 10.1Vicențiu Ciorbaru2019-05-111-1/+1
| |\
| | * Update FSF AddressVicențiu Ciorbaru2019-05-111-1/+1
| | | | | | | | | | | | * Update wrong zip-code
* | | mysys: rename ME_xxx flags to match plugin apiSergei Golubchik2018-06-041-1/+1
| | |
* | | mysys: remove dead ME_xxx flagsSergei Golubchik2018-06-041-1/+1
|/ /
* | Merge branch '5.5' into bb-10.0Sergei Golubchik2016-06-211-1/+2
|\ \ | |/
| * Merge branch 'mysql/5.5' into 5.5Sergei Golubchik2016-06-141-1/+2
| |\
| | * Bug#23251517: SEMISYNC REPLICATION HANGINGmysql-5.5.50Sujatha Sivakumar2016-05-161-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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#20685029: SLAVE IO THREAD SHOULD STOP WHEN DISK ISSujatha Sivakumar2016-03-011-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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#11753923-SQL THREAD CRASHES ON DISK FULLVenkatesh Duggirala2013-03-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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#11753923-SQL THREAD CRASHES ON DISK FULLVenkatesh Duggirala2013-01-021-0/+4
| | |\ | | | | | | | | Merging fix from mysql-5.1
| | | * BUG#11753923-SQL THREAD CRASHES ON DISK FULLVenkatesh Duggirala2013-01-021-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | 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.
| | * | Updated/added copyright headersKent Boortz2011-06-301-2/+2
| | |\ \ | | | |/
| | | * Updated/added copyright headersKent Boortz2011-06-301-2/+5
| | | |\
| | | | * Updated/added copyright headersKent Boortz2011-06-301-2/+3
| | | | |
| | * | | Remove configuration preprocessor symbols 'THREAD'Magne Mahre2011-01-111-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and 'THREAD_SAFE_CLIENT'. As of MySQL 5.5, we no longer support non-threaded builds. This patch removes all references to the obsolete THREAD and THREAD_SAFE_CLIENT preprocessor symbols. These were used to distinguish between threaded and non-threaded builds.
| | * | | This is the downport ofVladislav Vaintroub2009-09-111-17/+22
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug#24509 - 2048 file descriptor limit on windows needs increasing, also WL#3049 - improved Windows I/O The patch replaces the use of the POSIX I/O interfaces in mysys on Windows with the Win32 API calls (CreateFile, WriteFile, etc). The Windows HANDLE for the open file is stored in the my_file_info struct, along with a flag for append mode because the Windows API does not support opening files in append mode in all cases) The default max open files has been increased to 16384 and can be increased further by setting --max-open-files=<value> during the server start. Another major change in this patch that almost all Windows specific file IO code has been moved to a new file my_winfile.c, greatly reducing the amount of code in #ifdef blocks within mysys, thus improving readability. Minor enhancements: - my_(f)stat() is changed to use __stati64 structure with 64 file size and timestamps. It will return correct file size now (C runtime implementation used to report outdated information) - my_lock on Windows is prepared to handle additional timeout parameter - after review : changed __WIN__ to _WIN32 in the new and changed code.
| | * | Merge BUG#22082 from 5.0-bugteam to 5.1-bugteamHe Zhenxing2009-03-061-4/+2
| | |\ \ | | | |/
| | | * BUG#22082 Slave hangs(holds mutex) on "disk full"He Zhenxing2009-03-061-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When disk is full, server may waiting for free space while writing binlog, relay-log or MyISAM tables. The server will continue after user have freed some space. But the error message printed was not quite clear about the how often the error message is printed, and there will be a delay before the server continue and user freeing space. And caused users thinking that the server was hanging forever. This patch fixed the problem by making the error messages printed more clear. The error message is split into two part, the first part will only be printed once, and the second part will be printed very 10 times. Message first part: Disk is full writing '<filename>' (Errcode: <errorno>). Waiting for someone to free space... (Expect up to 60 secs delay for server to continue after freeing disk space) Message second part: Retry in 60 secs, Message reprinted in 600 secs
| | * | Merge polly.(none):/home/kaa/src/maint/mysql-5.0-maintkaa@polly.(none)2007-10-251-1/+1
| | |\ \ | | | |/ | | | | | | | | into polly.(none):/home/kaa/src/maint/mysql-5.1-maint
| | | * Replaced 'return' with DBUG_RETURN() in the fix for bug #31566.kaa@polly.(none)2007-10-251-1/+1
| | | |
| | * | Merge polly.(none):/home/kaa/src/maint/mysql-5.0-maintkaa@polly.(none)2007-10-241-0/+4
| | |\ \ | | | |/ | | | | | | | | into polly.(none):/home/kaa/src/maint/mysql-5.1-maint
| | | * Fix for bug #31566: my_write(fd, 0x0, 0, flags) fails with EFAULT onkaa@polly.(none)2007-10-241-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | some platforms Since the behavior of write(fd, buf, 0) is undefined, it may fail with EFAULT on some architectures when buf == NULL. The error was propagated up to a caller, since my_write() code did not handle it properly. Fixed by checking the 'number of bytes' argument in my_write() and returning before calling the write() system call when there is nothing to write.
| | * | WL#3817: Simplify string / memory area types and make things more consistent ↵monty@mysql.com/narttu.mysql.fi2007-05-101-13/+13
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (first part) The following type conversions was done: - Changed byte to uchar - Changed gptr to uchar* - Change my_string to char * - Change my_size_t to size_t - Change size_s to size_t Removed declaration of byte, gptr, my_string, my_size_t and size_s. Following function parameter changes was done: - All string functions in mysys/strings was changed to use size_t instead of uint for string lengths. - All read()/write() functions changed to use size_t (including vio). - All protocoll functions changed to use size_t instead of uint - Functions that used a pointer to a string length was changed to use size_t* - Changed malloc(), free() and related functions from using gptr to use void * as this requires fewer casts in the code and is more in line with how the standard functions work. - Added extra length argument to dirname_part() to return the length of the created string. - Changed (at least) following functions to take uchar* as argument: - db_dump() - my_net_write() - net_write_command() - net_store_data() - DBUG_DUMP() - decimal2bin() & bin2decimal() - Changed my_compress() and my_uncompress() to use size_t. Changed one argument to my_uncompress() from a pointer to a value as we only return one value (makes function easier to use). - Changed type of 'pack_data' argument to packfrm() to avoid casts. - Changed in readfrm() and writefrom(), ha_discover and handler::discover() the type for argument 'frmdata' to uchar** to avoid casts. - Changed most Field functions to use uchar* instead of char* (reduced a lot of casts). - Changed field->val_xxx(xxx, new_ptr) to take const pointers. Other changes: - Removed a lot of not needed casts - Added a few new cast required by other changes - Added some cast to my_multi_malloc() arguments for safety (as string lengths needs to be uint, not size_t). - Fixed all calls to hash-get-key functions to use size_t*. (Needed to be done explicitely as this conflict was often hided by casting the function to hash_get_key). - Changed some buffers to memory regions to uchar* to avoid casts. - Changed some string lengths from uint to size_t. - Changed field->ptr to be uchar* instead of char*. This allowed us to get rid of a lot of casts. - Some changes from true -> TRUE, false -> FALSE, unsigned char -> uchar - Include zlib.h in some files as we needed declaration of crc32() - Changed MY_FILE_ERROR to be (size_t) -1. - Changed many variables to hold the result of my_read() / my_write() to be size_t. This was needed to properly detect errors (which are returned as (size_t) -1). - Removed some very old VMS code - Changed packfrm()/unpackfrm() to not be depending on uint size (portability fix) - Removed windows specific code to restore cursor position as this causes slowdown on windows and we should not mix read() and pread() calls anyway as this is not thread safe. Updated function comment to reflect this. Changed function that depended on original behavior of my_pwrite() to itself restore the cursor position (one such case). - Added some missing checking of return value of malloc(). - Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid 'long' overflow. - Changed type of table_def::m_size from my_size_t to ulong to reflect that m_size is the number of elements in the array, not a string/memory length. - Moved THD::max_row_length() to table.cc (as it's not depending on THD). Inlined max_row_length_blob() into this function. - More function comments - Fixed some compiler warnings when compiled without partitions. - Removed setting of LEX_STRING() arguments in declaration (portability fix). - Some trivial indentation/variable name changes. - Some trivial code simplifications: - Replaced some calls to alloc_root + memcpy to use strmake_root()/strdup_root(). - Changed some calls from memdup() to strmake() (Safety fix) - Simpler loops in client-simple.c
| | * Many files:kent@mysql.com/kent-amd64.(none)2006-12-231-2/+1
| | | | | | | | | | | | Changed header to GPL version 2 only
| | * Remove compiler warningsmonty@mysql.com/nosik.monty.fi2006-11-201-1/+1
| | | | | | | | | | | | | | | | | | | | | (Mostly in DBUG_PRINT() and unused arguments) Fixed bug in query cache when used with traceing (--with-debug) Fixed memory leak in mysqldump Removed warnings from mysqltest scripts (replaced -- with #)
| | * Merge siva.hindu.god:/usr/home/tim/m/bk/tmp/40tsmith/tim@siva.hindu.god2006-09-141-7/+13
| | |\ | | | | | | | | | | | | into siva.hindu.god:/usr/home/tim/m/bk/tmp/41
| | | * Bug #4053: too many of "error 1236: 'binlog truncated in the middle of ↵tsmith/tim@siva.hindu.god2006-09-141-7/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | event' from master" - Fix my_read/my_write to handle return values from read/write correctly - Add debugging 'deprecated function' warning to my_lread/my_lwrite - Add debugging 'error, read/write interrupt not handled' warning to my_quick_read/my_quick_write There is no test case associated with these changes. However, this is a conservative change, and no repeatable test case is available.
| | * | Merge mysql.com:/home/mysql_src/mysql-4.0guilhem@mysql.com2005-01-061-2/+1
| | |\ \ | | | |/ | | | | | | | | into mysql.com:/home/mysql_src/mysql-4.1-clean
| | | * Fix for BUG#7714 "if disk full, sometimes MyISAM doesn't wait for free ↵guilhem@mysql.com2005-01-061-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | space, corrupts table" This happened only if my_write() couldn't write even one byte. I cannot easily add a .test for this, but I tested by hand before and after the change.
| | * | Merge with 4.0 for 4.1 releasemonty@mysql.com2004-10-061-2/+3
| | |\ \ | | | |/ | | | | | | | | | | | | | | | | | | | | Noteworthy: - New HANDLER code - New multi-update-grant-check code - Table lock code in ha_innodb.cc was not applied
| | | * Fix for BUG#3248 "Doc says MyISAM warns if disk full but it does not":guilhem@mysql.com2004-09-241-2/+3
| | | | | | | | | | | | | | | | | | | | we force the message to the error log, and we make it more informative; we treat EDQUOT like ENOSPC.
| | * | Changed %lx -> 0x%lx (for easier comparison of debug files)monty@mysql.com2004-08-231-1/+1
| | |/ | | | | | | | | | | | | Cosmetic cleanups Don't call 'delete_elements' on copy_funcs as this causes elements to be freed twice
| | * Update copyrightmonty@hundin.mysql.fi2001-12-061-15/+14
| | | | | | | | | | | | Fixed memory leak on shutdown (Affects the embedded version & MyODBC)
| | * OS2 patchmonty@hundin.mysql.fi2001-09-121-39/+0
| | |
| | * Fixes for OS2.monty@hundin.mysql.fi2001-08-221-0/+40
| | | | | | | | | | | | | | | Fix bug in isamlog Add argument types to function declarations.
| | * Fixed test when exeeding file quota on writemonty@donna.mysql.com2001-01-151-3/+14
| | | | | | | | | | | | Sanity checks when opening MyISAM files
| | * New benchmark testmonty@donna.mysql.com2000-12-241-1/+2
| | | | | | | | | | | | | | | | | | | | | Fixed bug in REPLACE with BDB tables Prepare for write lock on read for BDB Inform the handler when we want to use IGNORE / REPLACE New manual pages
| | * Import changesetbk@work.mysql.com2000-07-311-0/+77
| |
* | 5.5 mergeSergei Golubchik2013-06-061-1/+1
|\ \ | |/
| * mysql-5.5.31 mergeSergei Golubchik2013-05-071-1/+1
| |\
| | * BUG#11753923-SQL THREAD CRASHES ON DISK FULLVenkatesh Duggirala2013-03-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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#11753923-SQL THREAD CRASHES ON DISK FULLVenkatesh Duggirala2013-01-021-0/+4
| | |\ | | | | | | | | | | | | Merging fix from mysql-5.1
* | | \ 5.5 mergeSergei Golubchik2013-03-271-5/+11
|\ \ \ \ | |/ / /
| * | | 5.3->5.5 mergeSergei Golubchik2013-02-281-5/+11
| |\ \ \
| | * \ \ 5.2 -> 5.3Sergei Golubchik2013-02-281-1/+1
| | |\ \ \
| | | * \ \ 5.1 -> 5.2 mergeSergei Golubchik2013-02-281-1/+1
| | | |\ \ \
| | | | * \ \ mysql-5.1 mergeSergei Golubchik2013-02-281-1/+1
| | | | |\ \ \ | | | | | | |/ | | | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.