Commit graph

2300 commits

Author SHA1 Message Date
Andrei Elkin
69d6fcbd3b merging 5.1 main -> rpl+2. Some manual work required mostly due to bug46640 2009-11-06 18:35:04 +02:00
Joerg Bruehe
5c95f2363a Upmerge the Windows compile fix from 5.0 to 5.1 2009-10-16 15:05:52 +02:00
Joerg Bruehe
9ceeabd9b2 Compile fix for Windows:
Use "#ifdef", not plain "#if".
2009-10-16 14:06:33 +02:00
Joerg Bruehe
7a69adf492 Upmerge (automerge) into 5.1 2009-10-09 15:21:45 +02:00
Joerg Bruehe
5184530308 Fix bug#47923 New "mf_keycache.c" requires thread support
The bug is a compilation issue:
Function "find_key_block()" had thread operations
which were not guarded by "#if THREAD", add that now.
2009-10-08 21:58:17 +02:00
Magnus Blåudd
b64dbeed6e Bug#47857 strip_sp function in mysys/mf_strip.c never used and cause name clash
- Remove mf_strip.c and the declaration of 'strip_sp'
2009-10-06 13:04:51 +02:00
Kristofer Pettersson
499121a080 Automerg 2009-10-06 09:40:30 +02:00
Kristofer Pettersson
dfed28e750 Bug#47768 pthread_cond_timedwait() is broken on windows
The pthread_cond_wait implementations for windows might
dead lock in some rare circumstances.

1) One thread (I) enter a timed wait and at a point in
   time ends up after mutex unlock and before
   WaitForMultipleObjects(...)
2) Another thread (II) enters pthread_cond_broadcast.
   Grabs the mutex and discovers one waiter. It set
   the broadcast event and closes the broadcast gate
   then unlocks the mutex.
3) A third thread (III) issues a pthread_cond_signal.
   It grabs the mutex, discovers one waiter, sets the
   signal event then unlock the mutex.
4) The first threads (I) enters WaitForMultipleObjects
   and finds out that the signal object is in a
   signalled state and exits the wait.
5) Thread (I) grabs the mutex and checks result status.
   The number of waiters is decreased and becomes equal
   to 0. The event returned was a signal event so the
   broadcast gate isn't opened. The mutex is released.
6) Thread (II) issues a new broadcast. The mutex is
   acquired but the number of waiters are 0 hence
   the broadcast gate remains closed.
7) Thread (I) enters the wait again but is blocked by
   the broadcast gate.

      This fix resolves the above issue by always resetting
      broadcast gate when there are no more waiters in th queue.
2009-10-06 09:38:44 +02:00
Georgi Kodinov
db35fb7961 automerge 2009-10-04 12:15:05 +03:00
He Zhenxing
b92d459d11 Backport post fix compiler warnings and test failures for BUG#25192 BUG#12190 2009-10-02 16:40:06 +08:00
He Zhenxing
86c36aa1fd Backport BUG#25192 Using relay-log and relay-log-index without values produces unexpected results.
Options loaded from config files were added before command line
arguments, and they were parsed together, which could interprete
the following:
option-a
option-b
as --option-a=--option-b if 'option-a' requires a value, and 
caused confusing.

Because all options that requires a value are always given in
the form '--option=value', so it's an error if there is no 
'=value' part for such an option read from config file.

This patch added a separator to separate the arguments from 
config files and that from command line, so that they can be
handled differently. And report an error for options loaded
from config files that requires a value and is not given in the
form '--option=value'.
2009-10-02 16:25:53 +08:00
Ingo Struewing
0c522f7453 auto-merge 2009-10-01 15:54:11 +02:00
Ingo Struewing
21586dfb08 WL#4259 - Debug Sync Facility
Backport from 6.0 to 5.1.
Only those sync points are included, which are used in debug_sync.test.

  The Debug Sync Facility allows to place synchronization points
  in the code:
  
  open_tables(...)
  
  DEBUG_SYNC(thd, "after_open_tables");
  
  lock_tables(...)
  
  When activated, a sync point can
  
  - Send a signal and/or
  - Wait for a signal
  
  Nomenclature:
  
  - signal:            A value of a global variable that persists
                       until overwritten by a new signal. The global
                       variable can also be seen as a "signal post"
                       or "flag mast". Then the signal is what is
                       attached to the "signal post" or "flag mast".
  
  - send a signal:     Assign the value (the signal) to the global
                       variable ("set a flag") and broadcast a
                       global condition to wake those waiting for
                       a signal.
  
  - wait for a signal: Loop over waiting for the global condition until
                       the global value matches the wait-for signal.
  
  Please find more information in the top comment in debug_sync.cc
  or in the worklog entry.
