Commit graph

2779 commits

Author SHA1 Message Date
Jon Olav Hauglid
52b1e11ee1 merge from mysql-trunk-bugfixing 2010-07-19 10:27:53 +02:00
Davi Arnaut
83c154dc34 Bug#34043: Server loops excessively in _checkchunk() when safemalloc is enabled
Post-merge fix: remove leftovers from safemalloc removal.
2010-07-17 11:56:00 -03:00
Davi Arnaut
0e6fcb393c Bug#45288: pb2 returns a lot of compilation warnings on linux
Fix compiler warnings due to: a mismatch in the prototypes for
check_access and implicit conversions from double to ulonglong
and vice-versa.
2010-07-15 14:45:08 -03:00
Davi Arnaut
649390ac81 Merge of mysql-trunk-bugfixing into mysql-trunk-merge. 2010-07-15 10:47:50 -03:00
Davi Arnaut
9f3aa51ba1 WL#5486: Remove code for unsupported platforms
Remove VMS specific code.
2010-07-15 08:26:38 -03:00
Davi Arnaut
79dcc17d49 WL#5486: Remove code for unsupported platforms
Remove Zortech specific code.
2010-07-15 08:17:56 -03:00
Davi Arnaut
b3d22cef93 WL#5486: Remove code for unsupported platforms
Remove MS-DOS specific code.
2010-07-15 08:16:06 -03:00
Davi Arnaut
f54a118249 WL#5486: Remove code for unsupported platforms
Remove Netware specific code.
2010-07-15 08:13:30 -03:00
Jon Olav Hauglid
a5d72c498c merge from mysql-trunk-bugfixing 2010-07-13 10:39:24 +02:00
Davi Arnaut
a10ae35328 Bug#34043: Server loops excessively in _checkchunk() when safemalloc is enabled
Essentially, the problem is that safemalloc is excruciatingly
slow as it checks all allocated blocks for overrun at each
memory management primitive, yielding a almost exponential
slowdown for the memory management functions (malloc, realloc,
free). The overrun check basically consists of verifying some
bytes of a block for certain magic keys, which catches some
simple forms of overrun. Another minor problem is violation
of aliasing rules and that its own internal list of blocks
is prone to corruption.

Another issue with safemalloc is rather the maintenance cost
as the tool has a significant impact on the server code.
Given the magnitude of memory debuggers available nowadays,
especially those that are provided with the platform malloc
implementation, maintenance of a in-house and largely obsolete
memory debugger becomes a burden that is not worth the effort
due to its slowness and lack of support for detecting more
common forms of heap corruption.

Since there are third-party tools that can provide the same
functionality at a lower or comparable performance cost, the
solution is to simply remove safemalloc. Third-party tools
can provide the same functionality at a lower or comparable
performance cost. 

The removal of safemalloc also allows a simplification of the
malloc wrappers, removing quite a bit of kludge: redefinition
of my_malloc, my_free and the removal of the unused second
argument of my_free. Since free() always check whether the
supplied pointer is null, redudant checks are also removed.

Also, this patch adds unit testing for my_malloc and moves
my_realloc implementation into the same file as the other
memory allocation primitives.
2010-07-08 18:20:08 -03:00
Davi Arnaut
245645e225 Unset the execute bit where it's not needed. 2010-07-03 20:17:03 -03:00
Davi Arnaut
74283a052e Merge of mysql-5.1-bugteam into mysql-trunk-merge. 2010-07-02 16:38:04 -03:00
Davi Arnaut
93fb8bb235 Bug#53445: Build with -Wall and fix warnings that it generates
Apart strict-aliasing warnings, fix the remaining warnings
generated by GCC 4.4.4 -Wall and -Wextra flags.

One major source of warnings was the in-house function my_bcmp
which (unconventionally) took pointers to unsigned characters
as the byte sequences to be compared. Since my_bcmp and bcmp
are deprecated functions whose only difference with memcmp is
the return value, every use of the function is replaced with
memcmp as the special return value wasn't actually being used
by any caller.

There were also various other warnings, mostly due to type
mismatches, missing return values, missing prototypes, dead
code (unreachable) and ignored return values.
2010-07-02 15:30:47 -03:00
Alexey Kopytov
92f7433d71 Manual merge from 5.1.
conflicts:
   conflict      include/my_alarm.h
2010-07-01 12:06:41 +04:00
Alexey Kopytov
ac89d92625 Bug#54667: Unnecessary signal handler redefinition
POSIX requires that a signal handler defined with sigaction()
is not reset on delivering a signal unless SA_NODEFER or
SA_RESETHAND is set. It is therefore unnecessary to redefine
the handler on signal delivery on platforms where sigaction()
is used without those flags.
2010-07-01 12:02:00 +04:00
Vladislav Vaintroub
41d832d19b Bug #52850: mysqld-debug.pdb doesn't match
mysqld-debug.exe in 5.5.3 on windows

Fix:

- Do not rename PDB, install mysqld.pdb matching 
mysqld-debug.exe into bin\debug subdirectory

- Stack tracing code will now additionally look in 
debug subdirectory of the application directory 
for debug symbols.

- Small cleanup in stacktracing code: link with 
dbghelp rather than load functions dynamically 
at runtime, since dbghelp.dll is always present.

- Install debug binaries with WiX
2010-06-30 14:10:29 +02:00
Jon Olav Hauglid
2fe246329f merge from mysql-trunk-bugfixing 2010-06-30 08:47:49 +02:00
Konstantin Osipov
cace7d3038 Salvage comments added by Ingo while working on
Bug#52114 and Bug#50788.
The bugs themselves are regressions that are introduced
by an incomplete fix for Bug#36171 and will not be pushed.
2010-06-29 18:28:36 +04:00
Alexander Nozdrin
514b9b25d2 Backport of revid:ingo.struewing@sun.com-20091223200354-r2uzbdkj2v6yv111
Bug#47633 - assert in ha_myisammrg::info during OPTIMIZE
 
   The server crashed on an attempt to optimize a MERGE table with
   non-existent child table.
 
   mysql_admin_table() relied on the table to be successfully open
   if a table object had been allocated.
 
   Changed code to check return value of the open function before
   calling a handler:: function on it.
2010-06-25 19:32:59 +04:00
Davi Arnaut
46a3afb331 Bug#22320: my_atomic-t unit test fails
The atomic operations implementation on 5.1 has a few problems,
which might cause tests to abort randomly. Since no code in 5.1
uses atomic operations, simply remove the code.
2010-07-05 09:00:39 -03:00
Alexander Nozdrin
bba0a92d03 Auto-merge from mysql-trunk-stage. 2010-06-21 17:08:16 +04:00
Daniel Fischer
9891642e77 merge 2010-06-18 17:04:15 +02:00
Konstantin Osipov
484351d108 Merge trunk-bugfixing -> trunk-runtime 2010-06-17 17:31:51 +04:00
Alexey Kopytov
eae3b4fe76 Manual merge from mysql-5.1-bugteam to mysql-trunk-merge.
conflicts:
   conflict      mysys/safemalloc.c
   conflict      sql/mysqld.cc
   conflict      sql/sp.cc
   conflict      sql/sql_lex.cc
   conflict      sql/sql_lex.h
   conflict      sql/sql_parse.cc
   conflict      sql/sql_prepare.cc
2010-06-11 17:48:24 +04:00
Alexey Kopytov
162e426238 Manual merge from the bugfix tree.
conflicts:
   conflict      sql/sql_parse.cc
2010-06-11 16:52:06 +04:00
Alexey Kopytov
b497e2c6b2 Manual merge from the bugfix tree.
conflicts:
   conflict      sql/sql_parse.cc
2010-06-11 14:51:21 +04:00
Davi Arnaut
d6e003545a Merge of mysql-5.1-bugteam into mysql-trunk-merge. 2010-06-10 22:30:49 -03:00
Davi Arnaut
bb036c93b4 Bug#42733: Type-punning warnings when compiling MySQL --
strict aliasing violations.

Essentially, the problem is that large parts of the server were
developed in simpler times (last decades, pre C99 standard) when
strict aliasing and compilers supporting such optimizations were
rare to non-existent. Thus, when compiling the server with a modern
compiler that uses strict aliasing rules to perform optimizations,
there are several places in the code that might trigger undefined
behavior.

As evinced by some recent bugs, GCC does a somewhat good of job
misoptimizing such code, but on the other hand also gives warnings
about suspicious code. One problem is that the warnings aren't
always accurate, yet we can't afford to just shut them off as we
might miss real cases. False-positive cases are aggravated mostly
by casts that are likely to trigger undefined behavior.

The solution is to start a cleanup process focused on fixing and
reducing the amount of strict-aliasing related warnings produced
by GCC and others compilers. A good deal of noise reduction can
be achieved by just removing useless casts that are product of
historical cruft and are likely to trigger undefined behavior if
dereferenced.
2010-06-10 17:16:43 -03:00
Alexander Nozdrin
b985f88460 Revert a patch for Bug#54334 (Double initialization of mysys mutexes).
Revision ID of the patch: marc.alff@oracle.com-20100608124148-lr1ult7lwo75niev
2010-06-10 17:44:19 +04:00
Marc Alff
ddf6a66504 Bug#54334 Double initialization of mysys mutexes
Prior to this fix, mysys mutexes such as THR_LOCK_lock could be initialized
twice by a call to my_init().
The root cause was out of place initialization in my_basic_init(),
calling my_thread_global_init().

With this fix,
- my_basic_init() properly initializes the mutex implementation itself,
for SAFE or FAST mutexes, and for platform dependent initializations,
before initialiazing a mutex.
- my_init() properly initializes mysys mutexes once,
when making the first call to my_thread_global_init().
2010-06-08 06:41:48 -06:00
Mats Kindahl
b1dcf448ea WL#5363: Thread Pool Service Interface
In order to allow thread schedulers to be dynamically loaded,
it is necessary to make the following changes to the server:

