Commit graph

79 commits

Author SHA1 Message Date
Davi Arnaut
26f561d5d0 Bug#33899: Deadlock in mysql_real_query with shared memory connections
The problem is that the read and write methods of the shared
memory transport (protocol) didn't react to asynchornous close
events, which could lead to a lock up as the client would wait
(until time out) for a server response that will never come.

The solution is to also wait for close events while waiting
for I/O from or to the server.

Bug report and patch submitted by: Armin Schöffmann
2009-03-26 20:25:10 -03:00
Davi Arnaut
bfa198c2e7 Bug#33899: Deadlock in mysql_real_query with shared memory connections
The problem is that the read and write methods of the shared
memory transport (protocol) didn't react to asynchronous close
events, which could lead to a lock up as the client would wait
(until time out) for a server response that will never come.

The solution is to also wait for close events while waiting
for I/O from or to the server.
2009-03-26 20:17:27 -03:00
Ignacio Galarza
2b85c64d65 Bug#29125 Windows Server X64: so many compiler warnings
- Remove bothersome warning messages.  This change focuses on the warnings 
that are covered by the ignore file: support-files/compiler_warnings.supp.
- Strings are guaranteed to be max uint in length
2009-02-10 17:47:54 -05:00
monty@mysql.com/nosik.monty.fi
e53a73e26c Fixed a lot of compiler warnings and errors detected by Forte C++ on Solaris
Faster thr_alarm()
Added 'Opened_files' status variable to track calls to my_open()
Don't give warnings when running mysql_install_db
Added option --source-install to mysql_install_db

I had to do the following renames() as used polymorphism didn't work with Forte compiler on 64 bit systems
index_read()      -> index_read_map()
index_read_idx()  -> index_read_idx_map()
index_read_last() -> index_read_last_map()
2007-08-13 16:11:25 +03:00
tsmith@quadxeon.mysql.com
4b93804592 Merge quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/51
into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/jun05/51
2007-06-05 17:51:30 +02:00
msvensson@pilot.blaudden
5d22eb6552 Merge pilot.blaudden:/home/msvensson/mysql/bug26664/my50-bug26664
into  pilot.blaudden:/home/msvensson/mysql/bug26664/my51-bug26664
2007-05-24 20:43:12 +02:00
msvensson@pilot.blaudden
93b1fe65d8 Bug#26664 test suite times out on OS X 64bit
- The "mysql client in mysqld"(which is used by
   replication and federated) should use alarms instead of setting
   socket timeout value if the rest of the server uses alarm. By
   always calling 'my_net_set_write_timeout'
   or 'my_net_set_read_timeout' when changing the timeout value(s), the
   selection whether to use alarms or timeouts will be handled by
   ifdef's in those two functions. 
 - Move declaration of 'vio_timeout' into "vio_priv.h"
