Commit graph

26559 commits

Author SHA1 Message Date
Magne Mahre
1f7f620f30 WL#5154 Remove deprecated 4.1 features
A set of program options and variables was deprecated in
MySQL 5.1, and is hereby removed.
2010-02-17 10:18:17 +01:00
Magne Mahre
6f80e0697d Bug#48929 Error in Accept() if using many file descriptors
In POSIX systems, the file descriptor set used in the select(2)
system call is represented by a bit vector of size FD_SETSIZE.
When select(2) is used on file/socket descriptors with a value
that is beyond this size, unpredictable errors may occur.

In this case, the error happens when there are a large number
of tables that need repair.  These tables are opened before
the sockets for incoming connections are acquired, resulting
in these sockets getting descriptor id which is higher than
FD_SETSIZE.

Replacing the call to select(2) with poll(2) fixes the problem,
as poll takes an array of the wanted descriptors, instead of
a bit vector.  

MS Windows has a different implementation of 'select', and is not
affected by this bug.
2010-02-14 19:12:58 +01:00
Alexander Nozdrin
a8eeb3fc8a Auto-merge from mysql-next-mr-bugfixing. 2010-02-12 12:59:12 +03:00
Evgeny Potemkin
7313daef8b Auto-merged fix for the bug#50539. 2010-02-12 12:41:15 +03:00
Evgeny Potemkin
b5f40f3454 Bug#50539: Wrong result when loose index scan is used for an aggregate
function with distinct.
Loose index scan is used to find MIN/MAX values using appropriate index and
thus allow to avoid grouping. For each found row it updates non-aggregated
fields with values from row with found MIN/MAX value.
Without loose index scan non-aggregated fields are copied by end_send_group
function. With loose index scan there is no need in end_send_group and
end_send is used instead. Non-aggregated fields still need to be copied and
this was wrongly implemented in QUICK_GROUP_MIN_MAX_SELECT::get_next.
WL#3220 added a case when loose index scan can be used with end_send_group to
optimize calculation of aggregate functions with distinct. In this case
the row found by QUICK_GROUP_MIN_MAX_SELECT::get_next might belong to a next
group and copying it will produce wrong result.

Update of non-aggregated fields is moved to the end_send function from
QUICK_GROUP_MIN_MAX_SELECT::get_next.
2010-02-12 11:51:52 +03:00
de551587c8 Bug #43913 rpl_cross_version can't pass on conflicts complainig clash with
--slave-load-tm
      
The MDL_SHARED lock was introduced for an object in 5.4, but the 'TABLE_LIST' 
object was not initialized with the MDL_SHARED lock when applying event with 
LOAD DATA INFILE into table. So the failure is caused when checking the 
MDL_SHARED lock for the object.
      
To fix the problem, the 'TABLE_LIST' object was initialized with the MDL_SHARED 
lock when applying event with LOAD DATA INFILE into table.
2010-02-12 12:12:43 +08:00
6bad45745c Bug #43913 rpl_cross_version can't pass on conflicts complainig clash with
--slave-load-tm
      
The MDL_SHARED lock was introduced for an object in 5.4, but the 'TABLE_LIST' 
object was not initialized with the MDL_SHARED lock when applying event with 
LOAD DATA INFILE into table. So the failure is caused when checking the 
MDL_SHARED lock for the object.
To fix the problem, the 'TABLE_LIST' object was initialized with the MDL_SHARED 
lock when applying event with LOAD DATA INFILE into table.
2010-02-12 12:04:57 +08:00
Magne Mahre
9148700166 merge from mysql-trunk-bugfixing 2010-02-11 18:32:53 +01:00
Magne Mahre
5f2c8caea9 Bug#50574 5.5.x allows spatial indexes on non-spatial columns,
causing crashes!

Adding a SPATIAL INDEX on a non-geometrical column caused a
segmentation fault when the table was subsequently 
inserted into.
      
A test was added in mysql_prepare_create_table to explicitly
check whether non-geometrical columns are used in a
spatial index, and throw an error if so.
2010-02-11 18:25:34 +01:00
Magne Mahre
071688ba79 merge 2010-02-11 18:04:32 +01:00
Magne Mahre
b2ddac5563 Bug#50542 5.5.x doesn't check length of key prefixes:
corruption and crash results
      
An index creation statement where the index key
is larger/wider than the column it references 
should throw an error.
      
A statement like:
  CREATE TABLE t1 (a CHAR(1), PRIMARY KEY (A(255)))
did not error, but a segmentation fault followed when
an insertion was attempted on the table
      
