Commit graph

200 commits

Author SHA1 Message Date
Davi Arnaut
b9380f0e76 Bug#48983: Bad strmake calls (length one too long)
The problem is a somewhat common misusage of the strmake function.
The strmake(dst, src, len) function writes at most /len/ bytes to
the string pointed to by src, not including the trailing null byte.
Hence, if /len/ is the exact length of the destination buffer, a
one byte buffer overflow can occur if the length of the source
string is equal to or greater than /len/.
2009-12-17 15:58:38 -02:00
Davi Arnaut
97dbd987f0 Bug#46013: rpl_extraColmaster_myisam fails on pb2
Bug#45243: crash on win in sql thread clear_tables_to_lock() -> free()
Bug#45242: crash on win in mysql_close() -> free()
Bug#45238: rpl_slave_skip, rpl_change_master failed (lost connection) for STOP SLAVE
Bug#46030: rpl_truncate_3innodb causes server crash on windows
Bug#46014: rpl_stm_reset_slave crashes the server sporadically in pb2

When killing a user session on the server, it's necessary to
interrupt (notify) the thread associated with the session that
the connection is being killed so that the thread is woken up
if waiting for I/O. On a few platforms (Mac, Windows and HP-UX)
where the SIGNAL_WITH_VIO_CLOSE flag is defined, this interruption
procedure is to asynchronously close the underlying socket of
the connection.

In order to enable this schema, each connection serving thread
registers its VIO (I/O interface) so that other threads can
access it and close the connection. But only the owner thread of
the VIO might delete it as to guarantee that other threads won't
see freed memory (the thread unregisters the VIO before deleting
it). A side note: closing the socket introduces a harmless race
that might cause a thread attempt to read from a closed socket,
but this is deemed acceptable.

The problem is that this infrastructure was meant to only be used
by server threads, but the slave I/O thread was registering the
VIO of a mysql handle (a client API structure that represents a
connection to another server instance) as a active connection of
the thread. But under some circumstances such as network failures,
the client API might destroy the VIO associated with a handle at
will, yet the VIO wouldn't be properly unregistered. This could
lead to accesses to freed data if a thread attempted to kill a
slave I/O thread whose connection was already broken.

There was a attempt to work around this by checking whether
the socket was being interrupted, but this hack didn't work as
intended due to the aforementioned race -- attempting to read
from the socket would yield a "bad file descriptor" error.

The solution is to add a hook to the client API that is called
from the client code before the VIO of a handle is deleted.
This hook allows the slave I/O thread to detach the active vio
so it does not point to freed memory.
2009-08-13 17:07:20 -03:00
Staale Smedseng
19dfaa5824 Merge from 5.0-bt 2009-06-29 15:17:01 +02:00
Alexey Botchkov
8dafd2b95d merging 2009-04-28 14:48:54 +05: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
Alexey Botchkov
52989c445f Bug#25058 ignored return codes in memory allocation functions
memory allocation error checks added for functions
   calling insert_dynamic()

per-file messages:
  myisam/mi_delete.c
Bug#25058 ignored return codes in memory allocation functions
    out-of-memory errors handled
  myisam/mi_write.c
Bug#25058 ignored return codes in memory allocation functions
    out-of-memory errors handled
  server-tools/instance-manager/instance_options.cc
Bug#25058 ignored return codes in memory allocation functions
    out-of-memory errors handled
  sql/slave.cc
Bug#25058 ignored return codes in memory allocation functions
    out-of-memory errors handled
  sql/sp_head.cc
Bug#25058 ignored return codes in memory allocation functions
    out-of-memory errors handled
  sql/sp_head.h
Bug#25058 ignored return codes in memory allocation functions
    out-of-memory errors handled
  sql/sp_pcontext.cc
Bug#25058 ignored return codes in memory allocation functions
    out-of-memory errors handled
  sql/sp_pcontext.h
Bug#25058 ignored return codes in memory allocation functions
    out-of-memory errors handled
  sql/sql_select.cc
Bug#25058 ignored return codes in memory allocation functions
    out-of-memory errors handled
  sql/sql_yacc.yy
Bug#25058 ignored return codes in memory allocation functions
    out-of-memory errors handled
