Commit graph

68140 commits

Author SHA1 Message Date
Ole John Aske
003e87fef0 Fix for bug#58818: Incorrect result for IN/ANY subquery
If the ::single_value_transformer() find an existing HAVING condition it used
to do the transformation:
            
  1) HAVING cond -> (HAVING Cond) AND (cond_guard (Item_ref_null_helper(...))
      
As the AND condition in 1) is Mc'Carty evaluated, the
right side of the AND cond should be executed only if the 
original 'HAVING evaluated' to true.
      
However, as we failed to set 'top_level' for the tranformed HAVING condition,
'abort_on_null' was FALSE after transformation. An
UNKNOWN having condition will then not terminate evaluation of the
transformed having condition, and we incorrectly continued
into the Item_ref_null_helper() part.
2011-01-12 13:15:22 +01:00
Martin Hansson
b48abbc5e1 Merge of fix for Bug#58207. 2011-01-12 10:31:41 +01:00
Martin Hansson
fc42cbaca3 Bug#58207: invalid memory reads when using default column value and
tmptable needed

The function DEFAULT() works by modifying the the data buffer pointers (often
referred to as 'record' or 'table record') of its argument. This modification
is done during name resolution (fix_fields().) Unfortunately, the same
modification is done when creating a temporary table, because default values
need to propagate to the new table.

Fixed by skipping the pointer modification for fields that are arguments to
the DEFAULT function.
2011-01-12 09:55:31 +01:00
Dmitry Shulga
1304d8d53b Auto-merge mysql-5.1 -> mysql-5.5 for bug#58887. 2011-01-11 21:26:31 +06:00
Dmitry Shulga
5bd50b80a7 Fixed Bug#58887 - server not throwing "Packet too large" error
if max_allowed_packet >= 16M.

This bug was introduced by patch for bug#42503.

This patch restores behaviour that there was before patch
for bug#42503 was applied.
2011-01-11 21:18:25 +06:00
Davi Arnaut
7d2fad91a9 Merge of mysql-5.1 into mysql-5.5. 2011-01-11 11:53:50 -02:00
Davi Arnaut
409f7db22b Bug#42054: SELECT CURDATE() is returning bad value
The problem from a user point of view was that on Solaris the
time related functions (e.g. NOW(), SYSDATE(), etc) would always
return a fixed time.

This bug was happening due to a logic in the time retrieving
wrapper function which would only call the time() function every
half second. This interval between calls would be calculated
using the gethrtime() and the logic relied on the fact that time
returned by it is monotonic.

Unfortunately, due to bugs in the gethrtime() implementation,
there are some cases where the time returned by it can drift
(See Solaris bug id 6600939), potentially causing the interval
calculation logic to fail.

The solution is to retrieve the correct time whenever a drift in
the time returned by gethrtime() is detected. That is, do not
use the cached time whenever the values (previous and current)
returned by gethrtime() are not monotonically increasing.
2011-01-11 11:44:38 -02:00
Jan Wedvik
b7e3f45011 Merge of fix for bug#58553, "Queries with pushed conditions causes 'explain
extended' to crash mysqld" (see http://lists.mysql.com/commits/128409).
2011-01-11 12:33:28 +01:00
Jan Wedvik
f4adb7c6e4 Fix for bug#58553, "Queries with pushed conditions causes 'explain extended'
to crash mysqld". 
      
handler::pushed_cond was not always properly reset when table objects where
recycled via the table cache.
      
handler::pushed_cond is now set to NULL in handler::ha_reset(). This should 
prevent pushed conditions from (incorrectly) re-apperaring in later queries.
2011-01-11 12:09:54 +01:00
Magne Mahre
ebd24626ca Remove configuration preprocessor symbols 'THREAD'
and 'THREAD_SAFE_CLIENT'.
  
