mariadb/mysys
Sujatha Sivakumar cf858b71ce BUG#11762670:MY_B_WRITE RETURN VALUE IGNORED
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.
2012-07-10 14:23:17 +05:30
..
.cvsignore
array.c Updated/added copyright headers 2011-06-30 17:37:13 +02:00
base64.c Updated/added copyright headers 2011-06-30 17:37:13 +02:00
ChangeLog
charset-def.c Updated/added copyright headers 2012-02-15 17:21:38 +01:00
charset.c Updated/added copyright headers 2011-06-30 17:37:13 +02:00
checksum.c Bug#29125 Windows Server X64: so many compiler warnings 2009-02-13 11:41:47 -05:00
CMakeLists.txt Updated/added copyright headers 2011-07-03 17:47:37 +02:00
default.c Updated/added copyright headers 2011-06-30 17:37:13 +02:00
default_modify.c Bug#29125 Windows Server X64: so many compiler warnings 2009-02-13 11:41:47 -05:00
errors.c Updated/added copyright headers 2011-06-30 17:37:13 +02:00
hash.c Updated/added copyright headers 2011-06-30 17:37:13 +02:00
list.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
make-ccc Remove unused (and incorrect) my_lread() and my_lwrite() 2006-09-14 23:29:44 -06:00
make-conf.c Many files: 2006-12-23 20:17:15 +01:00
Makefile.am Updated/added copyright headers 2011-07-03 17:47:37 +02:00
md5.c Bug #42434: license of mysys MD5 implementation is not GPL-compatible 2009-03-09 20:57:03 +02:00
mf_arr_appstr.c Bug #20748: Configuration files should not be read more than once 2007-11-07 15:23:50 -07:00
mf_brkhant.c Many files: 2006-12-23 20:17:15 +01:00
mf_cache.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
mf_dirname.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
mf_fn_ext.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
mf_format.c Updated/added copyright headers 2011-06-30 17:37:13 +02:00
mf_getdate.c Updated/added copyright headers 2011-06-30 17:37:13 +02:00
mf_iocache.c Updated/added copyright headers 2011-06-30 17:37:13 +02:00
mf_iocache2.c BUG#11762670:MY_B_WRITE RETURN VALUE IGNORED 2012-07-10 14:23:17 +05:30
mf_keycache.c Updated/added copyright headers 2011-06-30 17:37:13 +02:00
mf_keycaches.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
mf_loadpath.c Updated/added copyright headers 2011-06-30 17:37:13 +02:00
mf_pack.c Updated/added copyright headers 2011-06-30 17:31:31 +02:00
mf_path.c Slow query log to file now displays queries with microsecond precission 2007-07-30 11:33:50 +03:00
mf_qsort.c Fix for bug #31207: Test "join_nested" shows different strategy on IA64 2007-10-17 20:08:58 +04:00
mf_qsort2.c Many files: 2006-12-23 20:17:15 +01:00
mf_radix.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
mf_same.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
mf_sort.c Merge polly.(none):/home/kaa/src/maint/mysql-5.0-maint 2007-10-18 14:32:43 +04:00
mf_soundex.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
mf_tempdir.c Updated/added copyright headers 2011-06-30 17:37:13 +02:00
mf_tempfile.c Moved a lot of old bug fixes and safe cleanups from Maria 5.1 tree to 5.1 2007-10-11 18:07:40 +03:00
mf_unixpath.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
mf_util.c Many files: 2006-12-23 20:17:15 +01:00
mf_wcomp.c Many files: 2006-12-23 20:17:15 +01:00
mf_wfile.c Updated/added copyright headers 2011-06-30 17:37:13 +02:00
mulalloc.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_access.c Bug #13889741: HANDLE_FATAL_SIGNAL IN _DB_ENTER_ | 2012-07-05 13:41:16 +03:00
my_aes.c my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
my_alarm.c Many files: 2006-12-23 20:17:15 +01:00
my_alloc.c Updated/added copyright headers 2011-06-30 17:37:13 +02:00
my_append.c Bug#29125 Windows Server X64: so many compiler warnings 2009-02-13 11:41:47 -05:00
my_bit.c Moved a lot of old bug fixes and safe cleanups from Maria 5.1 tree to 5.1 2007-10-11 18:07:40 +03:00
my_bitmap.c Updated/added copyright headers 2011-07-03 17:47:37 +02:00
my_chsize.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_clock.c Merge mysql.com:/home/kent/bk/main/mysql-5.0 2006-12-23 20:20:40 +01:00
my_compare.c Updated/added copyright headers 2012-02-15 17:13:47 +01:00
my_compress.c Bug#29125 Windows Server X64: so many compiler warnings 2009-02-13 11:41:47 -05:00
my_conio.c Bug#29125 Windows Server X64: so many compiler warnings 2009-02-13 11:41:47 -05:00
my_copy.c Updated/added copyright headers 2011-06-30 17:37:13 +02:00
my_crc32.c Many files: 2006-12-23 20:17:15 +01:00
my_create.c Merge a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-main 2008-03-13 23:35:52 +02:00
my_delete.c Merge a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-main 2007-12-07 22:27:48 +02:00
my_div.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_dup.c Fixed compiler warnings. 2007-03-22 20:32:07 +02:00
my_error.c Updated/added copyright headers 2011-06-30 17:37:13 +02:00
my_file.c Updated/added copyright headers 2011-06-30 17:37:13 +02:00
my_fopen.c Updating header copyright/README in source for 2011 2011-01-25 15:42:40 +01:00
my_fstream.c Updated/added copyright headers 2011-06-30 17:37:13 +02:00
my_gethwaddr.c Updated/added copyright headers 2011-06-30 17:37:13 +02:00
my_getncpus.c Updated/added copyright headers 2011-06-30 17:37:13 +02:00
my_getopt.c Updated/added copyright headers 2011-06-30 17:37:13 +02:00
my_getpagesize.c Many files: 2006-12-23 20:17:15 +01:00
my_getsystime.c Updating header copyright/README in source for 2011 2011-01-25 15:42:40 +01:00
my_getwd.c Updated/added copyright headers 2011-06-30 17:37:13 +02:00
my_handler_errors.h Bug#13635833: MULTIPLE CRASHES IN FOREIGN KEY CODE WITH CONCURRENT DDL/DML 2012-03-01 11:05:51 +05:30
my_init.c Updated/added copyright headers 2012-02-15 17:13:47 +01:00
my_largepage.c Updated/added copyright headers 2011-06-30 17:37:13 +02:00
my_lib.c - Added/updated copyright headers 2010-12-28 19:57:23 +01:00
my_libwrap.c Many files: 2006-12-23 20:17:15 +01:00
my_lock.c Merge mysql.com:/home/kent/bk/main/mysql-5.0 2006-12-23 20:20:40 +01:00
my_lockmem.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_malloc.c Updated/added copyright headers 2011-06-30 17:37:13 +02:00
my_memmem.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_messnc.c Many files: 2006-12-23 20:17:15 +01:00
my_mkdir.c Merge mysql.com:/home/kent/bk/main/mysql-5.0 2006-12-23 20:20:40 +01:00
my_mmap.c Merge mysql.com:/home/kent/bk/main/mysql-5.0 2006-12-23 20:20:40 +01:00
my_net.c Updated/added copyright headers 2011-07-03 17:47:37 +02:00
my_netware.c Many files: 2006-12-23 20:17:15 +01:00
my_new.cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
my_once.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_open.c Moved a lot of old bug fixes and safe cleanups from Maria 5.1 tree to 5.1 2007-10-11 18:07:40 +03:00
my_pread.c Updated/added copyright headers 2011-06-30 17:37:13 +02:00
my_pthread.c my_pthread.c: 2007-07-30 20:40:49 +02:00
my_quick.c Bug#29125 Windows Server X64: so many compiler warnings 2009-02-13 11:41:47 -05:00
my_read.c Bug#29125 Windows Server X64: so many compiler warnings 2009-02-13 11:41:47 -05:00
my_realloc.c Moved a lot of old bug fixes and safe cleanups from Maria 5.1 tree to 5.1 2007-10-11 18:07:40 +03:00
my_redel.c Updated/added copyright headers 2011-06-30 17:37:13 +02:00
my_rename.c Moved a lot of old bug fixes and safe cleanups from Maria 5.1 tree to 5.1 2007-10-11 18:07:40 +03:00
my_seek.c Updated/added copyright headers 2011-06-30 17:37:13 +02:00
my_sleep.c Merge mysql.com:/home/kent/bk/main/mysql-5.0 2006-12-23 20:20:40 +01:00
my_static.c Updated/added copyright headers 2011-06-30 17:37:13 +02:00
my_static.h Bug#35616: memory overrun on 64-bit linux on setting large values for keybuffer-size 2008-08-19 15:56:41 +02:00
my_symlink.c Updated/added copyright headers 2012-02-15 17:21:38 +01:00
my_symlink2.c Merge mysql.com:/home/svoj/devel/mysql/BUG32111/mysql-5.0-engines 2007-11-12 15:26:37 +04:00
my_sync.c Updated/added copyright headers 2011-06-30 17:37:13 +02:00
my_thr_init.c Updated/added copyright headers 2011-06-30 17:37:13 +02:00
my_vle.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_wincond.c Updated/added copyright headers 2011-06-30 17:37:13 +02:00
my_windac.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
my_winthread.c Updated/added copyright headers 2011-06-30 17:37:13 +02:00
my_write.c Bug#11762667: MYSQLBINLOG IGNORES ERRORS WHILE WRITING OUTPUT 2012-05-29 12:11:30 +05:30
mysys_priv.h Slow query log to file now displays queries with microsecond precission 2007-07-30 11:33:50 +03:00
ptr_cmp.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
queues.c Fix for server bug experienced in Maria (wrong "Truncated incorrect <var_name> 2008-02-18 23:29:39 +01:00
rijndael.c my_strtoll10-x86.s: 2006-12-31 01:02:27 +01:00
safemalloc.c Updated/added copyright headers 2011-06-30 17:37:13 +02:00
sha1.c Bug #56427 : Replace copyright notice removed from SHA1 code 2010-10-05 17:03:04 +03:00
stacktrace.c Bug#11761576 54082: HANDLE_SEGFAULT MAKES USE OF UNSAFE FUNCTIONS 2012-03-06 13:30:30 +01:00
string.c Updated/added copyright headers 2011-06-30 17:37:13 +02:00
test_charset.c Fix doxygen warnings. 2007-08-15 17:43:08 +04:00
test_dir.c Merge mysql.com:/home/kent/bk/main/mysql-5.0 2006-12-23 20:20:40 +01:00
test_fn.c Many files: 2006-12-23 20:17:15 +01:00
test_xml.c Many files: 2006-12-23 20:17:15 +01:00
testhash.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
thr_alarm.c Updated/added copyright headers 2011-06-30 17:37:13 +02:00
thr_lock.c Updated/added copyright headers 2011-06-30 17:37:13 +02:00
thr_mutex.c Updated/added copyright headers 2011-06-30 17:37:13 +02:00
thr_rwlock.c Many files: 2006-12-23 20:17:15 +01:00
tree.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
trie.c WL#3817: Simplify string / memory area types and make things more consistent (first part) 2007-05-10 12:59:39 +03:00
typelib.c Updated/added copyright headers 2011-06-30 17:37:13 +02:00