Commit graph

26012 commits

Author SHA1 Message Date
Alexander Nozdrin
35b00a182e Manual merge from mysql-trunk-merge. 2009-11-06 19:13:33 +03:00
Alexander Nozdrin
db6334d49e Auto-merge from mysql-trunk-merge. 2009-11-06 18:28:25 +03:00
Alexander Nozdrin
2ca5b2c791 Manual merge from mysql-trunk-merge. 2009-11-06 17:20:27 +03:00
Alexander Nozdrin
f956ea3771 Manual-merge from mysql-trunk-merge. 2009-11-06 12:52:45 +03:00
Alexander Nozdrin
112d9fd9db Auto-merge from mysql-trunk-merge. 2009-11-06 12:37:00 +03:00
Alexander Nozdrin
d9d3271da3 Auto-merge from mysql-trunk-merge. 2009-11-06 12:17:01 +03:00
Alexander Nozdrin
ab2450efd5 Manual merge from mysql-trunk-merge.
Fix partition_column.test.
2009-11-06 11:56:48 +03:00
Alexander Nozdrin
ef862653af Manual merge from mysql-trunk-merge. 2009-11-05 23:48:01 +03:00
Alexander Nozdrin
f620cae974 Manual merge from mysql-trunk-merge. 2009-11-05 23:28:35 +03:00
Alexander Nozdrin
3cf6345535 Fix automerge: use 'thd->query()' instead of 'thd->query'. 2009-11-05 17:51:00 +03:00
Alexander Nozdrin
26fc558319 Auto-merge from mysql-5.1. 2009-11-05 15:13:16 +03:00
Alexander Nozdrin
258ec2ebaa Auto-merge from mysql-5.1. 2009-11-05 14:03:16 +03:00
Alexander Nozdrin
13f1ace38b Auto-merge from mysql-5.1. 2009-11-05 13:59:58 +03:00
Alexander Nozdrin
110835764b Manual merge from mysql-5.1. 2009-11-05 13:58:14 +03:00
Alexander Nozdrin
b591221eb1 Auto-merge from mysql-5.1. 2009-11-05 12:38:14 +03:00
Alexander Nozdrin
f51d08921a Auto-merge from mysql-5.1. 2009-11-05 12:37:26 +03:00
Alexander Nozdrin
e6fffedb27 Manual merge from mysql-5.1. 2009-11-05 12:23:55 +03:00
Alexander Nozdrin
5ae8ae3a8e Manual merge from mysql-5.1. 2009-11-05 12:20:41 +03:00
Alexander Nozdrin
8b78a6af01 Auto-merge from mysql-5.1. 2009-11-05 12:14:01 +03:00
Alexander Nozdrin
39822f2367 Auto-merge from mysql-5.1. 2009-11-05 12:02:44 +03:00
Alexander Nozdrin
55cb8c77fa Auto-merge from mysql-5.1. 2009-11-05 12:02:03 +03:00
Alexander Nozdrin
09ff80f2a0 Manual merge from mysql-5.1. 2009-11-05 11:48:06 +03:00
Alexander Nozdrin
85f3e8ce24 Manual merge from mysql-5.1. 2009-11-05 11:40:01 +03:00
Mikael Ronstrom
06bfaf21f2 Fixed a use of non-initialised variable, cannot use NULL flags if RANGE == NO_MAX_RANGE or NO_MIN_RANGE, so need to check NULL flags after checking the RANGE isn't NO_MAX_RANGE 2009-11-04 09:30:52 +01:00
Konstantin Osipov
409160e466 A fix and a test case for
Bug#41756 "Strange error messages about locks from InnoDB".
      
In JT_EQ_REF (join_read_key()) access method, 
don't try to unlock rows in the handler, unless certain that 
a) they were locked
b) they are not used.

Unlocking of rows is done by the logic of the nested join loop,
and is unaware of the possible caching that the access method may
have. This could lead to double unlocking, when a row
was unlocked first after reading into the cache, and then 
when taken from cache, as well as to unlocking of rows which
were actually used (but taken from cache).
      
Delegate part of the unlocking logic to the access method,
and in JT_EQ_REF count how many times a record was actually 
used in the join. Unlock it only if it's usage count is 0.

Implemented review comments.
2009-11-03 20:45:52 +03:00
Konstantin Osipov
d2babeaf3a A fix and a test case for
Bug#41756 "Strange error messages about locks from InnoDB".

In JT_EQ_REF (join_read_key()) access method,
don't try to unlock rows in the handler, unless certain that
a) they were locked
b) they are not used.

Unlocking of rows is done by the logic of the nested join loop,
and is unaware of the possible caching that the access method may
have. This could lead to double unlocking, when a row
was unlocked first after reading into the cache, and then
when taken from cache, as well as to unlocking of rows which
were actually used (but taken from cache).

Delegate part of the unlocking logic to the access method,
and in JT_EQ_REF count how many times a record was actually
used in the join. Unlock it only if it's usage count is 0.

Implemented review comments.
2009-11-03 19:58:54 +03:00
Jorgen Loland
7f9a504745 Bug#48177 - SELECTs with NOT IN subqueries containing NULL
values return too many records

WHERE clauses with "outer_value_list NOT IN subselect" were
handled incorrectly if the outer value list contained multiple 
items where at least one of these could be NULL. The first 
outer record with NULL value was handled correctly, but if a 
second record with NULL value existed, the optimizer would 
choose to reuse the result it got on the last execution of the 
subselect. This is incorrect if the outer value list has 
multiple items.
     