As of MySQL 5.5, we no longer support non-threaded
builds.   This patch removes all references to the
obsolete THREAD and THREAD_SAFE_CLIENT preprocessor
symbols.  These were used to distinguish between
threaded and non-threaded builds.
2011-01-11 10:07:37 +01:00
Anitha Gopi
f6bcd9c6c5 Bug#47792 : Moving test out of disabled state since the problem is not seen anymore 2011-01-11 13:31:51 +05:30
Mattias Jonsson
43803d0165 merge 2011-01-10 17:02:54 +01:00
Mattias Jonsson
208a0fab56 merge 2011-01-10 16:13:12 +01:00
Matthias Leich
30652c4f2b The fix for Bug#58414 affecting the test show_check is pushed.
Remove the test from defaults.experimental.
2011-01-10 15:53:06 +01:00
Magne Mahre
d690da668e Bug#51631 general-log flag doesn't accept "on" as a value in
the my.cnf, works as command
      
Different parsing mechanisms are used for command line/my.cnf 
options  and the SQL commands.  The former only accepted
numeric arguments, and regarded all numbers different from 0 
as 'true'.  Any other argument was parsed as 'false' .
      
This patch adds the words 'true' and 'on' as valid truth
values for boolean option arguments.
      
A test case is not provided, as the fix is simple and
does not warrant a separate test file (no existing
suitable test file was found)

(backported from mysql-trunk)
2011-01-10 15:18:20 +01:00
Mattias Jonsson
1a46e493dd Manual merge from 5.1 2011-01-10 15:08:31 +01:00
Jon Olav Hauglid
04823e3329 Bug #58933 Assertion `thd- >is_error()' fails on shutdown with ongoing
OPTIMIZE TABLE

OPTIMIZE TABLE for InnoDB tables is handled as recreate + analyze.
The triggered assert checked that an error had been reported if either
recreate or analyze failed. However the assert failed to take into
account that they could have failed because OPTIMIZE TABLE had been
victim of KILL QUERY, KILL CONNECTION or server shutdown.

This patch adjusts the assert to take this possibility into account.
The problem was only noticeable on debug versions of the server.

Test case added to innodb_mysql_sync.test.
2011-01-10 14:12:23 +01:00
Magne Mahre
0a2a470b08 Bug#58970 Problem Subquery (without referencing a table)
and Order By
      
When having a UNION statement in a subquery, with no
referenced tables (or only a reference to the virtual
table 'dual'), the UNION did not allow an ORDER BY clause.
      
      i.e:
          SELECT(SELECT 1 AS a UNION 
                 SELECT 0 AS a 
                 ORDER BY a) AS b  or
          SELECT(SELECT 1 AS a FROM dual UNION 
                 SELECT 0 as a 
                 ORDER BY a) AS b
      
      
In addition, an ORDER BY / LIMIT clause was not accepted
in subqueries even for single SELECT statements with no 
referenced tables (or with 'dual' as table reference)
      
   i.e: 
      SELECT(SELECT 1 AS a ORDER BY a) AS b  or
      SELECT(SELECT 1 AS a FROM dual ORDER BY a) AS b
      
The fix was to allow an optional ORDER BY/LIMIT clause to
the grammar for these cases.
      
See also: Bug#57986
2011-01-10 13:43:12 +01:00
Magne Mahre
4d6928095a Bug#57986 ORDER BY clause is not used after a UNION,
if embedded in a SELECT
            
An ORDER BY clause was bound to the incorrect
(sub-)statement when used in a UNION context.
            
In a query like:
SELECT * FROM a UNION SELECT * FROM b ORDER BY c
the result of SELECT * FROM b is sorted, and then
combined with a.  The correct behaviour is that
the ORDER BY clause should be applied on the
final set.   Similar behaviour was seen on LIMIT
clauses as well.
            
In a UNION statement, there will be a select_lex
object for each of the two selects, and a 
select_lex_unit object that describes the UNION
itself.  Similarly, the same behaviour was also
seen on derived tables.
            