The partial key validiation clause has been 
restructured to (hopefully) better document which
uses of partial keys are valid.
2010-02-11 18:02:41 +01:00
Luis Soares
ec9f4c70e1 Automerge from mysql-next-mr-bugfixing. 2010-02-11 13:50:18 +00:00
Luis Soares
af67056f28 Manual merge from mysql-next-mr bug branch.
Conflicts
=========
  Text conflict in sql/sql_base.cc
2010-02-10 22:27:23 +00:00
Luis Soares
f4f4a2c780 BUG#51021: current_stmt_binlog_row_based not removed in next-mr
A closely related problem, hardly worth a new bug report:
Removed a spurious call to:  
  thd->set_current_stmt_binlog_format_row_if_mixed()
in sql_base.cc:lock_tables().
2010-02-10 21:57:07 +00:00
Luis Soares
7d213e8314 BUG#51021: current_stmt_binlog_row_based not removed in next-mr
Deployed DBUG_ASSERT before the conditional binlog format
restore.
2010-02-10 16:01:31 +00:00
Mattias Jonsson
e23222c6e1 merge 2010-02-10 11:08:39 +01:00
Mattias Jonsson
84c205f9ee Bug#50201: Server crashes in explain_filename on an InnoDB partitioned table
Problem was that in mysql-trunk the ER() macro is now dependent on current_thd
and the innodb monitor thread has no binding to that thd object. This cause 
the crash because of bad derefencing.

Solution was to add a new macro which take the thd as an argument (which the innodb
thread uses for the call).

(Updated according to reviewers comments, i.e. added ER_THD_OR_DEFAULT and
moved test to suite parts.)
2010-02-10 10:47:14 +01:00
Luis Soares
9ba558302b BUG#51021: current_stmt_binlog_row_based not removed in next-mr
As part of BUG@39934 fix, the public:
 - THD::current_stmt_binlog_row_based 
variable had been removed and replaced by a private variable:
 - THD::current_stmt_binlog_format. 

THD was refactored and some modifiers and accessors were
implemented for the new variable.

However, due to a bad merge, the
THD::current_stmt_binlog_row_based variable is back as a public
member of THD. This in itself is already potentially
harmful. What's even worse is that while merging some more
patches and resolving conflicts, the variable started being used
again, which is obviously wrong.

To fix this we:
  1. remove the extraneous variable from sql_class.h
  2. revert a bad merge for BUG#49132
  3. merge BUG#49132 properly again (actually, making use of the
     cset used to merge the original patch to mysql-pe).
2010-02-09 17:22:31 +00:00
Luis Soares
f7ebf26881 auto merge from mysql-5.1-rep+3. 2010-02-09 12:10:47 +00:00
Luis Soares
6ef3875bbd Manual merge from mysql-5.1-rep+2. 2010-02-09 11:58:36 +00:00
Luis Soares
38c89b89ef Automerge from mysql-next-mr. 2010-02-09 10:46:18 +00:00
Vladislav Vaintroub
3afa1910e3 merge 2010-02-05 18:02:26 +01:00
Vladislav Vaintroub
ebcfde20e2 merge 2010-02-05 18:01:00 +01:00
Marc Alff
3630d78e6c Merge mysql-next-mr-marc --> mysql-next-mr-bugfixing 2010-02-05 09:56:55 -07:00
Alexander Nozdrin
55152dc2f5 Auto-merge from mysql-next-mr. 2010-02-05 18:43:29 +03:00
Marc Alff
02fc9afe81 Merge mysql-next-mr (revno 2996) --> mysql-next-mr-marc 2010-02-05 08:10:20 -07:00
Alexander Nozdrin
7366b09c26 Remove errmsg.txt and errmsg-cnv.sh. Use errmsg-utf8.txt instead. 2010-02-05 16:52:35 +03:00
Vladislav Vaintroub
fe6f55d6a2 Bug#50057: 'SHOW PROFILE CPU' port for Windows.
Patch contributed by Alex Budovski.
2010-02-05 13:57:15 +01:00
Alexander Nozdrin
1a0f34e6a4 Manual merge from mysql-next-mr.
Conflicts:
  - sql/sys_vars.cc
2010-02-05 15:05:37 +03:00
Alexander Nozdrin
94c1dc58ad Auto-merge from mysql-trunk. 2010-02-05 15:02:03 +03:00
He Zhenxing
c0b41c8954 Auto merge 2010-02-04 12:47:42 +08:00
He Zhenxing
409ef39146 Auto merge from 5.1-rep-semisync 2010-02-04 12:37:56 +08:00
He Zhenxing
b7289d6dc5 Bug#49894 shifted MYSQL_REPLICATION_PLUGIN number
The number for MYSQL_REPLICATION_PLUGIN was shifted when backporting
because MYSQL_AUDIT_PLUGIN was not backported.