2009-09-29 17:38:40 +02:00
Magnus Blåudd
0b4b556911 Merge bug#42850 to 5.1 2009-09-28 14:40:45 +02:00
Magnus Blåudd
56b7b74b25 Merge bug#42850 to 5.0 2009-09-28 14:38:06 +02:00
Magnus Blåudd
40bd549b9b Bug#42850 race condition in my_thr_init.c
- Create the "dummy" thread joinable and wait for it to
   exit before continuing in 'my_thread_global_init'
 - This way we know that the pthread library is initialized
   by one thread only
2009-09-24 08:30:31 +02:00
Mats Kindahl
4ad8ef0602 WL#5016: Fix header file include guards
Adding header include file guards to files that are missing such.
2009-09-23 23:32:31 +02:00
Magnus Blåudd
f66231be11 Merge bug#42850 to 5.0 2009-09-28 14:40:20 +02:00
Alexey Kopytov
ddd00a7771 Automerge. 2009-09-18 11:54:38 +04:00
Alexey Kopytov
d39f0a72ad Bug #43606: 4GB Limit on huge_pages shared memory set-up
Large pages allocator could not allocate more than 4 GB due to
incorrect size alignment.
2009-09-18 11:19:02 +04:00
Joerg Bruehe
67bcf54df6 Fix bug#46980
Option "--without-server" still not working in 5.1

The general approach is to make sure that source files
which require thread support are only compiled if the build
really needs thread support,
which means when the server is built or a thread-safe client
library.

This required several changes:
- Make sure the subdirectories "storage/" and "plugin/" are
  only processed if the server is built, not ifclient-only.
- Make the compilation of some modules which inherently
  require threading depend on thread supportin the build.
- Separate the handling of threading in "configure.in" from
  that of server issues, threading is also needed in a
  non-server build of a thread-safe client library.

Also, "libdbug" must get built even in a client-only build,
so "dbug/" must be in the list of client directories.

In addition, calls to thread functions in source files which
can be built without thread support must use the wrapper
functions which handle the non-threaded build.
So the modules "client/mysqlimport.c" and "client/mysqlslap.c"
must call "my_thread_end()" only via "mysql_thread_end()".
2009-09-17 18:34:24 +02:00
Staale Smedseng
5051100a1a Merge from 5.0 2009-09-17 17:25:52 +02:00
Staale Smedseng
38b6d49e82 Bug #43414 Parenthesis (and other) warnings compiling MySQL
with gcc 4.3.2
      
This is the fifth patch cleaning up more GCC warnings about
variables used before initialized using the new macro
UNINIT_VAR().
2009-09-17 17:10:30 +02:00
Georgi Kodinov
59069cac4a fixed compilation warnings 2009-09-24 16:21:46 +03:00
Ingo Struewing
8dcaefca21 Bug#17332 - changing key_buffer_size on a running server
can crash under load

Merge from 5.0, after backport from 5.1/5.4 to 5.0.
This makes the fixes for
Bug 44068 (RESTORE can disable the MyISAM Key Cache)
Bug 40944 (Backup: crash after myisampack)
available to 5.1.
2009-09-09 17:13:13 +02:00
Ingo Struewing
1b60803282 Bug#17332 - changing key_buffer_size on a running server
can crash under load

Backport from 5.1.
Does also include key cache fixes from:
Bug 44068 (RESTORE can disable the MyISAM Key Cache)
Bug 40944 (Backup: crash after myisampack)
2009-09-07 18:35:37 +02:00
Satya B
fc2243d69b merge mysql-5.0-bugteam to mysql-5.1-bugteam 2009-09-03 17:59:25 +05:30
Satya B
4a9e7e8e25 Fix for BUG#46591 - .frm file isn't sync'd with sync_frm enabled for
CREATE TABLE...LIKE...
      
The mysql server option 'sync_frm' is ignored when table is created with 
syntax CREATE TABLE .. LIKE.. 
      
Fixed by adding the MY_SYNC flag and calling my_sync() from my_copy() when
the flag is set.

In mysql_create_table(), when the 'sync_frm' is set, MY_SYNC flag is passed 
to my_copy(). 
      
Note: TestCase is not attached and can be tested manually using debugger.
2009-09-03 16:02:03 +05:30
Georgi Kodinov
bb4c5acfb3 merge 2009-09-02 15:33:18 +03:00
Davi Arnaut
f076ba2803 Manual merge. 2009-09-02 09:12:18 -03:00
Davi Arnaut
ca96ac5351 Post-merge fix. Observe C declaration placement rules. 2009-09-02 09:02:22 -03:00
Georgi Kodinov
8f5b17f529 Fixed win32 compilation warnings 2009-09-02 13:22:47 +03:00
Anurag Shekhar
600703e50a merging bugfix from 5.0 2009-08-31 13:26:09 +05:30
Anurag Shekhar
9b97856d82 merging with changes in bugteam branch. 2009-08-31 13:02:31 +05:30
Staale Smedseng
f59ef9eafa Merge from 5.0 for 43414 2009-08-28 18:21:54 +02:00
Staale Smedseng
2217de2513 Bug #43414 Parenthesis (and other) warnings compiling MySQL
with gcc 4.3.2
      