The bug was caused by using a grammar rule for
ORDER BY and LIMIT that bound these elements
to thd->lex->current_select, which points to the
last of the two selects, instead of to the 
fake_select_lex member of the master select_lex_unit
object.
2011-01-10 13:16:50 +01:00
Mattias Jonsson
99e95e8dab merge 2011-01-10 12:56:27 +01:00
Mattias Jonsson
945f6faae6 merge 2011-01-10 12:53:24 +01:00
Vasil Dimov
67b227c55d Merge mysql-5.1 -> mysql-5.5 (empty) 2011-01-08 17:05:08 +02:00
Vasil Dimov
1d3fd9d931 Merge mysql-5.5-innodb -> mysql-5.5 2011-01-08 17:00:48 +02:00
Vasil Dimov
4e8ba0838f Merge mysql-5.1-innodb -> mysql-5.1 2011-01-08 16:59:23 +02:00
Vasil Dimov
054cba2af5 Null merge mysql-5.1-innodb -> mysql-5.5-innodb
(irrelevant for 5.5 and up)
2011-01-08 16:52:36 +02:00
Vasil Dimov
2d32d7c9a9 Increment InnoDB Plugin version from 1.0.14 to 1.0.15.
InnoDB Plugin 1.0.14 has been released with MySQL 5.1.54.
2011-01-08 16:51:19 +02:00
Davi Arnaut
0918a3a2ab Bug#58765: Warning in item.h on Windows
Truncate the maximum result length (64-bit wide type) to fit into
the item maximum length (32-bit wide type). This is possible as
this specific branch is only used if the maximum result length
is less than 0x1000000 (MAX_BLOB_WIDTH), which fits comfortably
in a 32-bit wide type.
2011-01-07 17:32:41 -02:00
Davi Arnaut
ff3f14db61 Merge of mysql-5.1 into mysql-5.5. 2011-01-07 17:30:52 -02:00
Davi Arnaut
4c810790f7 Bug#51023: Mysql server crashes on SIGHUP and destroys InnoDB files
WIN32 compilation fixes: define ETIMEDOUT only if not available and
fix typos and add a missing parameter.
2011-01-07 17:28:06 -02:00
Davi Arnaut
78b6ca55cb Bug#51023: Mysql server crashes on SIGHUP and destroys InnoDB files
From a user perspective, the problem is that a FLUSH LOGS or SIGHUP
signal could end up associating the stdout and stderr to random
files. In the case of this bug report, the streams would end up
associated to InnoDB ibd files.

The freopen(3) function is not thread-safe on FreeBSD. What this
means is that if another thread calls open(2) during freopen()
is executing that another thread's fd returned by open(2) may get
re-associated with the file being passed to freopen(3). See FreeBSD
PR number 79887 for reference:

  http://www.freebsd.org/cgi/query-pr.cgi?pr=79887

This problem is worked around by substituting a internal hook within
the FILE structure. This avoids the loss of atomicity by not having
the original fd closed before its duplicated.

Patch based on the original work by Vasil Dimov.
2011-01-07 16:33:36 -02:00
Vasil Dimov
8da2ed9699 Null merge mysql-5.1-innodb -> mysql-5.5-innodb
This change is relevant only for 5.1.
2011-01-07 16:56:32 +02:00
Vasil Dimov
c4aee1b45a Followup to vasil.dimov@oracle.com-20110107091222-q23qpb5skev0j9gc
Do not use nested AC_CHECK_FUNC() because they result in:

./configure: line 52688: syntax error: unexpected end of file

(which happens only on some platforms and does not happen on others,
I have no idea what is the reason for this)
2011-01-07 16:52:44 +02:00
Matthias Leich
6fd2964c4d Fix for Bug#58414 Race condition in show_check.test
Basically take care that disconnects are finished.
2011-01-07 14:37:46 +01:00
Matthias Leich
d09ed4e08c Fix for Bug#47745 innodb.innodb-timeout fails sporadically
- Second scenario checked:
  Ensure via wait routines that the commit comes after the
  processing of the statement which should get finally
  the ER_LOCK_WAIT_TIMEOUT
  --> This should prevent the current bug.
- First scenario checked:
  Ensure via wait routines that the statement is already waiting
  for getting the lock before the commit is given.
  --> No effect on the current bug, but ensure that the right
      scenario is reached.
- Take care that disconnects are finished before the test ends.
  --> Reduce the potential to harm succeeding tests.
- "Mangle" the printout of the current default innodb_lock_wait_timeout value
  --> No need to adjust the test in case the default gets changed in future.