The fix is to make Item_in_optimizer::val_int (in 
item_cmpfunc.cc) reuse the result of the latest execution
for NULL values only if all values in the outer_value_list 
are NULL.
2009-11-03 13:48:59 +01:00
Mikael Ronstrom
fc863ba96f Merge 2009-11-03 12:37:02 +01:00
c3345f3e47 Manual Merge 2009-11-03 18:20:08 +08:00
133bfc7fdb BUG#48216 Replication fails on all slaves after upgrade to 5.0.86 on master
When a sessione is closed, all temporary tables of the session are automatically 
dropped and are binlogged. But it will be binlogged with wrong database names when
the length of the temporary tables' database names are greater than the 
length of the current database name or the current database is not set.

Query_log_event's db_len is forgot to set when Query_log_event's db is set.
This patch wrote code to set db_len immediately after db has set.
2009-11-03 17:00:41 +08:00
Vladislav Vaintroub
7d5e759907 merge 2009-11-03 01:52:57 +01:00
Vladislav Vaintroub
84301e8b9d Bug#47571: idle named pipe connection is unkillable
Bug#31621: Windows server hanging during shutdown using named pipes 
           and idle connection
            
Problem: when idle pipe connection is forcefully closed with KILL
statement or when the server goes down, thread that is closing connection
would hang infinitely in CloseHandle(). The reason for the hang is that 
named pipe operations are performed synchronously. In this mode all IOs
on pipe are serialized, that is CloseHandle() will not abort ReadFile() 
in another thread, but wait for ReadFile() to complete.
            
The fix implements asynchrnous mode for named pipes, where operation of file
are not synchronized. Read/Write operation would fire an async IO and wait for
either IO completion or timeout.
            
Note, that with this patch timeouts are properly handled for named pipes.
      
Post-review: Win32 timeout code has been fixed for named pipes and shared
memory. We do not store pointer to NET in vio structure, only the read and 
write timeouts.
2009-11-02 23:19:58 +01:00
Alexander Barkov
9d13264835 Merging a postfix for Bug#46633 Obsolete Serbian locale
from mysql-next-mr-bar
2009-11-02 21:21:37 +04:00
Luis Soares
48887ae12c Auto-merging mysql-5.1-bugteam-gca into mysql-5.1-bugteam latest. 2009-11-02 16:02:55 +00:00
Luis Soares
ff6eacbcae Auto-merging bzr bundle from bug report in mysql-5.1-bugteam-gca 2009-11-02 15:57:25 +00:00
Alexander Nozdrin
ee15f23ca6 Backport a patch from 6.0:
------------------------------------------------------------
revno: 2599.178.12
revision-id: alik@mysql.com-20080812161845-we7cx9f22yrghob1
committer: Alexander Nozdrin <alik@mysql.com>
branch nick: 6.0-rt-build
timestamp: Tue 2008-08-12 20:18:45 +0400
message:
  Fix memory leak.
------------------------------------------------------------
2009-11-02 17:17:14 +03:00
Mikael Ronstrom
296a0fdcca Fixed a few bugs in hex string generation, in call to val_str for partition expressions, also made code reusable for DEFAULT handling to fix BUG#48464 by introducing function get_cs_converted_string_value, added partition_utf8 test case for UTF8 outputs 2009-11-02 14:49:26 +01:00
Martin Hansson
f539e0c825 Bug#47925: regression of range optimizer and date comparison in 5.1.39!
When a query was using a DATE or DATETIME value formatted
using any other separator characters beside hyphen '-', a
query with a greater-or-equal '>=' condition matching only
the greatest value in an indexed column, the result was
empty if index range scan was employed.

The range optimizer got a new feature between 5.1.38 and
5.1.39 that changes a greater-or-equal condition to a
greater-than if the value matching that in the query was not
present in the table. But the value comparison function
compared the dates as strings instead of dates.

The bug was fixed by splitting the function
get_date_from_str in two: One part that parses and does
error checking. This function is now visible outside the
module. The old get_date_from_str now calls the new
function.
2009-11-02 13:24:07 +01:00
Davi Arnaut
9a08362897 Bug#48370: Absolutely wrong calculations with GROUP BY and decimal fields when using IF
Bug#45261: Crash, stored procedure + decimal

Revert fix for Bug#45261 due to unforeseen bugs.
2009-11-02 09:21:39 -02:00
Alexander Nozdrin
8c95f3c53b Manual merge from mysql-next-mr. 2009-11-02 14:10:04 +03:00
Mikael Ronstrom
3a2d15730b Merge to latest mysql-next-mr 2009-11-02 11:09:15 +01:00
Tatiana A. Nurnberg
25a7332535 auto-merge 2009-11-02 00:13:13 -08:00
Luis Soares
3498200440 BUG#42829: manually merged approved bzr bundle from bug report.
Conflicts
=========

Text conflict in sql/sql_class.cc
1 conflicts encountered.
2009-11-01 23:13:11 +00:00
Sergey Vojtovich
612a8ccb2c Merge fix for BUG#43171. 2009-10-31 14:50:25 +04:00
Mikael Ronstrom
84638df046 Added more comments and a safer error check 2009-10-30 22:35:20 +01:00
Mikael Ronstrom
9498a53953 Fixed such that we fail if using integer constants for character set fields, now need to have correct constant types 2009-10-30 21:44:41 +01:00
Mikael Ronstrom
c897c59ceb Fixed so that character set constants are encoded as hex strings in frm file, but as utf8 strings in the same manner as default values in show create table and information schema tables 2009-10-30 21:08:34 +01:00
Mikael Ronstrom
66b37d318b Ensuring character set constants are safe, first step fix 2009-10-30 17:34:11 +01:00
Alexey Kopytov
695a6d41e2 Automerge. 2009-10-30 19:16:29 +03:00
Alexey Kopytov
b68ca5e88c Automerge. 2009-10-30 18:59:06 +03:00