This problem is fixed by backporting only the number of audit plugin
and print an error when trying to load audit plugins. Note that
replication plugins compiled against old MYSQL_REPLICATION_PLUGIN
number will also be recognized as audit plugin and be rejected.
2010-02-04 12:14:32 +08:00
Alexander Nozdrin
9d55dab9c7 Manual merge from mysql-trunk-merge.
Conflicts:
  - sql/sql_show.cc
2010-02-03 23:26:58 +03:00
Alexander Nozdrin
69cb0a8035 Manual merge from mysql-trunk-merge.
Conflicts:
  - sql/sql_select.cc
2010-02-03 23:15:57 +03:00
Alexander Nozdrin
4c8fd3cf57 Manual merge from mysql-5.1-bugteam.
Conflicts:
  - configure.in
  - mysql-test/include/setup_fake_relay_log.inc
  - sql/sql_select.cc
2010-02-03 20:22:58 +03:00
Luis Soares
6dd801d7b7 BUG#50364: manual merge to mysql-next-mr-bugfixing.
Conflicts
=========
Text conflict in sql/repl_failsafe.cc

Additional changes
==================
Replace references to pthread_mutex with mysql_mutex
2010-02-03 17:19:58 +00:00
Luis Soares
d0ffa8e51b BUG#50364: FLUSH LOGS crashes the server (rpl.rpl_heartbeat_basic
fails in PB sporadically)
      
The IO thread can concurrently access the relay log IO_CACHE
while another thread is performing an FLUSH LOGS procedure.
      
FLUSH LOGS closes and reopens the relay log and while doing so it
(re)initializes its IO_CACHE. During this procedure the IO_CACHE
mutex is also reinitialized, which can cause problems if some
other thread (namely the IO THREAD) is concurrently accessing it
at the time .
      
This patch fixes the problem by extending the interface of the
flush_master_info function to also include a second paramater, 
"need_relay_log_lock", stating whether the thread should grab the 
relay log lock or not before actually flushing the relay log. 
Also, IO thread now calls flush_master_info with this flag set 
when it flushes master info with in the event read_event loop.

Finally, we also increase loop time in rpl_heartbeat_basic test 
case, so that the number of calls to flush logs doubles, stressing
this part of the code a little more.
2010-02-03 16:56:17 +00:00
Alexander Nozdrin
f62f1a528b Manual merge from mysql-5.1-bugteam.
Conflicts:
  - sql/mysqld.cc
2010-02-03 19:28:40 +03:00
Alexander Nozdrin
9dc8347c1e Manual merge from mysql-trunk-merge.
Conflicts:
  - mysql-test/t/bug46080.test
2010-02-03 19:21:17 +03:00
Alexander Nozdrin
31ba3bf5cb Manual merge from mysql-5.1-bugteam.
Conflicts:
  - mysql-test/collections/default.experimental
  - mysql-test/suite/rpl/r/rpl_sp.result
2010-02-03 17:01:48 +03:00
Georgi Kodinov
4cfda7fd3b Bug #49445: Assertion failed: 0, file .\item_row.cc, line 55 with
fulltext search and row op.

The search for fulltext indexes is searching for some special 
predicate layouts. While doing so it's not checking for the number
of columns of the expressions it tries to calculate.
And since row expressions can't return a single scalar value there
was a crash.
Fixed by checking if the expressions are scalar (in addition to 
being constant) before calling Item::val_xxx() methods.
2010-02-02 18:37:56 +02:00
Magne Mahre
632cf4c502 Cleanup fix for WL#5154 that splits commands handling for
--default-character-set and --character-set-server such
that only the first will give a deprecation warning.
Apart from that, the two options should do the same.
2010-02-02 16:34:32 +01:00
Alexander Nozdrin
f392eddabc Revert a patch for Bug#48231, which introduced valgrind warnings.
Original revision:
------------------------------------------------------------
revision-id: li-bing.song@sun.com-20100130124925-o6sfex42b6noyc6x
parent: joro@sun.com-20100129145427-0n79l9hnk0q43ajk
committer: <Li-Bing.Song@sun.com>
branch nick: mysql-5.1-bugteam
timestamp: Sat 2010-01-30 20:49:25 +0800
message:
  Bug #48321  CURRENT_USER() incorrectly replicated for DROP/RENAME USER;
              REVOKE/GRANT; ALTER EVENT.
  
  The following statements support the CURRENT_USER() where a user is needed.
    DROP USER 
    RENAME USER CURRENT_USER() ...
    GRANT ... TO CURRENT_USER()
    REVOKE ... FROM CURRENT_USER()
    ALTER DEFINER = CURRENT_USER() EVENT
  but, When these statements are binlogged, CURRENT_USER() just is binlogged
  as 'CURRENT_USER()', it is not expanded to the real user name. When slave 
  executes the log event, 'CURRENT_USER()' is expand to the user of slave 
  SQL thread, but SQL thread's user name always NULL. This breaks the replication.
  
  After this patch, All above statements are rewritten when they are binlogged.
  The CURRENT_USER() is expanded to the real user's name and host.