2008-11-21 17:38:42 +04:00
Vladislav Vaintroub
8b9d3a4ea1 Bug #33907 : Errors compiling mysql with Microsoft Visual C++ Express 2008
- Cherry pick 6.0 changes for Visual Studio 2008 support
- Add scripts  win\build-vs9.bat and win\build-vs9_x64.bat

Also, remove CMake generated visual studio project files.
2008-08-21 19:11:17 +02:00
tnurnberg@sin.intern.azundris.com
7451aaf48c Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  mysql.com:/home/tnurnberg/15327/50-15327
2007-09-15 04:45:20 +02:00
tnurnberg@mysql.com/sin.intern.azundris.com
3c6ca8d6ed Bug #15327: configure: --with-tcp-port option being partially ignored
make sure that if builder configured with a non-standard (!= 3306)
default TCP port that value actually gets used throughout. if they
didn't configure a value, assume "use a sensible default", which
will be read from /etc/services or, failing that, from the factory
default. That makes the order of preference
- command-line option
- my.cnf, where applicable
- $MYSQL_TCP_PORT environment variable
- /etc/services (unless configured --with-tcp-port)
- default port (--with-tcp-port=... or factory default)
2007-09-13 16:19:46 +02:00
kent@mysql.com/kent-amd64.(none)
a6d082f36d CMakeLists.txt, README, configure.js
Several adjustments to make client libraries pass the link test
  on both win32 and winx64, Visual Studio 2003 and 2005 (bug#30118)
2007-08-03 21:51:37 +02:00
kent/mysqldev@mysql.com/production.mysql.com
2418b85046 configure.in:
Added --with-system-type=<systype> and --with-machine-type=<machtype>
  options, to be able to override the one detected, for --version strings
field.cc, field.h, listener.cc:
  C++ compatibility change for IBM VisualAge 6 and i5/OS
2007-06-20 14:00:28 +02:00
msvensson@pilot.blaudden
374de2c7cb Merge pilot.blaudden:/home/msvensson/mysql/bug26664/my50-bug26664
into  pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint
2007-05-24 20:51:37 +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
iggy@recycle.(none)
7a358c4b5c Bug#24732 Executables do not include Vista manifests
- Added script to generate application specific manifest.
- Added new CMake MACRO to add customer build events which will first
generate a manifest and then embeds that manifest into an executable.
2007-04-23 15:41:24 -04:00
kent@mysql.com/kent-amd64.(none)
19a6a09126 Many files:
Major cleanup of old Visual Studio project files, aligning engines etc
2007-03-19 16:18:10 +01:00
malff/marcsql@weblab.(none)
df5c5aea23 Merge weblab.(none):/home/marcsql/TREE/mysql-5.0-base
into  weblab.(none):/home/marcsql/TREE/mysql-5.0-rt-merge
2007-03-01 14:06:57 -07:00
anozdrin/alik@booka.opbmk
03fa3e5aaf Fix for BUG#22511: IM does not remove angel-pid-file on clean shutdown 2007-02-24 13:18:09 +03:00
anozdrin/alik@booka.opbmk
77079d385d Fix shutdown delay option name according to The Manual. 2007-02-24 13:10:04 +03:00
monty@mysql.com/narttu.mysql.fi
e5cc397f33 Fixed compiler warnings (for linux and win32 and win64)
Fixed a couple of usage of not initialized warnings (unlikely cases)
2007-02-22 16:59:57 +02:00
anozdrin/alik@alik.opbmk
76f813a52e Fix for BUG#24415: Instance manager test im_daemon_life_cycle fails randomly.
The cause of im_daemon_life_cycle.imtest random failures was the following
behaviour of some implementations of LINUX threads: let's suppose that a
process has several threads (in LINUX threads, there is a separate process for
each thread). When the main process gets killed, the parent receives SIGCHLD
before all threads (child processes) die. In other words, the parent receives
SIGCHLD, when its child is not completely dead.

In terms of IM, that means that IM-angel receives SIGCHLD when IM-main is not dead
and still holds some resources. After receiving SIGCHLD, IM-angel restarts
IM-main, but IM-main failed to initialize, because previous instance (copy) of
IM-main still holds server socket (TCP-port).

Another problem here was that IM-angel restarted IM-main only if it was killed
by signal. If it exited with error, IM-angel thought it's intended / graceful
shutdown and exited itself.

So, when the second instance of IM-main failed to initialize, IM-angel thought
it's intended shutdown and quit.

The fix is
  1. to change IM-angel so that it restarts IM-main if it exited with error code;
  2. to change IM-main so that it returns proper exit code in case of failure.
2007-02-20 22:31:50 +03:00
monty@mysql.com/narttu.mysql.fi
a04157fbb3 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/my/mysql-5.0
2007-01-22 14:04:40 +02:00
msvensson@pilot.mysql.com
51292deb36 Merge pilot.mysql.com:/home/msvensson/mysql/mysql-5.0
into  pilot.mysql.com:/home/msvensson/mysql/mysql-5.0-maint
2007-01-17 11:53:00 +01:00
kostja@bodhi.local
bf1005a125 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  bodhi.local:/opt/local/work/mysql-5.0-runtime
2007-01-11 21:59:28 +03:00
cmiller@zippy.cornsilk.net
896e2623eb Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maint
2007-01-11 09:43:44 -05:00
kent@mysql.com/kent-amd64.(none)
6523aca729 my_strtoll10-x86.s:
Corrected spelling in copyright text
Makefile.am:
  Don't update the files from BitKeeper
Many files:
  Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
  Adjusted year(s) in copyright header 
Many files:
  Added GPL copyright text
Removed files:
  Docs/Support/colspec-fix.pl
  Docs/Support/docbook-fixup.pl
  Docs/Support/docbook-prefix.pl
  Docs/Support/docbook-split
  Docs/Support/make-docbook
  Docs/Support/make-makefile
  Docs/Support/test-make-manual
  Docs/Support/test-make-manual-de
  Docs/Support/xwf
2006-12-31 01:02:27 +01:00
tsmith/tim@siva.hindu.god
682596d7ce Merge siva.hindu.god:/usr/home/tim/m/bk/g50
into  siva.hindu.god:/usr/home/tim/m/bk/50
2006-12-26 22:28:28 -07: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/narttu.mysql.fi
88dd873de0 Fixed compiler warnings detected by option -Wshadow and -Wunused:
- Removed not used variables and functions
- Added #ifdef around code that is not used
- Renamed variables and functions to avoid conflicts
- Removed some not used arguments

Fixed some class/struct warnings in ndb
Added define IS_LONGDATA() to simplify code in libmysql.c

I did run gcov on the changes and added 'purecov' comments on almost all lines that was not just variable name changes
2006-12-15 00:51:37 +02:00
msvensson@shellback.
c41e307d85 BUG#24687 func_misc test fails on win64
- Use same precision (milliseconds) for all time functions
   used  when calculating time for pthread_cond_timedwait
 - Use 'GetSystemTimeAsFileTime' for both start and curr time
2006-12-14 15:23:44 +01:00
petr/cps@outpost.site
2bc1898bc6 Fix Bug #19044 IM aborts on exit
On windows IM aborted on assert once one
stoppped it. The reason is that we didn't
close the sockets on windows and therefore,
the listener thread wasn't able to finish.
This happened because we used close() call
for it. While on windows one should use
closesocket().
On other platfroms we have appropriate defines
for closesocket(), so this is the function which
should be used.
2006-12-04 19:48:49 +03:00
monty@mysql.com/narttu.mysql.fi
601e6f4b2a Fixed compiler warnings
Don't assert if my_thread_end() is called twice (common case)
2006-11-30 21:56:03 +02: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
anozdrin/alik@alik.
643606cac9 Instance Manager polishing. 2006-10-20 22:26:40 +04:00
petr/cps@mysql.com/owlet.local
96c6f6f5c2 Fix Bug #19368 Failure in "flush_instances" causes assert in Thread_registry
Stop guardian and all the rest of threads before shutdown in case of an error
2006-10-05 22:07:21 +04:00
petr/cps@mysql.com/owlet.local
2073e4a1cb Fix Bug #22472 IM: --socket option should be removed from Windows version
the option is useless on windows. It was removed from listing of
mysqlmanager --help on Windows
2006-10-05 01:24:53 +04:00
msvensson@neptunus.(none)
f3c7b029d7 Merge neptunus.(none):/home/msvensson/mysql/bug22379_runtime/my50-bug22379_runtime
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0-runtime
2006-09-26 15:44:52 +02:00
msvensson@neptunus.(none)
d2ebe6be03 Bug #22379 im_daemon_life_cycle.test fails on merge of 5.1 -> 5.1-engines
Remove race situations that occur when removing pidfiles. Primarily each process should remove its own
pidfile, secondly it should be removed by the process that created it and _only_ if it's
certain the process is dead. Third, mysql-test-run.pl will remove the pidfile when process has been killed.
- Set state of an instance to STARTING _before_ calling instance->start()
- Check that pidfile of instance has been created before changing STARTING => STARTED
- Only remove the pidfile if IM kills an instance with SIGKILL, otherwise the instance will remove it itself
2006-09-25 09:28:52 +02:00
anozdrin/alik@alik.
6b6ba582e2 Merge alik.:/mnt/raid/alik/MySQL/devel/5.0-tree
into  alik.:/mnt/raid/alik/MySQL/devel/5.0-rt
2006-09-05 17:42:59 +04:00
anozdrin/alik@alik.
725bb2e6af Fix for BUG#12751: Instance Manager: client hangs after
start instance; kill mysqlmanager; show ...

The problem was that Instance Manager didn't close client
sockets (sockets for client connections) on execing mysqld
instance. So, mysqld-instance inherits these descriptors.

The fix is to set close-on-exec flag for each client socket.
2006-09-01 18:20:33 +04:00
georg@lmy002.wdf.sap.corp
9d6471c33e make dist changes for Cmake build 2006-09-01 10:32:12 +02:00
georg@lmy002.wdf.sap.corp
27636d9303 Additional files for cmake support 2006-08-31 19:52:42 +02:00
cmiller@zippy.cornsilk.net
6998c5140b Merge zippy.cornsilk.net:/home/cmiller/work/mysql/merge/tmp_merge
into  zippy.cornsilk.net:/home/cmiller/work/mysql/merge/mysql-5.0
2006-08-17 10:53:12 -04:00
cmiller@zippy.cornsilk.net
c627a6ce84 Merge zippy.cornsilk.net:/home/cmiller/work/mysql/merge/tmp_merge
into  zippy.cornsilk.net:/home/cmiller/work/mysql/merge/mysql-5.0
2006-08-17 10:42:50 -04:00
hartmut@mysql.com/linux.site
73c77c00fa relying on loop counter variables being local to the loop body if
declared in the 'for' statement is not portable, some compilers
  still don't implement this ANSI C++ specification (Bug #14995)
2006-08-05 13:41:22 +02:00
msvensson@neptunus.(none)
2469667e4b Bug#20190 Unixware 7.13 port and make test errors
- Thanks to cerber for the patch!
2006-08-03 17:29:35 +02:00
rburnett@bk-internal.mysql.com
4b80ef2007 Merge bk-internal.mysql.com:/data0/bk/mysql-5.0
into  bk-internal.mysql.com:/data0/bk/mysql-5.0-kt
2006-07-27 16:17:17 +02:00
kent@mysql.com/c-4b4072d5.010-2112-6f72651.cust.bredbandsbolaget.se
47a9da936c mysqlmanager.vcproj:
Place mysqlmanager 'pdb' file in 'client_debug' directory
mysys.vcproj:
  Removed define of __NT__ from 'Debug' target
mysqld.vcproj:
  Always generate 'pdb' and 'map' files
2006-07-22 02:00:33 +02:00
jimw@rama.(none)
a34f37acdd Bug #12673: Instance Manager: allows to stop the instance many times
The instance manager was not actually checking whether an instance
  was actually running before trying to stop it. Now it checks first.
2006-07-12 12:30:22 -07:00
kent@mysql.com
593b359d92 mysql.spec.sh:
Disable old RPM strip
my_global.h:
  Fixed wrong cast, which caused problems with gcc 4.0 and
  floats in prepared statements (Bug #19694)
mysqlmanager.vcproj:
  Place output files in common release/debug directory
2006-06-30 02:49:28 +02:00
knielsen@mysql.com
d74a0457b6 Merge mysql.com:/usr/local/mysql/mysql-5.0-bug20622
into  mysql.com:/usr/local/mysql/tmp-5.0
2006-06-23 14:52:04 +02:00