Commit graph

61739 commits

Author SHA1 Message Date
Alexander Nozdrin
f3635be031 A patch for Bug#52444 (mysql_upgrade fails b/w 5.1 -> 5.5 (Celosia)).
The problem was that the code that works with stored routines was present
in mysql_system_tables.sql. This is wrong because until upgrade is finished,
stored routines may be (and were) not available.

The fix is to move that code to the end of mysql_system_tables_fix.sql.
2010-04-14 20:40:04 +04:00
Jon Olav Hauglid
d18275c2c2 Bug #52593 SHOW CREATE TABLE is blocked if table is locked
for write by another connection

The problem was that if a table was locked in one connection by
LOCK TABLES ... WRITE, REPAIR TABLE or OPTIMIZE TABLE, SHOW CREATE
TABLE from another connection would be blocked. As SHOW CREATE TABLE
only reads metadata about the table, such blocking is not needed.

The problem was that when SHOW CREATE TABLE tried to get a metadata
lock on the table in order to open it, it used the wrong type of
metadata lock request. It used MDL_SHARED_READ which is used when
the intent is to read both table metadata and table data. Instead
it should have used MDL_SHARED_HIGH_PRIO which signifies an intent
to only read metadata.

This patch fixes the problem by making sure SHOW CREATE TABLE uses
the MDL_SHARED_HIGH_PRIO metadata lock request type when trying to
open the table. The patch also fixes a similar problem with the
mysql_list_fields API call.

Test case added to show_check.test.
2010-04-14 09:40:45 +02:00
Jon Olav Hauglid
7e6eddd374 Bug #52367 Deadlock involving SET GLOBAL EVENT_SCHEDULER = OFF
during rqg_mdl_deadlock test

The problem was that if two connection threads simultaneously tries
to execute "SET GLOBAL EVENT_SCHEDULER = OFF", one of them could
hang waiting for the scheduler to stop.

The first connection thread would kill the event scheduler thread
and then start waiting for it to exit. The second connection thread
would then find the event scheduler thread in the process of exiting
and also wait for it to exit. However, since the event scheduler 
thread used signal to wake only one waiting thread, the other connection
thread would be left waiting.

This bug was a regression introduced by the fix for Bug#51160.
Before #51160 it was not possible for two connection threads to 
try to stop the event scheduler thread simultaneously.

This patch fixes the problem my making sure the event scheduler
thread uses broadcast to notify all waiters that it is exiting.

No test case added as this would require adding debug sync points
to parts of the code where sync points are currently not used.
The patch has been tested with the non-deterministic test case
from the bug description as well as using the RQG.
2010-04-14 09:30:57 +02:00
Konstantin Osipov
b8d014b8f6 A fix for Bug#11918 "SP does not accept variables in LIMIT clause"
Allow stored procedure variables in LIMIT clause.
Only allow variables of INTEGER types. 
Handle negative values by means of an implicit cast to UNSIGNED 
(similarly to prepared statement placeholders).
Add tests.
Make sure replication works by not doing NAME_CONST substitution
for variables in LIMIT clause.
Add replication tests.
2010-04-14 01:56:19 +04:00
Vladislav Vaintroub
03b1cdd045 merge 2010-04-13 19:53:11 +02:00
Alexander Nozdrin
fad9478eba Post-fix for Bug#13174. 2010-04-13 20:10:51 +04:00
Vladislav Vaintroub
babfd0e7e0 merge 2010-04-13 17:12:17 +02:00
Konstantin Osipov
53fecff1ef Backport of:
ChangeSet@1.2703, 2007-12-07 09:35:28-05:00, cmiller@zippy.cornsilk.net +40 -0
Bug#13174: SHA2 function
Patch contributed from Bill Karwin, paper unnumbered CLA in Seattle

Implement SHA2 functions.