------------------------------------------------------------
2010-02-02 16:38:44 +03:00
Georgi Kodinov
be89d30f36 fixed various pb2 test failures on windows. 2010-02-02 14:17:21 +02:00
Alexander Nozdrin
33e5e125f5 Manual merge of patch for Bug#46364 from mysql-next-mr-bugfixing.
Conflicts:
  - mysql-test/r/mysqld--help-win.result
  - sql/sys_vars.cc

Original revsion (in next-mr-bugfixing):
------------------------------------------------------------
revno: 2971 [merge]
revision-id: alfranio.correia@sun.com-20100121210527-rbuheu5rnsmcakh1
committer: Alfranio Correia <alfranio.correia@sun.com>
branch nick: mysql-next-mr-bugfixing
timestamp: Thu 2010-01-21 21:05:27 +0000
message:
  BUG#46364 MyISAM transbuffer problems (NTM problem)
        
  It is well-known that due to concurrency issues, a slave can become
  inconsistent when a transaction contains updates to both transaction and
  non-transactional tables.
                      
  In a nutshell, the current code-base tries to preserve causality among the
  statements by writing non-transactional statements to the txn-cache which
  is flushed upon commit. However, modifications done to non-transactional
  tables on behalf of a transaction become immediately visible to other
  connections but may not immediately get into the binary log and therefore
  consistency may be broken.
              
  In general, it is impossible to automatically detect causality/dependency
  among statements by just analyzing the statements sent to the server. This
  happen because dependency may be hidden in the application code and it is
  necessary to know a priori all the statements processed in the context of
  a transaction such as in a procedure. Moreover, even for the few cases that
  we could automatically address in the server, the computation effort
  required could make the approach infeasible.
              
  So, in this patch we introduce the option
        - "--binlog-direct-non-transactional-updates" that can be used to bypass
        the current behavior in order to write directly to binary log statements
        that change non-transactional tables.
  
  Besides, it is used to enable the WL#2687 which is disabled by default.
    ------------------------------------------------------------
    revno: 2970.1.1
    revision-id: alfranio.correia@sun.com-20100121131034-183r4qdyld7an5a0
    parent: alik@sun.com-20100121083914-r9rz2myto3tkdya0
    committer: Alfranio Correia <alfranio.correia@sun.com>
    branch nick: mysql-next-mr-bugfixing
    timestamp: Thu 2010-01-21 13:10:34 +0000
    message:
      BUG#46364 MyISAM transbuffer problems (NTM problem)
            
      It is well-known that due to concurrency issues, a slave can become
      inconsistent when a transaction contains updates to both transaction and
      non-transactional tables.
                          
      In a nutshell, the current code-base tries to preserve causality among the
      statements by writing non-transactional statements to the txn-cache which
      is flushed upon commit. However, modifications done to non-transactional
      tables on behalf of a transaction become immediately visible to other
      connections but may not immediately get into the binary log and therefore
      consistency may be broken.
                  
      In general, it is impossible to automatically detect causality/dependency
      among statements by just analyzing the statements sent to the server. This
      happen because dependency may be hidden in the application code and it is
      necessary to know a priori all the statements processed in the context of
      a transaction such as in a procedure. Moreover, even for the few cases that
      we could automatically address in the server, the computation effort
      required could make the approach infeasible.
                  
      So, in this patch we introduce the option
            - "--binlog-direct-non-transactional-updates" that can be used to bypass
            the current behavior in order to write directly to binary log statements
            that change non-transactional tables.
      
      Besides, it is used to enable the WL#2687 which is disabled by default.
2010-02-02 10:56:42 +03:00
Georgi Kodinov
15ccc8f609 merge 2010-02-01 13:50:30 +02:00
Georgi Kodinov
7d9209680b fixed a typo in bug #49897. 2010-02-01 13:40:16 +02:00
52bc6179d9 Manual Merge for bug#50157 2010-01-31 21:37:41 +08:00
Alexander Nozdrin
cb871224cd Manual merge from mysql-trunk-merge.
Conflicts:
  - mysql-test/collections/default.experimental
  - mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test
2010-01-31 01:10:29 +03:00