2007-05-24 11:21:27 +02:00
monty@mysql.com/narttu.mysql.fi
088e2395f1 WL#3817: Simplify string / memory area types and make things more consistent (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
2007-05-10 12:59:39 +03:00
kent@kent-amd64.(none)
be15e3bc15 Merge mysql.com:/home/kent/bk/main/mysql-5.0
into  mysql.com:/home/kent/bk/main/mysql-5.1
2006-12-23 20:20:40 +01:00
kent@mysql.com/kent-amd64.(none)
226a5c833f Many files:
Changed header to GPL version 2 only
2006-12-23 20:17:15 +01:00
monty@mysql.com/nosik.monty.fi
e825879800 Remove compiler warnings
(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 #)
2006-11-20 22:42:06 +02:00
cmiller@zippy.cornsilk.net
87ba07e832 Merge bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  zippy.cornsilk.net:/home/cmiller/work/mysql/bug14262/my50-bug14262
2006-10-13 08:57:15 -04:00
cmiller@zippy.cornsilk.net
cd71add6f2 The behavior of "%p" varies. We prefer "0x%lx". 2006-10-03 13:40:55 -04:00
msvensson@shellback.(none)
cebd7d9d67 Merge shellback.(none):/home/msvensson/mysql/work/my50-work
into  shellback.(none):/home/msvensson/mysql/mysql-5.0-maint
2006-09-15 14:31:25 +02:00
msvensson@shellback.(none)
2b79a6bc36 Merge shellback.(none):/home/msvensson/mysql/work/my50-work
into  shellback.(none):/home/msvensson/mysql/work/my51-work
2006-09-15 14:28:25 +02:00
msvensson@shellback.(none)
c4177ec484 Use the enum/define SHUT_RDWR instead of heardcoded "2" to shutdown 2006-09-15 14:27:45 +02:00
cmiller@zippy.cornsilk.net
8a5f986c5a Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0--windows-vio-uninit
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-maint
2006-09-13 09:40:07 -04:00
cmiller@zippy.cornsilk.net
a724e20c74 Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0--windows-vio-uninit
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maint
2006-09-13 09:37:38 -04:00
cmiller@zippy.cornsilk.net
c02308a729 Fix initialized memory. Count the number of failures in shm-closing
functions and return it.
2006-09-08 11:39:03 -04:00
cmiller@zippy.cornsilk.net
7ca1a49437 Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maint
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-maint
2006-09-05 16:46:55 -04:00
tsmith@maint2.mysql.com
e2f40aa6d0 Merge maint2.mysql.com:/data/localhome/tsmith/bk/41
into  maint2.mysql.com:/data/localhome/tsmith/bk/50
2006-09-01 08:53:56 +02:00
kroki/tomash@moonlight.intranet
c746c08af9 BUG#9678: Client library hangs after network communication failure
Socket timeouts in client library were used only on Windows.

The solution is to use socket timeouts in client library on all
systems were they are supported.

No test case is provided because it is impossible to simulate network
failure in current test suit.
2006-08-14 20:01:19 +04:00
jani@ua141d10.elisa.omakaista.fi
04441d04b1 Merge from 5.0 to 5.1. Third part with fixes. 2006-05-31 14:55:28 +03:00
brian@zim.(none)
5d1d27c016 Final patch to remove the last of the OS2 support. 2006-04-15 18:17:32 -07:00
cmiller@calliope.local
34638c283a No longer leak file descriptors in mysql_close. Fixes Bug#15846. 2006-03-17 18:46:34 +01:00
jani@ua141d10.elisa.omakaista.fi
2dd1e4f94e Merge ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-4.1-tmp
into  ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.0
2005-10-13 18:23:53 +03:00
jimw@mysql.com
c8a6c2c614 Fix wait_timeout (and kill) handling on Mac OS X by cleaning up how
signal handlers are set up, the blocking flags for sockets are set,
and which thread-related functions are used. (Bug #8731)
2005-10-11 09:12:12 -07:00
evgen@moonbone.local
7e733a889e Merge moonbone.local:/work/12887-bug-4.1-mysql
into moonbone.local:/work/12887-bug-5.0-mysql
2005-09-15 22:54:59 +04:00
jimw@mysql.com
af4d71f734 Merge mysql.com:/home/jimw/my/mysql-4.1-12723
into  mysql.com:/home/jimw/my/mysql-4.1-clean
2005-09-15 10:00:25 -07:00
jimw@mysql.com
a60ed0b75d Merge mysql.com:/home/jimw/my/mysql-4.1-clean
into  mysql.com:/home/jimw/my/mysql-5.0-clean
2005-09-12 17:00:50 -07:00
SergeyV@selena.
33c3fedadc Fixes bug #5588. Additions after merge from 4.0. 2005-09-07 15:57:14 +04:00
SergeyV@selena.
784582b857 Merge selena.:H:/MYSQL/src/#05588-mysql-4.0
into  selena.:H:/MYSQL/src/#05588-mysql-4.1
2005-09-07 14:59:41 +04:00
jimw@mysql.com
89decf6aa9 Fix shared memory connection handling on Windows. (Bug #12723) 2005-08-31 15:04:25 -07:00
SergeyV@selena.
e82e15b051 Fixes bug #5588. vio_was_interrupted() function was added to detect
read timeout properly on win32.
2005-08-30 19:19:28 +04:00
lars@mysql.com
6db2602ad0 Merge mysql.com:/home/bkroot/mysql-4.1
into  mysql.com:/home/bk/mysql-5.0
2005-07-13 02:13:04 +02:00
reggie@linux.site
c31d71c065 Fixed some vio code that was using ___WIN__ instead of __WIN__ 2005-07-12 10:31:09 -06:00
jimw@mysql.com
99e35c84ac Merge mysql.com:/home/jimw/my/mysql-4.1-clean
into  mysql.com:/home/jimw/my/mysql-5.0-clean
2005-06-20 15:02:45 -07:00
jimw@mysql.com
6b1a9f64bb Fix Windows build warning and file missing from projects. 2005-06-08 01:25:06 +02:00
rburnett@bk-internal.mysql.com
ad6de2c05a Merge bk-internal.mysql.com:/users/rburnett/bug9721
into bk-internal.mysql.com:/users/rburnett/mysql-5.0
2005-05-06 15:15:48 +02:00
rburnett@bk-internal.mysql.com
e4523c2319 Bug #9721 net_write_timeout not used on Windows
viosocket.c:
  Use ?: syntax to simplify code for setting both timeouts
2005-05-06 15:08:10 +02:00
rburnett@bk-internal.mysql.com
e7d7c0f236 Bug #9721 net_write_timeout not used on Windows
Added an extra parameter to all calls to timeout().  
1 means we want to set the write timeout
0 means we wnat to set the read timeout

viossl.c:
  Add which parameter to ssl timeout routine
vio_priv.h:
  Added which parameter to vio_ignore_timeout and vio_ssl_timeout
violite.h:
  Add which parameter to vio_timeout sigs
net_serv.cc:
  Use proper which code in call to vio_timeout to set the proper timeout
viosocket.c:
  Set the appropriate timeout in vio_timeout
2005-05-05 17:17:57 +02:00
konstantin@mysql.com
0f1d024461 Porting of "buffered read" patch to 5.0 and post-review fixes.
The patch implements the idea suggested by Olaf van der Spek in 
thread "Client: many small reads?" (internals@lists.mysql.com).
Now small reads performed by the client library are buffered.
The buffering gives up to 2 times speedup when retrieving 
one-column tables.
2005-03-06 00:10:08 +03:00
monty@mysql.com
38d1a42481 Merge with 4.1 2005-02-15 17:12:13 +02:00
monty@mysql.com
44ceb84cdc Merge with 4.0 2005-02-15 14:49:52 +02:00
monty@mysql.com
788a2658a3 Better bug fix for #5569: "Incorrect "Access Denied" error with SAME login DIFFERENT host"
This fixes also the reverse lookup bug introduced by the previous patch
2005-02-15 14:42:13 +02:00
monty@mysql.com
422c2eb868 4.1 -> 5.0 merge 2005-02-03 13:18:30 +02:00
jimw@mysql.com
5f0c4ff140 Merge fixes for #8248, #5569. 2005-02-02 08:21:11 -08:00
jimw@mysql.com
94da57dc65 Always call vio_in_addr() so that thd->remote is
always initialized. (Bug #5569)
2005-01-25 12:06:55 -08:00
konstantin@mysql.com
013a6f50c2 Merge mysql.com:/home/kostja/work/mysql-4.1-5787
into mysql.com:/home/kostja/work/mysql-5.0-root
2005-01-25 02:54:17 +03:00
konstantin@mysql.com
4a7fd21f12 A fix for Bug#5787 "mysql_stmt_prepare is upto 8 times slower":
it's crucial to disable Nagle algorithm on client for no-reply commands
(like mysql_stmt_free) to always work fast.
Nagle algorithm instructs the sender to buffer (store) data if any 
unacknowledged data is outstanding and the size of to-send data is less than
the network segment. It was exactly the case with COM_STMT_CLOSE after 
COM_STMT_PREPARE, so the client was waiting for Nagle timer to expire or
 for ACK from the server, while the server was holding up ACK because of 
delayed acknowledgement algorithm.
The tricky part is that we have been already disabling Nagle 
algorithm (by setting TCP_NODELAY)
almost everywhere except Windows (and maybe Netware).
It is the reason why the bug was repeatable only with Windows client.
2005-01-25 02:31:51 +03:00