This patch fixes a number of GCC warnings about variables used
before initialized. A new macro UNINIT_VAR() is introduced for
use in the variable declaration, and LINT_INIT() usage will be
gradually deprecated. (A workaround is used for g++, pending a
patch for a g++ bug.)
      
GCC warnings for unused results (attribute warn_unused_result)
for a number of system calls (present at least in later
Ubuntus, where the usual void cast trick doesn't work) are
also fixed.
2009-08-28 17:51:31 +02:00
Davi Arnaut
a0e44ec1e8 Fix for a few assorted compiler warnings. 2009-08-28 12:06:59 -03:00
Anurag Shekhar
90032c1007 Bug #44723 Larger read_buffer_size values can cause performance
decrease for INSERTs


Bulk inserts (multiple row, CREATE ... SELECT, INSERT ... SELECT) into
MyISAM tables were performed inefficiently. This was mainly affecting
use cases where read_buffer_size was considerably large (>256K) and low
number of rows was inserted (e.g. 30-100).

The problem was that during I/O cache initialization (this happens
before each bulk insert) allocated I/O buffer was unnecessarily
initialized to '\0'.

This was happening because of mess in flag values. MyISAM informs I/O
cache to wait for free space (if out of disk space) by passing
MY_WAIT_IF_FULL flag. Since MY_WAIT_IF_FULL and MY_ZEROFILL have the
same values, memory allocator was initializing memory to '\0'.

The performance gain provided with this patch may only be visible with
non-debug binaries, since safemalloc always initializes allocated memory
to 0xA5A5...
2009-08-24 13:15:51 +05:30
Ignacio Galarza
6df2af22ce Bug#17270 - mysql client tool could not find ../share/charsets folder and fails.
- Define and pass compile time path variables as pre-processor definitions to 
  mimic the makefile build.
- Set new CMake version and policy requirements explicitly.
- Changed DATADIR to MYSQL_DATADIR to avoid conflicting definition in 
  Platform SDK header ObjIdl.h which also defines DATADIR.
2009-07-31 15:22:02 -04:00
V Narayanan
ce0bf2a475 Bug#43572 Handle failures from hash_init
This patch is a follow up to http://lists.mysql.com/commits/76678.
When an allocation failure occurs for the buffer in the dynamic
array, an error condition was being set. The dynamic array is
usable even if the memory allocation fails. Since in most cases
the thread can continue to work without any problems the error
condition should not be set here.

This patch adds logic to remove the error condition from being set
when the memory allocation for the buffer in dynamic array fails.
2009-07-12 11:18:53 +05:30
Sergey Vojtovich
7a77e3d05a Merge mysql-5.1-innodb_plugin to mysql-5.1. 2009-08-11 18:05:25 +05:00
Ignacio Galarza
8ef28b4962 Auto-merge 2009-07-31 15:28:15 -04:00
Satya B
cae3c58a10 merging with mysql-5.1-bugteam branch 2009-07-27 11:50:13 +05:30
Satya B
ba7c6884d0 merge 5.0-bugteam to 5.1-bugteam 2009-07-24 12:15:06 +05:30
V Narayanan
54aecee9c0 merging with mysql-5.0-bugteam 2009-07-17 14:25:09 +05:30
Sergey Vojtovich
cc541211c8 Merge 5.1-bugteam -> 5.1-innodb_plugin. 2009-07-14 15:06:04 +05:00
Kristofer Pettersson
bb4faa54cd Automerge 2009-06-25 15:58:59 +02:00
Kristofer Pettersson
75ba3c6a4b Bug#45336 --enable-foobar doesn't work for any plugin foobar.
Because of a regression introduced by bug#19027 the option --enable-foobar
doesn't work anymore for any plugin 'foobar'. The reason is that plugin
names are tristate options variables with optional parameters and integer
values are not accepted. Since the 'enable' prefix attempts to assign '1'
to the option the operation fails.

This patch translates any number n assigned to a plugin variable of type ENUM
to be the corresponding enumerated item. As a side effect --enable-foobar and
--disable-foobar will also start working again.
2009-06-25 15:55:26 +02:00
V Narayanan
1b454e345c Bug#43572 Handle failures from hash_init
The merge from http://lists.mysql.com/commits/76678 caused the 
growth_size parameter to the my_init_dynamic_array function to
be ignored. This patch corrects the problem.
2009-06-22 16:40:34 +05:30
V Narayanan
81dbbd68c1 merging with mysql-5.0-bugteam 2009-06-19 17:58:46 +05:30