- Two new service interfaces

- Modifications to InnoDB to inform the thread scheduler of state changes.

- Changes to the VIO subsystem for checking if data is available on a socket.

- Elimination of remains of the old thread pool implementation.

The two new service interfaces introduces are:

my_thread_scheduler
  A service interface to register a thread
  scheduler.

thd_wait
  A service interface to inform thread scheduler
  that the thread is about to start waiting.

In addition, the patch adds code that:

- Add a call to thd_wait for table locks in mysys
  thd_lock.c by introducing a set function that
  can be used to set a callback to be used when
  waiting on a lock and resuming from waiting.

- Calling the mysys set function from the server
  to set the callbacks correctly.
2010-06-07 16:01:39 +02:00
Jon Olav Hauglid
1af11051bf manual merge from mysql-trunk-bugfixing
Conflicts:
Text conflict in mysql-test/r/archive.result
Contents conflict in mysql-test/r/innodb_bug38231.result
Text conflict in mysql-test/r/mdl_sync.result
Text conflict in mysql-test/suite/binlog/t/disabled.def
Text conflict in mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result
Text conflict in mysql-test/t/archive.test
Contents conflict in mysql-test/t/innodb_bug38231.test
Text conflict in mysql-test/t/mdl_sync.test
Text conflict in sql/sp_head.cc
Text conflict in sql/sql_show.cc
Text conflict in sql/table.cc
Text conflict in sql/table.h
2010-06-06 13:19:29 +02:00
Konstantin Osipov
08589ba9c9 A follow up patch for the fix for Bug#51263 "Deadlock between
transactional SELECT and ALTER TABLE ...  REBUILD PARTITION".

Remove unused code - TL_WRITE_ALLOW_READ thr_lock.c lock.
2010-06-01 14:13:56 +04:00
Davi Arnaut
5dec0c9637 Bug#53445: Build with -Wall and fix warnings that it generates
Fix various mismatches between function's language linkage. Any
particular function that is declared in C++ but should be callable
from C must have C linkage. Note that function types with different
linkages are also distinct. Thus, if a function type is declared in
C code, it will have C linkage (same if declared in a extern "C"
block).
2010-05-31 12:29:54 -03:00
Alexander Nozdrin
522d9ac30f Auto-merge from mysql-trunk-bugfixing.
Due to a BZR bug, that merge was done by the following command:
bzr merge -r 'revid:tor.didriksen@sun.com-20100527074248-6qtv0p1ugy6o1hjo..' <mysql-trunk-bugfixing path>
2010-06-01 16:38:01 +04:00
Davi Arnaut
aa28461510 Backport: remove dead code.
Reorganize function to reflect that it does not actually uses curses
and that there is no curses variant.
2010-05-28 19:53:26 -03:00
Davi Arnaut
570c6cc87a Backport: Remove unused and ancient files, functions, and facilities. 2010-05-28 19:13:31 -03:00
Alexander Nozdrin
4e633ec234 Auto-merge from mysql-trunk. 2010-05-28 09:47:58 +04:00
Vasil Dimov
96c47c4df1 Merge mysql-trunk-bugfixing -> mysql-trunk-innodb
(skipping the change to storage/innobase/os/os0file.c because
that issue has already been addressed in mysql-trunk-innodb)
2010-05-27 12:47:57 +03:00
Tor Didriksen
d8536dfbdd Bug #53445 Build with -Wall and fix warnings that it generates
Add -Wall to gcc/g++
Fix most warnings reported in dbg and opt mode.
2010-05-26 16:12:23 +02:00
Alexander Nozdrin
34c7685b24 Patch for Bug#53937 (Junk make-ccc files included in MySQL Server bzr repo).
Remove make-ccc files.
2010-05-26 14:20:14 +04:00
Alexey Kopytov
779e2a9686 Bug #42064: low memory crash when importing hex strings, in
Item_hex_string::Item_hex_string

The status of memory allocation in the Lex_input_stream (called
from the Parser_state constructor) was not checked which led to
a parser crash in case of the out-of-memory error.

The solution is to introduce new init() member function in
Parser_state and Lex_input_stream so that status of memory
allocation can be returned to the caller.
2010-05-21 15:23:48 +04:00
Alexander Nozdrin
eff442964a Manual merge from mysql-trunk.
Conflicts:
  - mysql-test/r/partition.result
  - mysql-test/r/variables_debug.result
  - mysql-test/t/partition.test
  - mysql-test/t/variables_debug.test
2010-05-20 16:35:28 +04:00
Marko Mäkelä
525768ddc9 Merge a change from mysql-5.1-innodb:
TO DO: Enable this in CMake-based builds.