Chad added code to make it work with YaSSL.  Also, he removed the 
(probable) bug of embedded server never using SSL-dependent 
functions.  (libmysqld/Makefile.am didn't read ANY autoconf defs.)

Function specification:
  SHA2( string cleartext, integer hash_length ) 
    -> string hash, or NULL
where hash_length is one of 224, 256, 384, or 512.  If either is 
NULL or a length is unsupported, then the result is NULL.  The 
resulting string is always the length of the hash_length parameter
or is NULL.

Include the canonical hash examples from the NIST in the test
results.
---
Polish and address concerns of reviewers.
2010-04-13 19:04:45 +04:00
Vladislav Vaintroub
23359f7ff4 merge 2010-04-13 15:21:44 +02:00
Vladislav Vaintroub
04b601a7fe Fix perfschema unittests build on Windows
pthread_t is not defined unless my_pthread.h is included.
2010-04-13 13:48:46 +02:00
oystein.grovlen@sun.com
5af5bb2da6 Bug#51980 mysqld service crashes with a simple COUNT(DISTINCT) query over a view
Problem: Segmentation fault in add_group_and_distinct_keys() when accessing
field of what is assumed to be an Item_field object.

Cause: In case of views, the item added to list by is_indexed_agg_distinct() 
was not of type Item_field, but Item_ref.

Resolution:  Add the real Item_field object, the one referred to by 
Item_ref object, to the list, instead.
2010-04-13 11:38:28 +02:00
Alexander Nozdrin
9b807ed57c Auto-merge from mysql-trunk. 2010-04-12 21:42:15 +04:00
Alexander Nozdrin
2283e1b510 Fix compile error (different storage class for mysql_temp_dir_list)
when trying to build innodb as plugin.

The reason for the error is mismatch in mysql_temp_dir_list
declaration between mysqld.h and usage in ha_innodb.cc

Add missing MYSQL_PLUGIN_IMPORT to mysql_tmpdir_list
(variables exported by the server and used by plugin need it).
2010-04-12 17:35:06 +04:00
Alexander Nozdrin
50ff451566 A post-fix patch for WL#4877/WL#5030:
Fix tons of warnings about mismatch struct and class usage.
2010-04-12 17:17:37 +04:00
Marc Alff
7decb1b928 Bug#52754 Build break in mysql-trunk, performance schema unit test
Tree cleaup after the last major merges in mysql-trunk:

The files sql/lex_hash.h and sql/sql_yacc.h are automatically
generated, and should not be checked in the configuration management system.
These files are now removed.
No changes are required for .bzrignore, which already listed these files
(and similar files in libmysqld/).

The file storage/perfschema/unittest/pfs_timer-t.cc did not build
after the header files refactoring affecting mysql_priv.h
The file now builds properly using sql_priv.h
2010-04-12 03:31:45 -06:00
Alexey Kopytov
55252a1c1f Reconciling different file ids for dtoa.c in trunk and 6.0-codebase. 2010-04-11 10:52:42 +04:00
Alexey Kopytov
8ccf004f5b Reconciling different file ids for dtoa.c in trunk and 6.0-codebase. 2010-04-11 10:48:58 +04:00
Alexey Kopytov
ab50b8885f Automerge. 2010-04-11 10:33:07 +04:00
Alexander Nozdrin
70a04be1b8 Auto-merge from mysql-trunk. 2010-04-10 12:47:19 +04:00
Alexander Nozdrin
5513891cc3 Make main.query_cache_debug experimental on Linux due to Bug 52356. 2010-04-10 12:25:57 +04:00
Alexander Nozdrin
5cd54c5c39 Update version tag to 5.5.5-m3. 2010-04-10 12:24:06 +04:00
Mats Kindahl
0768deeb27 WL#5030: Splitting mysql_priv.h
Adding my_global.h first in all files using
NO_EMBEDDED_ACCESS_CHECKS.

Correcting a merge problem resulting from a changed definition
of check_some_access compared to the original patches.
2010-04-07 13:58:40 +02:00
Alexey Kopytov
5a274915ec Bug #52165: Assertion failed: file .\dtoa.c, line 465
The failing assertion was written with the assumption that a NULL
string can never be passed to my_strtod(). However, an empty string
may be passed under some circumstances by passing str == NULL and
*end == NULL.

Fixed the assertion to take the above case into account.
2010-04-07 13:59:02 +04:00
Mats Kindahl
2c79d4d02b WL#5030: Splitting mysql_priv.h
Adding include to build on Windows.
2010-04-06 23:00:01 +02:00
Mats Kindahl
a78fe75f92 WL#5030: Splitting mysql_priv.h
Adding includes of my_global.h that seems to be necessary on Windows.
2010-04-06 16:08:51 +02:00
Mats Kindahl
3467c1a7b2 WL#5030: Splitting mysql_priv.h
Moving an extern "C" to not cover #includes.
2010-04-06 14:11:07 +02:00
Mats Kindahl
2e28a449fa WL#5030: Splitting mysql_priv.h
- Adding include/mysql/innodb_priv.h which was missing before.
- Updated .bzrignore to ignore CMake generated cruft.
2010-04-06 12:55:36 +02:00
Mats Kindahl
df3349f0a4 WL#5030: Splitting mysql_priv.h
Minor fixes required because of changes since patches were developed.
2010-04-05 16:10:10 +02:00
Mats Kindahl
8a0c1ddc60 WL#5030: Split and remove mysql_priv.h
Fixing merge problem that causes CSV engine to misbehave.
2010-04-01 14:19:08 +02:00
Alfranio Correia
ec6c56ef5a BUG#51291 Unfortunate effect around variable binlog_direct_non_transactional_updates
Post-merge fix.
2010-04-01 00:16:22 +01:00
Mats Kindahl
e409d6f69c WL#5030: Split and remove mysql_priv.h
This patch:

- Moves all definitions from the mysql_priv.h file into
  header files for the component where the variable is
  defined
- Creates header files if the component lacks one
- Eliminates all include directives from mysql_priv.h
- Eliminates all circular include cycles
- Rename time.cc to sql_time.cc
- Rename mysql_priv.h to sql_priv.h
2010-03-31 16:05:33 +02:00
Alfranio Correia
2b48577cc2 auto-merge mysql-trunk-bugfixing (local) --> mysql-trunk-bugfixing 2010-03-31 14:51:52 +01:00
Alfranio Correia
f7776c999e BUG#51291 Unfortunate effect around variable binlog_direct_non_transactional_updates
Added test cases to check the case where the option 
binlog_direct_non_transactional_updates is OFF.
2010-03-31 14:49:20 +01:00
Alfranio Correia
4d71a007ba auto-merge mysql-trunk-bugfixing (local) --> mysql-trunk-bugfixing 2010-03-31 14:30:24 +01:00
Alfranio Correia
7827688f23 BUG#51291 Unfortunate effect around variable binlog_direct_non_transactional_updates
BUG#46364 introduced the flag binlog_direct_non_transactional_updates which
would make N-changes to be written to the binary log upon committing the
statement when "ON". On the other hand, when "OFF" the option was supposed
to mimic the behavior in 5.1. However, the implementation was not mimicking
the behavior correctly and the following bugs popped up:

  Case #1: N-changes executed within a transaction would go into
           the S-cache. When later in the same transaction a
           T-change occurs, N-changes following it were written
           to the T-cache instead of the S-cache. In some cases,
           this raises problems. For example, a
           Table_map_log_event being written initially into the
           S-cache, together with the initial N-changes, would be
           absent from the T-cache. This would log N-changes
           orphaned from a Table_map_log_event (thence discarded
           at the slave). (MIXED and ROW)

   Case #2: When rolling back a transaction, the N-changes that
            might be in the T-cache were disregarded and
            truncated along with the T-changes. (MIXED and ROW)

   Case #3: When a MIXED statement (TN) is ahead of any other
            T-changes in the transaction and it fails, it is kept
            in the T-cache until the transaction ends. This is
            not the case in 5.1 or Betony (5.5.2). In these, the
            failed TN statement would be written to the binlog at
            the same instant it had failed and not deferred until
            transaction end. (SBR)

To fix these problems, we have decided to do what follows:

   For Case #1 and #2, we circumvent them:

      1. by not letting binlog_direct_non_transactional_updates
         affect MIXED and RBR. These modes will keep the behavior
         provided by WL#2687. Although this will make Celosia to
         behave differently from 5.1, an execution will be always
         safe under such modes in the sense that slaves will never
         go out sync. In 5.1, using either MIXED or ROW while
         mixing N-statements and T-statements was not safe.

   For Case #3, we don't actually fix it. We:

      1. keep it and make all MIXED statements whether they end
         up failing or not or whether they are up front in the
         transaction or after some transactional change to always
         be stored in the T-cache. This means that it is written
         to the binary log on transaction commit/rollback only.

      2. We make the warning message even more specific about the
         MIXED statement and SBR.
2010-03-31 14:22:47 +01:00
Alfranio Correia
1ddd2ac2db auto-merge mysql-trunk-bugfixing (local) --> mysql-trunk-bugfixing 2010-03-31 14:15:48 +01:00
Mattias Jonsson
864d6bc90b Bug#51851: Server with SBR locks mutex twice on LOAD DATA
into partitioned MyISAM table

Problem was that the ha_data structure was introduced in 5.1
and only used for partitioning first, but with the intention
of be of use for others engines as well, and when used by other
engines it would clash if it also was partitioned.

Solution is to move the partitioning specific data to a separate
structure, with its own mutex (which is used for auto_increment).

Also did rename PARTITION_INFO to PARTITION_STATS since there
already exist a class named partition_info, also cleaned up
some related variables.
2010-03-30 22:52:45 +02:00
Alexander Nozdrin
36430c53f9 Fix use of uninitialized variable. 2010-03-26 11:09:14 +03:00
Luis Soares
c340c3aa10 BUG#52202: mysqlbinlog_row* fail in daily-trunk on Sol10 x86_64
debug_max

There was a buffer overrun when unpacking the date
field. Incidentaly, this seems to affect only solaris x86_64
debug builds, but others platforms may be vulnerable as well.

In particular, the buffer size used was not taking into
consideration that the '\0' character would be written into
it.

We fix this by increasing the size of the buffer used to
accommodate one extra byte (the one for the '\0').
2010-03-25 00:30:16 +00:00
Alexey Kopytov
1311b45a61 Fixed mysqld--help-win broken by the merge from trunk main. 2010-03-24 23:29:38 +03:00
Joerg Bruehe
8a5aca0dc7 Add "--with-perfschema" to the configure options for RPMs. 2010-03-24 20:30:33 +01:00
Joerg Bruehe
2067e6c46f Fix an issue with the IBM C++ compiler
which was detected during the build of 5.5.3-m3.
This requires version 9 of IBM C++ to help.

More fixes will still be needed, it is very strict
(or rather: a bit picky?) about templates.
2010-03-24 20:15:06 +01:00
Joerg Bruehe
d3c3a14e0a Some fixes developed during the build of 5.5.3-m3
about handling the debug plugin files,
also "ha_example.*" are dropped.
2010-03-24 20:01:01 +01:00
Luis Soares
b684173e33 BUG#52341: PB2: rpl tests started taking three times more time on
linux x86_64 max 

Rpl tests were surprisingly taking too long when server was built
using cmake on linux. This was because cmake counter part of
patch for WL#4949 was not defining SIGNAL_WITH_VIO_CLOSE flag,
which had negative impact on the time needed to stop the slave IO
thread on STOP SLAVE command.

We fix this by deploy the missing SET command on configure.cmake.
2010-03-24 18:55:06 +00: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
Alexander Nozdrin
58d8bfab4f Auto-merge from mysql-trunk. 2010-03-24 11:14:54 +03:00
Alexander Nozdrin
c203c8daf8 Auto-merge from mysql-trunk-bugfixing. 2010-03-24 11:10:56 +03:00
Alexey Kopytov
41b6e42421 Mark all main.plugin* tests as experimental on Solaris
as done in 6.0 due to bug #47146.
2010-03-23 23:34:12 +03:00
Alexey Kopytov
bbe6b90b52 Fixed the incorrectly merged rpl.rpl_show_slave_running test in
mysql-trunk-merge (by copying the .result/.test files from mysql-pe).
2010-03-23 10:28:57 +03:00
Joerg Bruehe
adbd8fe6e7 Fixes related to bug#46587:
archive storage engine headers don't include my_global.h first


During the build of 5.5.3-m3 on older Linux platforms
(kernels 2.4 or early 2.6),
the symptom described in the bug report occurred both
in the "archive" and in the "innobase" storage engine.

This change is the patch proposed in that bug report,
and a similar one in innobase, that latter is aligned
with Vasil Dimov of Innobase, the original author.
2010-03-22 16:19:39 +01:00