2011-01-07 14:16:28 +01:00
Matthias Leich
a79e8fa2d0 1. Fix for Bug#58600 main.not_embedded_server test does not cleanup properly
- remove the superfluous file
   - add an preemptive removal of the outfile before the
     SELECT ... INTO OUTFILE ...
2. Remove an already disabled subtest
   It's functionality is covered by tests in the suite funcs_1.
3. Adjust the formatting within some sub testcase to the formatting used
   in all other sub testcases
2011-01-07 13:08:05 +01:00
Vasil Dimov
29ac61df73 Merge mysql-5.1-innodb -> mysql-5.5-innodb (empty) 2011-01-07 13:56:50 +02:00
Vasil Dimov
c9d224afe0 Fix InnoDB style after mikael@dator8-20101217205840-i7ltx8m6z3uc42kh 2011-01-07 13:54:07 +02:00
Vasil Dimov
b192c11c08 Merge mysql-5.5 -> mysql-5.5-innodb 2011-01-07 13:49:06 +02:00
Vasil Dimov
d8a01ff5b7 Merge mysql-5.1 -> mysql-5.1-innodb 2011-01-07 13:46:21 +02:00
Vasil Dimov
bcd7319b42 Merge mysql-5.1-innodb -> mysql-5.5-innodb
This is a null-merge because Bug#59327 is present only in 5.1
2011-01-07 11:40:38 +02:00
Vasil Dimov
05231aeef0 Fix Bug#59327 Fix autoconf usage for innodb_plugin
AC_CHECK_FUNCS(f1 f2 f3, ACTION_IF_PRESENT)
ACTION_IF_PRESENT is executed if any of f1, f2 or f3 is present.
Fix this misusage, we want the action to be executed if all of the
functions are present.
2011-01-07 11:12:22 +02:00
Jimmy Yang
a9c095a06d merge from mysql-5.1-innodb to mysql-5.5-innodb 2011-01-06 19:50:49 -08:00
Jimmy Yang
25d285ce9c Fix Bug #55397 cannot select from innodb_trx when trx_query contains blobs
that aren't strings

rb://560 approved by Sunny Bains
2011-01-06 19:36:20 -08:00
Saikumar V
ce7a75fe8c Adding more mtr commands to runs engine suites. 2011-01-06 16:47:22 +05:30
Sunny Bains
dead1dc42a Fix Bug #58653 - Sporadic crash due to assertion failure 0 == space->n_pending_flushes
Check whether the master and purge thread are active after creating them. Do
not proceed until both threads have started. We do this by checking whether a
slot has been reserved by both the respective threads.
      
Add srv_thread_has_reserved_slot() returns slot no or ULINT_UNDEFINED.
      
rb://536 Approved by Jimmy
2011-01-06 21:41:30 +11:00
Saikumar V
5db83bab28 Adding more mtr commands to runs engine suites. 2011-01-06 16:09:45 +05:30
Vasil Dimov
91fc720350 Merge mysql-5.1-innodb -> mysql-5.5-innodb 2011-01-06 09:19:02 +02:00
Vasil Dimov
46f38c2bfd Null merge mysql-5.1-innodb -> mysql-5.5-innodb 2011-01-06 09:15:48 +02:00
Vasil Dimov
00cbd03fd8 (InnoDB Plugin) Fix Bug#59303 Correct URL in crash message
old URL: http://dev.mysql.com/doc/refman/5.1/en/forcing-recovery.html
new URL: http://dev.mysql.com/doc/refman/5.1/en/forcing-innodb-recovery.html

Notice that there is a redirect from the old URL to the new URL, so visiting
the old URL does not give "page not found" error.
2011-01-06 09:12:53 +02:00
Vasil Dimov
b9f2234890 (Builtin InnoDB) Fix Bug#59303 Correct URL in crash message
old URL: http://dev.mysql.com/doc/refman/5.1/en/forcing-recovery.html
new URL: http://dev.mysql.com/doc/refman/5.1/en/forcing-innodb-recovery.html

Notice that there is a redirect from the old URL to the new URL, so visiting
the old URL does not give "page not found" error.
2011-01-06 09:05:45 +02:00