------------------------------------------------------------
revno: 3474
revision-id: marko.makela@oracle.com-20100520104042-ma2nsscqdvwoph8k
parent: marko.makela@oracle.com-20100519081618-h38q02qxuvcowbtk
committer: Marko Mäkelä <marko.makela@oracle.com>
branch nick: 5.1-innodb
timestamp: Thu 2010-05-20 13:40:42 +0300
message:
  Bug#53593: Add some instrumentation to improve Valgrind sensitivity

  BUILD/*: Add valgrind_configs=--with-valgrind.
  BUILD/*: Remove -USAFEMALLOC from valgrind_flags.

  configure.in: Add AC_ARG_WITH(valgrind) and HAVE_VALGRIND.

  include/my_sys.h: Define a number of MEM_ wrappers for VALGRIND_ functions.
  include/my_sys.h: Make TRASH do MEM_UNDEFINED().

  include/m_string.h: Remove unused macro bzero_if_purify(A,B).

  _mymalloc(): Declare MEM_UNDEFINED() on the allocated memory.

  _myfree(): Declare MEM_NOACCESS() on the freed memory.

  storage/innobase/include/univ.i: Enable UNIV_DEBUG_VALGRIND based on
  HAVE_VALGRIND rather than HAVE_purify.

  Possible things to do:
   * In my_global.h, remove the defined(HAVE_purify) condition
     from the _WIN32 uint3korr().
   * In my_global.h *int*korr(), use | instead of +
     in order to keep the Valgrind V bits accurate
   * Consider replacing HAVE_purify with HAVE_VALGRIND
   * Use VALGRIND_CREATE_BLOCK, VALGRIND_DISCARD in mem_root and similar places
2010-05-20 14:43:06 +03:00
Marko Mäkelä
5fc862d6c9 Bug#53593: Add some instrumentation to improve Valgrind sensitivity
BUILD/*: Add valgrind_configs=--with-valgrind.
BUILD/*: Remove -USAFEMALLOC from valgrind_flags.

configure.in: Add AC_ARG_WITH(valgrind) and HAVE_VALGRIND.

include/my_sys.h: Define a number of MEM_ wrappers for VALGRIND_ functions.
include/my_sys.h: Make TRASH do MEM_UNDEFINED().

include/m_string.h: Remove unused macro bzero_if_purify(A,B).

_mymalloc(): Declare MEM_UNDEFINED() on the allocated memory.

_myfree(): Declare MEM_NOACCESS() on the freed memory.

storage/innobase/include/univ.i: Enable UNIV_DEBUG_VALGRIND based on
HAVE_VALGRIND rather than HAVE_purify.

Possible things to do:
 * In my_global.h, remove the defined(HAVE_purify) condition
   from the _WIN32 uint3korr().
 * In my_global.h *int*korr(), use | instead of +
   in order to keep the Valgrind V bits accurate
 * Consider replacing HAVE_purify with HAVE_VALGRIND
 * Use VALGRIND_CREATE_BLOCK, VALGRIND_DISCARD in mem_root and similar places
2010-05-20 13:40:42 +03:00
Alexander Nozdrin
091bcacc79 Another incarnation of the patch for Bug#30708
(make relies GNU extentions). The patch was partially
backport from 6.0.

Original comment:
bug#30708: make relies GNU extensions.  Now that we no longer use
BitKeeper we can safely remove the SCCS handling with no loss of
functionality.
2010-05-19 17:00:23 +04:00
Alexey Kopytov
cb0d64cbdd Fixed loaddata failures on some platforms in PB2. 2010-05-11 20:10:52 +04:00
Alexey Kopytov
ad43230e3b Manual merge of mysql-5.1-bugteam to mysql-trunk-merge.
Conflicts:

Text conflict in mysql-test/r/grant.result
Text conflict in mysql-test/t/grant.test
Text conflict in mysys/mf_loadpath.c
Text conflict in sql/slave.cc
Text conflict in sql/sql_priv.h
2010-05-09 02:03:35 +04:00
Georgi Kodinov
1132c35475 On behalf of Kristofer :
Bug#53417 my_getwd() makes assumptions on the buffer sizes which not always hold true
      
The mysys library contains many functions for rewriting file paths. Most of these
functions makes implicit assumptions on the buffer sizes they write to. If a path is put
in my_realpath() it will propagate to my_getwd() which assumes that the buffer holding
the path name is greater than 2. This is not true in cases.
      
In the special case where a VARBIN_ITEM is passed as argument to the LOAD_FILE function
this can lead to a crash.
      
This patch fixes the issue by introduce more safe guards agaist buffer overruns.
2010-05-05 11:54:52 +03:00
Alexander Nozdrin
d328d5be33 Manual merge from mysql-trunk.
Conflicts:
  - mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result
2010-04-27 13:58:21 +04:00
Joerg Bruehe
8dcbf6e20c Merge the changes of the 5.5.3-m3 release build
back into the development branches.
2010-04-18 15:32:05 +02:00
Alexey Kopytov
abab51e0db Automerge of mysql-5.1-bugteam to mysql-trunk-merge. 2010-04-11 11:17:42 +04:00
Georgi Kodinov
17a21c4f35 Bug #47095: Can't open_files_limit really be larger than 65535?
Several problems addressed:

1. The maximum value for --open_files_limit on non-windows boxes
is now raised to UINT_MAX (the maximum possible without significant
changes in the code). The maximum value on windows is kept to be
2048 due to a known limitation (bug 24509).

2. mysqld_safe now supports --open_files_limit=xx in addition to 
--open-files-limit=xx

3. mysqld_safe always passes through --open[_-]files[_-]limit
to the underlying mysqld. It used to pass it through only if it 
the user running the script has access to the root directory or
there was an --user argument specified.

4. Fixed a prototype in my_file.c to match its counterpart in 
the other #ifdef branch.
2010-04-09 14:47:18 +03:00
Alexey Kopytov
7320a95808 Manual merge of mysql-5.1-bugteam into mysql-trunk-merge.
Conflicts:

Text conflict in mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
Text conflict in sql/log.cc
Text conflict in sql/set_var.cc
Text conflict in sql/sql_class.cc
2010-04-03 21:35:51 +04:00
Georgi Kodinov
2d035bf78d Bug #51893: crash with certain characters given to load_file
function on windows
               
When making sure that the directory path ends up with a 
slash/backslash we need to check for the correct length of 
the buffer and trim at the appropriate location so we don't
write past the end of the buffer.
2010-03-30 15:03:50 +03:00
Alexey Kopytov
f10885675c Manual merge of mysql-trunk into mysql-trunk-merge.
Conflicts:

Text conflict in client/mysqlbinlog.cc
Text conflict in mysql-test/Makefile.am
Text conflict in mysql-test/collections/default.daily
Text conflict in mysql-test/r/mysqlbinlog_row_innodb.result
Text conflict in mysql-test/suite/rpl/r/rpl_typeconv_innodb.result
Text conflict in mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test
Text conflict in mysql-test/suite/rpl/t/rpl_row_create_table.test
Text conflict in mysql-test/suite/rpl/t/rpl_slave_skip.test
Text conflict in mysql-test/suite/rpl/t/rpl_typeconv_innodb.test
Text conflict in mysys/charset.c
Text conflict in sql/field.cc
Text conflict in sql/field.h
Text conflict in sql/item.h
Text conflict in sql/item_func.cc
Text conflict in sql/log.cc
Text conflict in sql/log_event.cc
Text conflict in sql/log_event_old.cc
Text conflict in sql/mysqld.cc
Text conflict in sql/rpl_utility.cc
Text conflict in sql/rpl_utility.h
Text conflict in sql/set_var.cc
Text conflict in sql/share/Makefile.am
Text conflict in sql/sql_delete.cc
Text conflict in sql/sql_plugin.cc
Text conflict in sql/sql_select.cc
Text conflict in sql/sql_table.cc
Text conflict in storage/example/ha_example.h
Text conflict in storage/federated/ha_federated.cc
Text conflict in storage/myisammrg/ha_myisammrg.cc
Text conflict in storage/myisammrg/myrg_open.c
2010-03-24 18:03:44 +03:00
Georgi Kodinov
d95bed0215 Bug #51893: crash with certain characters given to load_file
function on windows

When making sure that the directory path ends up with a 
slash/backslash we need to check for the correct length of 
the buffer and trim at the appropriate location so we don't
write past the end of the buffer.
2010-03-23 16:54:16 +02:00
Alexey Kopytov
7ac059ba8f Manual merge of mysql-5.1-bugteam into mysql-trunk-merge.
Conflicts:

Text conflict in mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test
Text conflict in sql/item_func.cc
2010-03-22 16:28:51 +03:00
Alexander Barkov
177522a4fe Bug #51976 LDML collations issue
Problem: caseup_multiply and casedn_multiply members      
were not initialized for a dynamic collation, so          
UPPER() and LOWER() functions returned empty strings.      
Fix: initializing the members properly.

Adding tests:
  mysql-test/r/ctype_ldml.result
  mysql-test/t/ctype_ldml.test

Applying the fix:
  mysys/charset.c
2010-03-22 16:27:59 +04:00
Jonathan Perkin
7e852519d7 Fixes from wlad 2010-03-18 21:06:12 +01:00
Joerg Bruehe
ff6385af70 Fix C++ style comments, they cause syntax errors in C file. 2010-03-13 22:17:47 +01:00
Alexey Kopytov
d2452095a5 Manual merge of mysql-5.1-bugteam into mysql-trunk-merge.
Conflicts:

Text conflict in .bzr-mysql/default.conf
Text conflict in mysql-test/r/explain.result
Text conflict in mysql-test/r/having.result
Text conflict in mysql-test/suite/rpl/t/disabled.def
Text conflict in mysql-test/suite/rpl/t/rpl_slave_skip.test
Text conflict in storage/federated/ha_federated.cc
2010-03-07 19:40:59 +03:00
Alexander Nozdrin
4f08c6d0e5 A follow-up on WL#5154 and WL#5182: remove forgotten options. 2010-03-03 22:22:02 +03:00
Alexander Nozdrin
c17e266437 Manual merge from mysql-next-mr.
Conflicts:
  - sql/sql_base.cc
2010-03-02 17:34:50 +03:00
Alexander Nozdrin
b73cba223b Manual merge from mysql-next-mr.
Conflicts:
  - sql/item.cc
2010-03-01 13:06:11 +03:00
Dmitry Lenev
dcaa144852 Fix for bug #51105 "MDL deadlock in rqg_mdl_stability test
on Windows".

On platforms where read-write lock implementation does not
prefer readers by default (Windows, Solaris) server might
have deadlocked while detecting MDL deadlock.

MDL deadlock detector relies on the fact that read-write
locks which are used in its implementation prefer readers
(see new comment for MDL_lock::m_rwlock for details).
So far MDL code assumed that default implementation of
read/write locks for the system has this property.
Indeed, this turned out ot be wrong, for example, for
Windows or Solaris. Thus MDL deadlock detector might have
deadlocked on these systems.

This fix simply adds portable implementation of read/write
lock which prefer readers and changes MDL code to use this
new type of synchronization primitive.

No test case is added as existing rqg_mdl_stability test can
serve as one.
2010-02-28 07:35:09 +03:00
Davi Arnaut
9e045298a5 Workaround the pthread_once_t static initialization. Per the
POSIX standard, reinitialization of a pthread_once is a gray
area, but it is needed to support subsequent initializations
of the client library.
2010-02-26 23:09:36 -03:00
Staale Smedseng
04f1434781 Bug #45058 init_available_charsets uses double checked locking
A client doing multiple mysql_library_init() and
mysql_library_end() calls over the lifetime of the process may
experience lost character set data, potentially even a
SIGSEGV.

This patch reinstates the reloading of character set data when
a mysql_library_init() is done after a mysql_library_end().
2010-02-26 15:30:14 +01:00
Alexander Nozdrin
c962fdf25c Auto-merge from mysql-next-mr. 2010-02-25 22:58:57 +03:00
Alexander Nozdrin
04b8cb1882 Manual merge from mysql-trunk-merge.
Conflicts:
  - client/mysql.cc
  - client/mysqldump.c
  - configure.in
  - mysql-test/r/csv.result
  - mysql-test/r/func_time.result
  - mysql-test/r/show_check.result
  - mysql-test/r/sp-error.result
  - mysql-test/r/sp.result
  - mysql-test/r/sp_trans.result
  - mysql-test/r/type_blob.result
  - mysql-test/r/type_timestamp.result
  - mysql-test/r/warnings.result
  - mysql-test/suite/rpl/r/rpl_sp.result
  - sql/mysql_priv.h
  - sql/mysqld.cc
  - sql/sp.cc
  - sql/sql_base.cc
  - sql/sql_table.cc
  - sql/sql_trigger.cc
  - sql/sql_view.cc
  - sql/table.h
  - sql/share/errmsg.txt
  - mysql-test/suite/sys_vars/r/log_bin_trust_routine_creators_basic.result
2010-02-24 16:52:27 +03:00
Alexander Barkov
0bf7ac328f Merging WL#1213 into mysql-next-mr-bar2 2010-02-24 13:52:59 +04:00
Alexander Barkov
13c32771e7 Backporting WL#1213 2010-02-24 13:15:34 +04:00
Vladislav Vaintroub
f4284ba6bd Fix BUILD/compile-pentium64-xxx scripts, when ccache is present.
Fix contains of :
-  splitting CC/CXX if there are more that 2 space-delimited tokens, add the rest to CFLAGS
(in this case CC was set to "ccache gcc --pipe", and this broke recognition of gcc compiler
as CMake understands CC consisting of 2 space delimited tokens but not more)

-  add my_new.cc to mysys fle list if C++ operator new is not found. Always, not only
for gcc  (the original problem was that missing operator new when compiling with CXX=gcc)
2010-02-22 20:55:27 +01:00
Vladislav Vaintroub
d4b10d1fd5 merge 2010-02-16 23:19:47 +01:00
Alexander Nozdrin
7547912586 Auto-merge from mysql-next-4284. 2010-02-15 17:08:38 +03:00
Jon Olav Hauglid
9656026658 Followup to Bug#45225 Locking: hang if drop table with no timeout
This patch removes the unused server variable
"table_lock_wait_timeout".
2010-02-15 13:11:20 +01:00
Alexander Nozdrin
6c32fa7357 Manual merge from mysql-next-mr.
Conflicts:
  - sql/log_event.cc
  - sql/sql_class.h
2010-02-15 14:16:49 +03:00
Vladislav Vaintroub
c5934fa1ea remove use of undocumented __sparcv8plus - this macro does not seem to be defined anymore with Sun Studio 12 2010-02-14 14:32:27 +01:00
Vladislav Vaintroub
8ba512559c merge 2010-02-13 17:01:32 +01:00
Jon Olav Hauglid
5bb67f34b8 Bug #45225 Locking: hang if drop table with no timeout
This patch introduces timeouts for metadata locks. 

The timeout is specified in seconds using the new dynamic system 
variable  "lock_wait_timeout" which has both GLOBAL and SESSION
scopes. Allowed values range from 1 to 31536000 seconds (= 1 year). 
The default value is 1 year.

The new server parameter "lock-wait-timeout" can be used to set
the default value parameter upon server startup.

"lock_wait_timeout" applies to all statements that use metadata locks.
These include DML and DDL operations on tables, views, stored procedures
and stored functions. They also include LOCK TABLES, FLUSH TABLES WITH
READ LOCK and HANDLER statements.

The patch also changes thr_lock.c code (table data locks used by MyISAM
and other simplistic engines) to use the same system variable.
InnoDB row locks are unaffected.

One exception to the handling of the "lock_wait_timeout" variable
is delayed inserts. All delayed inserts are executed with a timeout
of 1 year regardless of the setting for the global variable. As the
connection issuing the delayed insert gets no notification of 
delayed insert timeouts, we want to avoid unnecessary timeouts.

It's important to note that the timeout value is used for each lock
acquired and that one statement can take more than one lock.
A statement can therefore block for longer than the lock_wait_timeout 
value before reporting a timeout error. When lock timeout occurs, 
ER_LOCK_WAIT_TIMEOUT is reported.

Test case added to lock_multi.test.
2010-02-11 11:23:39 +01:00
Alexey Kopytov
017c969896 Manual merge of mysql-5.1-bugteam into mysql-trunk-merge.
Conflicts:

Text conflict in .bzr-mysql/default.conf
Text conflict in mysql-test/suite/rpl/r/rpl_slow_query_log.result
Text conflict in mysql-test/suite/rpl/t/rpl_slow_query_log.test
Conflict adding files to server-tools.  Created directory.
Conflict because server-tools is not versioned, but has versioned children.  Versioned directory.
Conflict adding files to server-tools/instance-manager.  Created directory.
Conflict because server-tools/instance-manager is not versioned, but has versioned children.  Versioned directory.
Contents conflict in server-tools/instance-manager/options.cc
Text conflict in sql/mysqld.cc
2010-02-09 12:59:38 +05:00
Vladislav Vaintroub
be65bc9917 merge 2010-02-06 17:13:42 +01:00
Konstantin Osipov
9c030fe508 Merge next-mr -> next-4284. 2010-02-06 13:28:06 +03:00
Marc Alff
3630d78e6c Merge mysql-next-mr-marc --> mysql-next-mr-bugfixing 2010-02-05 09:56:55 -07:00
Marc Alff
02fc9afe81 Merge mysql-next-mr (revno 2996) --> mysql-next-mr-marc 2010-02-05 08:10:20 -07:00
Alexander Nozdrin
1a0f34e6a4 Manual merge from mysql-next-mr.
Conflicts:
  - sql/sys_vars.cc
2010-02-05 15:05:37 +03:00
Konstantin Osipov
89269e5142 Merge next-mr -> next-4284-merge. 2010-02-04 20:34:15 +03:00
Jon Olav Hauglid
34de83e132 Bug #50821 Deadlock between LOCK TABLES and ALTER TABLE
This was a deadlock between ALTER TABLE and another DML statement
(or LOCK TABLES ... READ). ALTER TABLE would wait trying to upgrade
its lock to MDL_EXCLUSIVE and the DML statement would wait trying
to acquire a TL_READ_NO_INSERT table level lock.

This could happen if one connection first acquired a MDL_SHARED_READ
lock on a table. In another connection ALTER TABLE is then started.
ALTER TABLE eventually blocks trying to upgrade to MDL_EXCLUSIVE,
but while holding a TL_WRITE_ALLOW_READ table level lock.

If the first connection then tries to acquire TL_READ_NO_INSERT,
it will block and we have a deadlock since neither connection can
proceed.

This patch fixes the problem by allowing TL_READ_NO_INSERT 
locks to be granted if another connection holds TL_WRITE_ALLOW_READ
on the same table. This will allow the DML statement to proceed
such that it eventually can release its MDL lock which in turn
makes ALTER TABLE able to proceed.

Note that TL_READ_NO_INSERT was already partially compatible with
TL_WRITE_ALLOW_READ as the latter would be granted if the former
lock was held. This patch just makes the opposite true as well.

Also note that since ALTER TABLE takes an upgradable MDL lock,
there will be no starvation of ALTER TABLE statements by
statements acquiring TL_READ or TL_READ_NO_INSERT.

Test case added to lock_sync.test.
2010-02-04 10:00:36 +01:00
Konstantin Osipov
b92ab41c5c Merge next-mr -> next-4284 2010-02-03 16:43:03 +03:00
Konstantin Osipov
0ce6d93f85 Merge next-mr -> next-4284. 2010-02-03 03:06:42 +03:00
Konstantin Osipov
c2fe19883e Merge next-mr -> next-4284.
Fix Bug#50555 "handler commands crash server in my_hash_first()"
as a post-merge fix (the new handler tests are not passing 
otherwise).
- in hash.c, don't call calc_hash if ! my_hash_inited().
- add tests and results for the test case for Bug#50555
2010-02-02 16:58:15 +03:00
Konstantin Osipov
3147bdd0ac Merge next-mr -> next-4284. 2010-02-02 12:22:17 +03:00
Konstantin Osipov
2c6015e8dc Merge next-mr -> next-4284. 2010-02-02 02:22:16 +03:00
Marc Alff
edb122134b Bug#50337 --defaults-file=~/something doesn't work anymore
Before this fix, opening a configuration file located under "~" failed.
To evaluate the "~" path, home_dir needs to be initialized.
The 'home_dir' variable was initialized too late in my_init().

This fix:
- moved the home_dir initialization from my_init() to my_basic_init(),
  using getenv("HOME"))
- moved the initialization of my_umask / my_umask_dir also to
  my_basic_init(), to have all the my_umask / my_umask_dir init code in the
  same place.

The second part is not strictly required, but makes the code more
maintainable.

Tested the fix manually.

No MTR tests added, because MTR should not access or modify the $HOME
directory of the user running tests.
2010-01-25 20:50:31 -07:00
Alexey Kopytov
7b5f5d5c37 Manual merge of mysql-5.1-bugteam into mysql-trunk-merge. 2010-01-24 00:09:23 +03:00
Magne Mahre
0482b6ebca WL#5154 Remove deprecated 4.1 features
Several items said to be deprecated in the 4.1 manual
have never been removed.  This worklog adds deprecation
warnings when these items are used, and warns the user 
that the items will be removed in MySQL 5.6.

A couple of previously deprecation decision have been
reversed (see single file comments)
2010-01-21 09:10:05 +01:00
Vladislav Vaintroub
1f4e48cb10 Bug #50362 comp_err crashes during compilation on FreeBSD.
The reason for the crash is using uinitialized mutex attribute (MY_MUTEX_FAST_INIT)
in pthread_mutex_init.

The fix is to initialize the attribute before the first use.
2010-01-20 14:04:17 +01:00
Vladislav Vaintroub
726e9f5060 Fix AIX error during compile in my_handler (pointer to data is used, while pointer to function is expected).
This also has generated warnings on all other platforms
2010-01-19 18:22:51 +01:00
Vladislav Vaintroub
df4b65b533 Fix various compiler/OS compatibility errors 2010-01-19 16:31:21 +01:00
Alexander Nozdrin
dedfdb490b Manual merge from mysql-next-mr.
Conflicts:
  - sql/sql_plugin.cc
2010-01-18 23:19:19 +03:00
Vladislav Vaintroub
0ebe60070b Bug#50362:
Init MY_PTHREAD_MUTEX_FAST prior to first usage to avoid crash on
FreeBSD
2010-01-16 05:04:02 +01:00
Vladislav Vaintroub
6e7a75bf5f merge 2010-01-14 16:07:27 +01:00
Marc Alff
67a48e1a4c WL#2360 Performance schema
Part V: performance schema implementation
2010-01-11 18:47:27 -07:00
Vladislav Vaintroub
b518871130 merge 2010-01-11 17:46:16 +01:00
Jon Olav Hauglid
0bce0c9041 Fix for bug #48538 "Assertion in thr_lock() on LOAD DATA CONCURRENT
INFILE".

Attempts to execute an INSERT statement for a MEMORY table which invoked
a trigger or called a stored function which tried to perform LOW_PRIORITY
update on the table being inserted into, resulted in debug servers aborting
due to an assertion failure. On non-debug servers such INSERTs failed with
"Can't update table t1 in stored function/trigger because it is already used
by statement which invoked this stored function/trigger" as expected.

The problem was that in the above scenario TL_WRITE_CONCURRENT_INSERT
is converted to TL_WRITE inside the thr_lock() function since the MEMORY
engine does not support concurrent inserts. This triggered an assertion
which assumed that for the same table, one thread always requests locks with
higher thr_lock_type value first. When TL_WRITE_CONCURRENT_INSERT is
upgraded to TL_WRITE after the locks have been sorted, this is no longer true.
In this case, TL_WRITE was requested after acquiring a TL_WRITE_LOW_PRIORITY
lock on the table, triggering the assert.

This fix solves the problem by adjusting this assert to take this
scenario into account.

An alternative approach to change handler::store_locks() methods for all engines
which do not support concurrent inserts in such way that
TL_WRITE_CONCURRENT_INSERT is upgraded to TL_WRITE there instead, 
was considered too intrusive.

Commit on behalf of Dmitry Lenev.
2010-01-08 11:26:32 +01:00
Marc Alff
a4c3bc618b WL#2360 Performance schema
Part IV: sql instrumentation
2010-01-06 22:42:07 -07:00
Sergei Golubchik
31cd0643ae my_once.c: clarify the comment 2009-12-26 21:55:32 +01:00
Vladislav Vaintroub
e8bdef8fcd merge 2009-12-25 16:49:21 +01:00
Alexander Nozdrin
7917f0852f Auto-merge from mysql-trunk-merge. 2009-12-24 10:56:13 +03:00
Alexander Nozdrin
6bb8cd8429 Auto-merge from mysql-trunk. 2009-12-24 10:34:04 +03:00
Alexey Kopytov
af74c3436f Manual merge of mysql-5.1-bugteam into mysql-trunk-merge.
Conflicts:

Conflict adding files to server-tools.  Created directory.
Conflict because server-tools is not versioned, but has versioned children.  Versioned directory.
Conflict adding files to server-tools/instance-manager.  Created directory.
Conflict because server-tools/instance-manager is not versioned, but has versioned children.  Versioned directory.
Contents conflict in server-tools/instance-manager/instance_map.cc
Contents conflict in server-tools/instance-manager/listener.cc
Contents conflict in server-tools/instance-manager/options.cc
Contents conflict in server-tools/instance-manager/user_map.cc
2009-12-23 16:42:05 +03:00
Staale Smedseng
e3c1c83a16 Recommit of Bug#49447. 2010-02-04 13:39:42 +01:00
Sergei Golubchik
ae2768ce9c WL#4738 streamline/simplify @@variable creation process
Bug#16565 mysqld --help --verbose does not order variablesBug#20413 sql_slave_skip_counter is not shown in show variables
Bug#20415 Output of mysqld --help --verbose is incomplete
Bug#25430 variable not found in SELECT @@global.ft_max_word_len;
Bug#32902 plugin variables don't know their names
Bug#34599 MySQLD Option and Variable Reference need to be consistent in formatting!
Bug#34829 No default value for variable and setting default does not raise error
Bug#34834 ? Is accepted as a valid sql mode
Bug#34878 Few variables have default value according to documentation but error occurs  
Bug#34883 ft_boolean_syntax cant be assigned from user variable to global var.
Bug#37187 `INFORMATION_SCHEMA`.`GLOBAL_VARIABLES`: inconsistent status
Bug#40988 log_output_basic.test succeeded though syntactically false.
Bug#41010 enum-style command-line options are not honoured (maria.maria-recover fails)
Bug#42103 Setting key_buffer_size to a negative value may lead to very large allocations 
Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled
Bug#44797 plugins w/o command-line options have no disabling option in --help
Bug#46314 string system variables don't support expressions
Bug#46470 sys_vars.max_binlog_cache_size_basic_32 is broken
Bug#46586 When using the plugin interface the type "set" for options caused a crash.
Bug#47212 Crash in DBUG_PRINT in mysqltest.cc when trying to print octal number
Bug#48758 mysqltest crashes on sys_vars.collation_server_basic in gcov builds
Bug#49417 some complaints about mysqld --help --verbose output
Bug#49540 DEFAULT value of binlog_format isn't the default value
Bug#49640 ambiguous option '--skip-skip-myisam' (double skip prefix)
Bug#49644 init_connect and \0
Bug#49645 init_slave and multi-byte characters
Bug#49646 mysql --show-warnings crashes when server dies
2009-12-22 10:35:56 +01:00
Vladislav Vaintroub
cd94452eda merge 2009-12-19 14:11:48 +01:00
Alexander Nozdrin
f408138c71 Auto-merge from mysql-trunk. 2009-12-19 11:33:33 +03:00
Vladislav Vaintroub
9c9cc49060 merge 2009-12-19 03:21:49 +01:00
Davi Arnaut
26f1a8ead2 Manual merge. 2009-12-18 16:44:24 -02:00
Alexander Nozdrin
5244303ac9 Manual merge from mysql-next-mr.
Conflicts:
  - mysys/charset.c
  - mysys/my_thr_init.c
2009-12-17 23:02:52 +03:00
Alexander Nozdrin
2ba49bee0e Manual merge from mysql-trunk-merge.
Conflicts:
  - storage/myisam/mi_packrec.c
2009-12-17 22:16:54 +03:00
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
Alexey Kopytov
e39d8609ce Automerge from mysql-5.1-bugteam to mysql-trunk-merge. 2009-12-17 18:09:04 +03:00
Satya B
647a955893 merge mysql-5.0-bugteam to mysql-5.1-bugteam 2009-12-17 17:15:13 +05:30
Satya B
801deedcf2 Fix for Bug#37408 - Compressed MyISAM files should not require/use mmap()
When compressed myisam files are opened, they are always memory mapped
sometimes causing memory swapping problems.

When we mmap the myisam compressed tables of size greater than the memory 
available, the kswapd0 process utilization is very high consuming 30-40% of 
the cpu. This happens only with linux kernels older than 2.6.9

With newer linux kernels, we don't have this problem of high cpu consumption
and this option may not be required.
 
The option 'myisam_mmap_size' is added to limit the amount of memory used for
memory mapping of myisam files. This option is not dynamic.

The default value on 32 bit system is 4294967295 bytes and on 64 bit system it
is 18446744073709547520 bytes.

Note: Testcase only tests the option variable. The actual bug has be to 
tested manually.
2009-12-17 16:55:50 +05:30
Marc Alff
92630be0ee Merge mysql-next-mr (revno 2939) --> mysql-next-mr-marc 2009-12-17 02:12:02 -07:00
Marc Alff
67d945d270 Merge mysql-next-mr (revno 2942) --> mysql-next-mr-marc 2009-12-16 15:48:55 -07:00
Alexander Nozdrin
134fc397f8 Auto-merge from mysql-next-mr-summit0.3. 2009-12-16 21:50:45 +03:00
Alexander Nozdrin
09942fe8e8 Manual merge from mysql-trunk-merge.
Conflicts:
  - include/my_no_pthread.h
  - mysql-test/r/sp-ucs2.result
  - sql/log.cc
  - sql/sql_acl.cc
  - sql/sql_yacc.yy
2009-12-16 21:02:21 +03:00
Vladislav Vaintroub
2ff2d1873a merge 2009-12-16 15:34:11 +01:00
Alexey Kopytov
efe6195858 Manual merge of mysql-5.1-bugteam into mysql-trunk-merge. 2009-12-16 16:47:07 +03:00
Alexander Nozdrin
a1218bb782 Auto-merge from mysql-trunk. 2009-12-16 13:27:39 +03:00
Alexander Nozdrin
a7073e53a4 Auto-merge from mysql-trunk. 2009-12-16 12:52:37 +03:00
Mikael Ronstrom
fdd269ad94 Merge to latest mysql-next-mr 2009-12-16 09:49:16 +01:00
Konstantin Osipov
13348d3769 Merge next-mr -> next-4284. 2009-12-16 11:33:54 +03:00
Alexander Nozdrin
642f075569 Auto-merge from mysql-trunk. 2009-12-16 11:25:21 +03:00
Alexander Nozdrin
2ae8acc294 Remove .cvsignore files (attempt #2). 2009-12-16 11:24:30 +03:00
Alexander Nozdrin
25f365f610 Backporting patch for Bug#47756
from mysql-next-mr-bugfixing into mysql-trunk-bugfixing.

NOTE: the "utf8_phone_ci" collation does not exist in mysql-trunk yet,
so another collation with 2-byte collation ID is used: "utf8_test_ci".

This patch will be null-merged to mysql-next-mr-bugfixing.

Original revision:
------------------------------------------------------------
revision-id: bar@mysql.com-20091207121153-hs3bqbmr0719ws21
committer: Alexander Barkov <bar@mysql.com>
branch nick: mysql-next-mr.b47756
timestamp: Mon 2009-12-07 16:11:53 +0400
message:
  Bug#47756 Setting 2byte collation ID with 'set names' crashes the server
  
  The problem is not actually related to 2byte collation IDs.
  The same crash happens if you change the collation ID in
  mysql-test/str_data/Index.xml to a value smaller than 256.
  
  Crash happened in SQL parser, because the "ident_map" and "state_map"
  arrays were not initialized in loadable utf8 collations.
  
  Fix: adding proper initialization of the "ident_map" and "state_map"
  members for loadable utf8 collations.
------------------------------------------------------------
2009-12-15 23:20:53 +03:00
Konstantin Osipov
e931ef415a Merge next-mr -> next-4284. 2009-12-15 22:59:07 +03:00
Konstantin Osipov
7a6e5c3f4c Merge next-mr -> next-4284. 2009-12-15 21:45:22 +03:00
Alexander Barkov
9c47ea8380 Bug#49134 5.1 server segfaults with 2byte collation file
Problem: add_collation did not check that cs->number is smaller
than the number of elements in the array all_charsets[],
so server could crash when loading an Index.xml file with
a collation ID greater the number of elements 
(for example when downgrading from 5.5).

Fix: adding a condition to check that cs->number is not out of valid range.
2009-12-15 13:48:29 +04:00
Mikael Ronstrom
5a31a8f619 Merge 2009-12-14 17:08:30 +01:00
Alexander Nozdrin
bc2d4e620a Manual merge from mysql-trunk-merge.
Conflicts:
  - extra/comp_err.c
  - mysql-test/collections/default.experimental
  - mysql-test/r/archive.result
  - mysql-test/r/select.result
  - mysql-test/suite/binlog/r/binlog_unsafe.result
  - mysql-test/suite/binlog/t/binlog_unsafe.test
  - mysql-test/suite/rpl/t/disabled.def
  - mysql-test/t/archive.test
  - mysql-test/t/select.test
  - sql/item.cc
  - sql/item.h
  - sql/item_timefunc.cc
  - sql/sql_base.cc
  - sql/sql_delete.cc
  - sql/sql_load.cc
  - sql/sql_partition.cc
  - sql/sql_table.cc
  - storage/innobase/handler/ha_innodb.cc
  - vio/vio.c
2009-12-12 23:38:59 +03:00
Staale Smedseng
983770aa6a Bug #45058 init_available_charsets uses double checked locking
As documented in the bug report, the double checked locking
pattern has inherent issues, and cannot guarantee correct
initialization.

This patch replaces the logic in init_available_charsets()
with the use of pthread_once(3). A wrapper function,
my_pthread_once(), is introduced and is used in lieu of direct
calls to init_available_charsets(). Related defines
MY_PTHREAD_ONCE_* are also introduced.

For the Windows platform, the implementation in lp:sysbench is
ported. For single-thread use, a simple define calls the
function and sets the pthread_once control variable.

Charset initialization is modified to use my_pthread_once().
2009-12-12 19:11:25 +01:00
Vladislav Vaintroub
91d9e6b670 merge 2009-12-11 21:17:17 +01:00
Alexey Kopytov
72b2943594 Manual merge of mysql-5.1-bugteam into mysql-trunk-merge. 2009-12-11 19:40:58 +03:00
Alexander Nozdrin
69cfd5c8ec Manual merge from mysql-trunk.
Conflicts:
  - client/mysqltest.cc
  - mysql-test/collections/default.experimental
  - mysql-test/suite/rpl/t/disabled.def
  - sql/mysqld.cc
  - sql/opt_range.cc
  - sql/sp.cc
  - sql/sql_acl.cc
  - sql/sql_partition.cc
  - sql/sql_table.cc
2009-12-11 12:39:38 +03:00
Marc Alff
edd5ff174c Merge mysql-next-mr (revno 2936) --> mysql-next-mr-marc 2009-12-11 01:58:13 -07:00
Alexander Nozdrin
324e1a9dbc Auto-merge from mysql-next-mr. 2009-12-10 17:44:36 +03:00
Vladislav Vaintroub
6c3bbb2800 merge 2009-12-10 11:47:31 +01:00
Marc Alff
e33a8b2a1a WL#2360 Performance schema
Part III: mysys instrumentation
2009-12-09 20:19:51 -07:00
Jon Olav Hauglid
1b5f2b9030 Backport of revno: 2617.68.18
Bug #42147 Concurrent DML and LOCK TABLE ... READ for InnoDB 
           table cause warnings in errlog

Concurrent execution of LOCK TABLES ... READ statement and DML statements 
affecting the same InnoDB table on debug builds of MySQL server might lead 
to "Found lock of type 6 that is write and read locked" warnings appearing 
in error log.

The problem is that the table-level locking code allows a thread to acquire
TL_READ_NO_INSERT lock on a table even if there is another thread which holds 
TL_WRITE_ALLOW_WRITE lock on the same table. At the same time, the locking
code assumes that that such locks are incompatible (for example, see check_locks()).

This doesn't lead to any problems other than warnings in error log for
debug builds of server since for InnoDB tables TL_READ_NO_INSERT type of
lock is only used for LOCK TABLES and for this statement InnoDB also
performs its own table-level locking.

Unfortunately, the table lock compatibility matrix cannot be updated to disallow
TL_READ_NO_INSERT when another thread holds TL_WRITE_ALLOW_WRITE without 
causing starvation of LOCK TABLE READ in InnoDB under high write load. 
This patch therefore contains no code changes.

The issue will be fixed later when LOCK TABLE READ has been updated
to not use table locks. This bug will therefore be marked as 
"To be fixed later".

Code comment in thr_lock.c expanded to clarify the issue and a 
test case based on the bug description added to innodb_mysql_lock.test.
Note that a global suppression rule has been added to both MTR v1 and v2
for the "Found lock of type 6 that is write and read locked" warning.
These suppression rules must be removed once this bug is properly fixed.
2009-12-09 16:13:00 +01:00
Vladislav Vaintroub
b5761e6348 couple of tweaks for solaris on sparc, link with librt, as it defines sched_yield 2009-12-08 03:12:23 +01:00
Alexander Barkov
487e176b20 Bug#47756 Setting 2byte collation ID with 'set names' crashes the server
The problem is not actually related to 2byte collation IDs.
The same crash happens if you change the collation ID in
mysql-test/str_data/Index.xml to a value smaller than 256.

Crash happened in SQL parser, because the "ident_map" and "state_map"
arrays were not initialized in loadable utf8 collations.

Fix: adding proper initialization of the "ident_map" and "state_map"
members for loadable utf8 collations.
2009-12-07 16:11:53 +04:00
Vladislav Vaintroub
a1ebd4245e On Linux, support -Wl,--no-undefined (only client shared library)
and --Wl,--as-needed (all shared modules). The later will remove
unused dependencies (also from gcc and C++ runtime)
2009-12-07 02:16:05 +01:00
Staale Smedseng
d5391ed61d Merge from 5.0 2009-12-06 19:01:11 +01:00
Marc Alff
57fd11788e WL#2360 Performance schema
Part II, engines instrumentation
2009-12-04 18:26:15 -07:00
Vladislav Vaintroub
aea6035c73 merge 2009-12-04 20:05:04 +00:00
Alexander Nozdrin
ba38e6014f Auto-merge from mysql-next-mr. 2009-12-04 15:39:09 +03:00
Konstantin Osipov
c44665aeb1 Backport of:
------------------------------------------------------------
revno: 3035.4.1
committer: Davi Arnaut <Davi.Arnaut@Sun.COM>
branch nick: 39897-6.0
timestamp: Thu 2009-01-15 12:17:57 -0200
message:
Bug#39897: lock_multi fails in pushbuild: timeout waiting for processlist

The problem is that relying on the "Table lock" thread state in
its current position to detect that a thread is waiting on a lock
is race prone. The "Table lock" state change happens before the
thread actually tries to grab a lock on a table.

The solution is to move the "Table lock" state so that its set
only when a thread is actually going to wait for a lock. The state
change happens after the thread fails to grab the lock (because it
is owned by other thread) and proceeds to wait on a condition.

This is considered part of work related to WL#4284 "Transactional
DDL locking"
Warning: this patch contains an incompatible change. 
When waiting on a lock in thr_lock.c, the server used to display "Locked"
processlist state. After this patch, the state is "Table lock".
The new state was actually intended to be display since year 2002,
when Monty added it. But up until removal of thd->locked boolean
member, this state was ignored by SHOW PROCESSLIST code.
2009-12-03 23:08:27 +03:00
Konstantin Osipov
36897c862b Backport of:
-----------------------------------------------------------
2497.479.10 Sergei Golubchik    2008-08-27
            proc_info_hook, mysys access to thd->proc_info

This patch is necessary for backport of WL#4284 "Transactional
DDL locking".
2009-12-03 21:59:52 +03:00
Konstantin Osipov
d64cf75806 Merge next-mr -> next-4284 2009-12-03 14:37:42 +03:00
Konstantin Osipov
ef15a335b3 Backport of:
----------------------------------------------------------
revno: 2630.4.38
committer: Konstantin Osipov <konstantin@mysql.com>
branch nick: mysql-6.0-4144
timestamp: Wed 2008-06-25 22:07:06 +0400
message:
  WL#4144 - Lock MERGE engine children.
  Committing a version of the patch merged with WL#3726
  on behalf of Ingo.

  Step #1: Move locking from parent to children.

  MERGE children are now left in the query list of tables
  after inserted there in open_tables(). So they are locked
  by lock_tables() as all other tables are.

  The MERGE parent does not store locks any more. It appears
  in a MYSQL_LOCK with zero lock data. This is kind of a "dummy"
  lock.

  All other lock handling is also done directly on the children.
  To protect against parent or child modifications during LOCK
  TABLES, the children are detached after every statement and
  attached before every statement, even under LOCK TABLES.

  The children table list is removed from the query list of tables
  on every detach and on close of the parent.

  Step #2: Move MERGE specific functionality from SQL layer
  into table handler.

  Functionality moved from SQL layer (mainly sql_base.cc)
  to the table handler (ha_myisammrg.cc).

  Unnecessary code is removed from the SQL layer.

  Step #3: Moved all MERGE specific members from TABLE
  to ha_myisammrg.

  Moved members from TABLE to ha_myisammrg.
  Renamed some mebers.
  Fixed comments.

  Step #4: Valgrind and coverage testing

  Valgrind did not uncover new problems.
  Added purecov comments.

  Added a new test for DATA/INDEX DIRECTORY options.
  Changed handling of ::reset() for non-attached children.
  Fixed the merge-big test.

  Step #5: Fixed crashes detected during review
  Changed detection when to attach/detach.
  Added new tests.

Backport also the fix for Bug#44040 "MySQL allows creating a 
MERGE table upon VIEWs but crashes when using it"
2009-12-03 02:09:22 +03:00
Vladislav Vaintroub
82b605ea37 merge 2009-12-02 22:16:33 +01:00
Konstantin Osipov
416a626368 Backport of:
----------------------------------------------------------
revno: 2630.4.35
committer: Konstantin Osipov <konstantin@mysql.com>
branch nick: mysql-6.0-3726
timestamp: Wed 2008-06-25 16:44:00 +0400
message:
  Fix a MyISAM-specific bug in the new implementation of
  LOCK TABLES (WL#3726).
  If more than one instance of a MyISAM table are open in the
  same connection, all of them must share the same status_param.
  Otherwise, unlock of a table may lead to lost records.
  See also comments in thr_lock.c.
2009-12-02 23:47:23 +03:00
Marc Alff
bd2c80057f Merge mysql-next-mr (revno 2927) --> mysql-next-mr-marc 2009-12-02 11:36:20 -07:00
Alexander Nozdrin
f26ac4ba7a Manual merge from mysql-next-mr.
Conflicts:
  - sql/sql_yacc.yy
2009-12-02 18:50:14 +03:00
Andrei Elkin
e8e85ed2a6 Manual resolving for the following files
Text conflict in mysql-test/collections/default.experimental
Text conflict in mysql-test/r/show_check.result
Text conflict in mysql-test/r/sp-code.result
Text conflict in mysql-test/suite/binlog/r/binlog_tmp_table.result
Text conflict in mysql-test/suite/rpl/t/disabled.def
Text conflict in mysql-test/t/show_check.test
Text conflict in mysys/my_delete.c
Text conflict in sql/item.h
Text conflict in sql/item_cmpfunc.h
Text conflict in sql/log.cc
Text conflict in sql/mysqld.cc
Text conflict in sql/repl_failsafe.cc
Text conflict in sql/slave.cc
Text conflict in sql/sql_parse.cc
Text conflict in sql/sql_table.cc
Text conflict in sql/sql_yacc.yy
Text conflict in storage/myisam/ha_myisam.cc

Corrected results for
 stm_auto_increment_bug33029.reject      2009-12-01
		20:01:49.000000000 +0300
       <andrei> @@ -42,9 +42,6 @@
       <andrei>  RETURN i;
       <andrei>  END//
       <andrei>  CALL p1();
       <andrei> -Warnings:
       <andrei> -Note   1592    Statement may not be safe to log in statement
		format.
       <andrei> -Note   1592    Statement may not be safe to log in statement
		format.

There should be indeed no Note present because there is in fact autoincrement 
top-level query in sp() that triggers inserting in yet another auto-inc table.
(todo: alert DaoGang to improve the test).
2009-12-01 21:07:18 +02:00
Vladislav Vaintroub
f7269ba0c7 fix build errors 2009-12-01 18:28:13 +00:00
Alexey Kopytov
1f0f7f3929 Automerge of mysql-5.1-bugteam into mysql-trunk-merge. 2009-12-01 17:58:44 +03:00
Marc Alff
fa3cfa07dd WL#2360 Performance schema
Part 1: Instrumentation interface
2009-11-30 17:49:15 -07:00
Andrei Elkin
a6f2076c03 merging from 5.1 to rep+2 starting at gca(5.1, next-mr) == build@mysql.com-20091104182209-iui387z35159aoyw 2009-11-30 14:34:39 +02:00
Vladislav Vaintroub
f458a4c963 merge 2009-11-30 01:49:26 +00:00
Mikael Ronstrom
6d1c5b5563 Merged in WL#5105 2009-11-27 18:28:35 +01:00
Mikael Ronstrom
9827610d83 Merge WL#5137 to mysql-next-mr 2009-11-27 17:16:58 +01:00
Kent Boortz
ea19feebda Move DBG_* macros to after the variable declaration section in a
block, might expand to function calls (Bug#48331)
2009-11-25 16:48:29 +01:00
Vladislav Vaintroub
53cc3b7bf8 merge 2009-11-25 15:20:14 +01:00
Alexander Nozdrin
4b28a6ce84 Auto-merge from mysql-next-mr. 2009-11-25 16:46:45 +03:00
Alexander Nozdrin
2fa93b849d Auto-merge (pull) from mysql-next-mr. 2009-11-26 11:46:29 +03:00
Alexander Nozdrin
a8d553e0e3 Manual merge/pull from mysql-next-mr.
Conflicts:
  - sql/sql_insert.cc
2009-11-25 18:03:05 +03:00
Vladislav Vaintroub
2f3e777797 add --disable-shared equivalent
fix mtr (empty argument passed to mysqld)
2009-11-25 05:13:51 +01:00
Vladislav Vaintroub
a3e391dd3c merge 2009-11-25 01:50:10 +01:00
Marc Alff
6e01be7552 WL#2373 Use cycle counter for timing 2009-11-24 16:36:31 -07:00
Vladislav Vaintroub
afe4ee1e17 implement convenience libraries 2009-11-24 23:15:47 +00:00
Alexander Nozdrin
0a9d4e675a Auto-merge from mysql-next-mr. 2009-11-24 22:39:05 +03:00
Luis Soares
799333b590 BUG#42150: binlog_start_comment.test failed: Error writing file 'UNOPENED'
NOTE: backporting BUG#42150 into next-mr
      Includes latest Andrei's patch (see [2 Feb 18:40] Bugs System)
      and merge.test post-push fix (see [3 Feb 18:04] Bugs System)

The reason of the bug appeared to be overreacting on absense of a
binlog file although the file name had been presented in in the master
binlog index file.
By convention, there should have been only a warning printed and the rest of
`reset master' logics completed.  This did not happen on windows
due to incorrect value of my_errno returned from nt_share_delete().
      
Fixed with correcting my_errno assignment in nt_share_delete() to be ENOENT in 
he event of no binlog file. Some minor refactoring has been made.
2009-11-24 15:00:08 +00:00
Konstantin Osipov
4cff617c25 Backport of:
----------------------------------------------------------------------
ChangeSet@1.2571, 2008-04-08 12:30:06+02:00, vvaintroub@wva. +122 -0
  Bug#32082 : definition of VOID in my_global.h conflicts with Windows
  SDK headers
  
  VOID macro is now removed. Its usage is replaced with void cast.
  In some cases, where cast does not make much sense (pthread_*, printf, 
  hash_delete, my_seek), cast is ommited.
2009-11-24 16:54:59 +03:00
Alexey Kopytov
f16b372b37 Manual merge from the mysql-5.1-bugteam. 2009-11-24 11:31:36 +03:00
Alexey Kopytov
acf5330ab8 Manual merge from the mysql-5.1-bugteam. 2009-11-24 11:19:06 +03:00
Konstantin Osipov
26cd9abe4f A follow up for the fix for Bug#35164 (remove priorities on Windows). 2009-11-23 20:08:37 +03:00
Konstantin Osipov
7edfae4e86 Backport of:
-------------------------------------------------------------
revno: 2877
committer: Davi Arnaut <Davi.Arnaut@Sun.COM>
branch nick: 35164-6.0
timestamp: Wed 2008-10-15 19:53:18 -0300
message:
Bug#35164: Large number of invalid pthread_attr_setschedparam calls
Bug#37536: Thread scheduling causes performance degradation at low thread count
Bug#12702: Long queries take 100% of CPU and freeze other applications under Windows

The problem is that although having threads with different priorities
yields marginal improvements [1] in some platforms [2], relying on some
statically defined priorities (QUERY_PRIOR and WAIT_PRIOR) to play well
(or to work at all) with different scheduling practices and disciplines
is, at best, a shot in the dark as the meaning of priority values may
change depending on the scheduling policy set for the process.

Another problem is that increasing priorities can hurt other concurrent
(running on the same hardware) applications (such as AMP) by causing
starvation problems as MySQL threads will successively preempt lower
priority processes. This can be evidenced by Bug#12702.

The solution is to not change the threads priorities and rely on the
system scheduler to perform its job. This also enables a system admin
to increase or decrease the scheduling priority of the MySQL process,
if intended.

Furthermore, the internal wrappers and code for changing the priority
of threads is being removed as they are now unused and ancient.

1. Due to unintentional side effects. On Solaris this could artificially
help benchmarks as calling the priority changing syscall millions of
times is more beneficial than the actual setting of the priority.

2. Where it actually works. It has never worked on Linux as the default
scheduling policy SCHED_OTHER only accepts the static priority 0.
2009-11-23 19:57:31 +03:00
Georgi Kodinov
b75392782c Additional fix for bug #45613: handle failures from my_hash_insert
Testing for presence of stuff in a hash inside the function
that's filling in the hash creates chicken-and-egg type of problems.
This results in test suite failures in mysql-pe in debug mode and 
adds bad initialization dependency in 5.1.
Fixed by removing the debug code.
2009-11-23 17:32:10 +02:00
Alexander Nozdrin
828e2ddc43 Auto-merge from mysql-next-mr. 2009-11-23 17:09:36 +03:00
Kristofer Pettersson
8e80deb52f merge 2009-11-20 21:56:43 +01:00
Mikael Ronstrom
6e02272abb WL#5105, review fix 2009-11-20 20:01:43 +01:00
Mikael Ronstrom
202553ae7b WL#5137, Remove hash calculation from LOCK_open in open_table 2009-11-20 19:27:54 +01:00
Mikael Ronstrom
5a1ac83326 WL#5105, Optimize ptr_cmp on Solaris by using memcmp instead of native ptr_cmp 2009-11-20 18:53:56 +01:00
Marc Alff
22de5f4b1e Merge mysql-next-mr (revno 2923) --> mysql-next-mr-marc 2009-11-20 09:23:13 -07:00
Vladislav Vaintroub
134d5e3a31 merge 2009-11-20 16:41:07 +01:00
Kristofer Pettersson
3771d623b1 Bug#45613 handle failures from my_hash_insert
Not all my_hash_insert() calls are checked for return value.

This patch adds appropriate checks and failure responses
where needed.
2009-11-20 16:18:01 +01:00
Konstantin Osipov
d51a4fae32 Merge with next-mr 2009-11-20 17:18:37 +03:00
Georgi Kodinov
fe9341129b merge 2009-11-20 15:39:15 +02:00
Davi Arnaut
ecb6228c62 Manual merge of mysql-next-mr-runtime upstream. 2009-11-19 21:48:08 -02:00
Marc Alff
1848b862e1 Port the unit test framework to windows
Backport from 6.0.14 to 5.6.0

Original code from Guilhem Bichot
2009-11-17 21:29:26 -07:00
Marc Alff
3ff74fb5fa WL#3230 concurrent hash
Backport from 6.0.14 to 5.6.0

Original code from Sergei Golubchik
2009-11-17 19:31:40 -07:00
Marc Alff
1e46d6a032 WL#2595 kernel-independent atomic operations
Backport from 6.0.14 to 5.6.0

Original code from Sergei Golubchik
2009-11-17 17:11:32 -07:00
Alexey Botchkov
12043816fa merging. 2009-11-17 15:27:40 +04:00
Vladislav Vaintroub
2925dcd169 automerge 2009-11-13 13:26:16 +01:00
Davi Arnaut
a7bbc779ae Backport of Bug#15192 to mysql-next-mr
------------------------------------------------------------
revno: 2597.4.17
revision-id: sp1r-davi@mysql.com/endora.local-20080328174753-24337
parent: sp1r-anozdrin/alik@quad.opbmk-20080328140038-16479
committer: davi@mysql.com/endora.local
timestamp: Fri 2008-03-28 14:47:53 -0300
message:
  Bug#15192 "fatal errors" are caught by handlers in stored procedures

  The problem is that fatal errors (e.g.: out of memory) were being
  caught by stored procedure exception handlers which could cause
  the execution to not be stopped due to a continue handler.

  The solution is to not call any exception handler if the error is
  fatal and send the fatal error to the client.
2009-11-10 18:31:28 -02:00
Mikael Ronstrom
1edf7e71fe Review comments for LOCK_open patch 2009-11-10 15:09:44 +01:00
Alexander Nozdrin
dadf820743 Auto-merge from mysql-next-mr. 2009-11-10 10:31:33 +03:00
Vladislav Vaintroub
13cd7170cc WL#5161 : Cross-platform build with CMake 2009-11-09 12:32:48 +01:00
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
Alexander Nozdrin
2ca5b2c791 Manual merge from mysql-trunk-merge. 2009-11-06 17:20:27 +03:00
timothy.smith@sun.com
76903202dd Use C comments in C code 2009-11-05 21:22:17 +01:00
Alexander Nozdrin
411a6bfeb9 Auto-merge from mysql-next-mr. 2009-11-05 15:08:37 +03:00
Alexander Nozdrin
5ae8ae3a8e Manual merge from mysql-5.1. 2009-11-05 12:20:41 +03:00
Magne Mahre
6e916e03bd Bug#35224: mysqldump --help is very confusing
The presence of "--skip" parameters is obscure, when it should be
obvious from the text.
  
Now, for boolean options, when they're default to ON and the --skip
is more useful parameter, then tell the user of its existence.

Backported from 6.0-codebase, revid  2572.14.1
2009-11-03 10:22:22 +01:00
Sergei Golubchik
d101d144df WL#4903 Plugin Service API part I
(mysql-next-mr backport)
2009-11-02 21:05:42 +01:00
Alexander Nozdrin
8c95f3c53b Manual merge from mysql-next-mr. 2009-11-02 14:10:04 +03:00
Sergei Golubchik
6eaf0b5acb backport of dbug extensions from 6.0:
function/ syntax
  glob(7) wildcards
  unit tests
2009-10-30 19:13:58 +01:00
Alexander Nozdrin
ac7ba1bcaa Merge from mysql-next-mr. 2009-10-28 10:55:44 +03:00
Tatiana A. Nurnberg
2f069a2c9b Bug#46586: When using the plugin interface the type "set" for options caused a crash.
"What do you mean, there's a bug? There isn't even code!"

There was some token code for plug-in variables of the SET type,
but clearly this never worked, or was subject to massive bit rot
since. Bug-fixes ... fail-safes ... tests -- fais au mieux, mon chou!
2009-10-27 06:16:02 -07:00
Kristofer Pettersson
bda3647e62 Bug#46043 mysqld --skip-innodb does not skip InnoDB
The prefix --skip- didn't work on 64 bit big endian machines
because of how the value pointer was casted.
2009-11-09 23:28:31 +01:00
Alexander Nozdrin
c6aeab8cfe Automerge from mysql-next-mr. 2009-10-27 12:59:09 +03:00
Dmitry Lenev
dfa2acb141 Fix for bug #45143 "All connections hang on concurrent ALTER TABLE".
Concurrent execution of statements which require non-table-level
write locks on several instances of the same table (such as
SELECT ... FOR UPDATE which uses same InnoDB table twice or a DML
statement which invokes trigger which tries to update same InnoDB
table directly and through stored function) and statements which
required table-level locks on this table (e.g. LOCK TABLE ... WRITE,
ALTER TABLE, ...) might have resulted in a deadlock.

The problem occured when a thread tried to acquire write lock
(TL_WRITE_ALLOW_WRITE) on the table but had to wait since there was
a pending write lock (TL_WRITE, TL_WRITE_ALLOW_READ) on this table
and we failed to detect that this thread already had another instance
of write lock on it (so in fact we were trying to acquire recursive
lock) because there was also another thread holding write lock on the
table (also TL_WRITE_ALLOW_WRITE). When the latter thread released
its lock neither the first thread nor the thread trying to acquire
TL_WRITE/TL_WRITE_ALLOW_READ were woken up (as table was still write
locked by the first thread) so we ended up with a deadlock.

This patch solves this problem by ensuring that thread which
already has write lock on the table won't wait when it tries
to acquire second write lock on the same table.
2009-10-26 22:38:03 +03:00
Alexander Nozdrin
069d78c067 Merge from mysql-next-mr. 2009-10-23 15:22:21 +04:00
Luis Soares
58e2fde011 manual merge: mysql-5.1-rep+2-delivery1 --> mysql-5.1-rpl-merge
Conflicts
=========

Text conflict in .bzr-mysql/default.conf
Text conflict in libmysqld/CMakeLists.txt
Text conflict in libmysqld/Makefile.am
Text conflict in mysql-test/collections/default.experimental
Text conflict in mysql-test/extra/rpl_tests/rpl_row_sp006.test
Text conflict in mysql-test/suite/binlog/r/binlog_tmp_table.result
Text conflict in mysql-test/suite/rpl/r/rpl_loaddata.result
Text conflict in mysql-test/suite/rpl/r/rpl_loaddata_fatal.result
Text conflict in mysql-test/suite/rpl/r/rpl_row_create_table.result
Text conflict in mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result
Text conflict in mysql-test/suite/rpl/r/rpl_stm_log.result
Text conflict in mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result
Text conflict in mysql-test/suite/rpl_ndb/r/rpl_ndb_sp006.result
Text conflict in mysql-test/t/mysqlbinlog.test
Text conflict in sql/CMakeLists.txt
Text conflict in sql/Makefile.am
Text conflict in sql/log_event_old.cc
Text conflict in sql/rpl_rli.cc
Text conflict in sql/slave.cc
Text conflict in sql/sql_binlog.cc
Text conflict in sql/sql_lex.h
21 conflicts encountered.

NOTE
====
 mysql-5.1-rpl-merge has been made a mirror of mysql-next-mr:
 - "mysql-5.1-rpl-merge$ bzr pull ../mysql-next-mr"

 This is the first cset (merge/...) committed after pulling 
 from mysql-next-mr.
2009-10-22 23:30:28 +01:00
Alexander Barkov
344ddc85fa Merging mysql-next-mr-merge to mysql-next-mr. 2009-10-21 15:48:22 +05:00
Alexander Nozdrin
3fd2f50b6c Merge from mysql-trunk-merge. 2009-10-19 17:36:19 +04:00
Alexander Nozdrin
b930b18ec3 Merge from mysql-5.1. 2009-10-19 17:28:31 +04:00
Alexander Nozdrin
f3457a73d6 Merge from mysql-5.1. 2009-10-19 17:17:08 +04: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
0e5dd3712a Upmerge a Windows compile fix from 5.0 to 5.1. 2009-10-16 14:21:20 +02:00
Joerg Bruehe
9ceeabd9b2 Compile fix for Windows:
Use "#ifdef", not plain "#if".
2009-10-16 14:06:33 +02:00
Sergey Glukhov
7741d9b50d WL#751 Error message construction, backport 2009-10-15 17:23:43 +05:00
Alexander Barkov
f8a54c72ff Backporting WL#4164 Two-byte collation IDs 2009-10-15 15:17:32 +05:00
Konstantin Osipov
64dbe379d7 Backport of:
----------------------------------------------------------
revno: 2617.22.5
committer: Konstantin Osipov <kostja@sun.com>
branch nick: mysql-6.0-runtime
timestamp: Tue 2009-01-27 05:08:48 +0300
message:
  Remove non-prefixed use of HASH.
  Always use my_hash_init(), my_hash_inited(), my_hash_search(),
  my_hash_element(), my_hash_delete(), my_hash_free() rather
  than non-prefixed counterparts (hash_init(), etc).
  Remove the backward-compatible defines.
2009-10-14 20:37:38 +04:00
Konstantin Osipov
a1fbd5e0c3 Backport of:
----------------------------------------------------------
revno: 2630.22.39
committer: Konstantin Osipov <kostja@sun.com>
branch nick: mysql-6.0-runtime
timestamp: Wed 2008-10-08 23:44:34 +0400
message:
  Bug #34481 A typo in HugeTLB error Message.
2009-10-14 17:52:13 +04:00
Alexander Nozdrin
ca08f10ccd Manual merge from mysql-trunk-merge. 2009-10-14 12:25:39 +04:00
Alexander Nozdrin
32e51de7f5 Merge from mysql-5.1. 2009-10-14 11:17:49 +04:00
Alexander Nozdrin
0f51423532 Merge from mysql-5.1. 2009-10-13 13:42:38 +04:00
Alexey Botchkov
de7619823d Bug#47216 programs should quit if the file specified by --defaults-file option isn't found
added code to exit a tool if the forced config file wasn't found

per-file comments:
  client/mysql.cc
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysql_upgrade.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysqladmin.cc
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysqlcheck.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysqldump.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysqlimport.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysqlshow.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysqlslap.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  mysql-test/t/mysql.test
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
   test added
  sql/mysqld.cc
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  storage/myisam/myisamchk.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  storage/myisam/myisampack.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
2009-10-09 19:44:22 +05:00
Joerg Bruehe
7a69adf492 Upmerge (automerge) into 5.1 2009-10-09 15:21:45 +02:00
Alexander Nozdrin
84510f0375 Merge from mysql-next-mr. 2009-10-09 17:09:16 +04:00
Mikael Ronstrom
5e7733bc18 A minor change to MySQL's hash where calculation of hash can be done separately to avoid doing it under contended mutex locks 2009-10-09 14:22:22 +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
Alexander Nozdrin
f4d27e81bb Merge from mysql-next-mr. 2009-10-08 11:42:38 +04: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
Alexander Barkov
a16a82d4eb Bsckporting WL#3764 Sinhala Collation
modified:
  mysql-test/r/ctype_utf8.result
  mysql-test/t/ctype_utf8.test
  mysys/charset-def.c
  strings/ctype-uca.c
2009-10-06 15:34:49 +05: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