Commit graph

39572 commits

Author SHA1 Message Date
Gleb Shchepa
b41c1a45f1 Bug #39069: <row constructor> IN <table-subquery> seriously
messed up

"ROW(...) IN (SELECT ... FROM DUAL)" always returned TRUE.

Item_in_subselect::row_value_transformer rewrites "ROW(...)
IN SELECT" conditions into the "EXISTS (SELECT ... HAVING ...)"
form.
For a subquery from the DUAL pseudotable resulting HAVING
condition is an expression on constant values, so further
transformation with optimize_cond() eliminates this HAVING
condition and resets JOIN::having to NULL.
Then JOIN::exec treated that NULL as an always-true-HAVING
and that caused a bug.

To distinguish an optimized out "HAVING TRUE" clause from
"HAVING FALSE" we already have the JOIN::having_value flag.
However, JOIN::exec() ignored JOIN::having_value as described
above as if it always set to COND_TRUE.

The JOIN::exec method has been modified to take into account
the value of the JOIN::having_value field.
2009-01-28 22:46:45 +04:00
Alexey Kopytov
30ac49019d Fix for bug #21205: Different number of digits for float/double/real in --ps-protocol
Various parts of code used different 'precision' arguments for sprintf("%g") when converting
floating point numbers to a string. This led to differences in results in some cases 
depending on whether the text-based or prepared statements protocol is used for a query.

Fixed by changing arguments to sprintf("%g") to always be 15 (DBL_DIG) so that results are
consistent regardless of the protocol.

This patch will be null-merged to 6.0 as the problem does not exists there (fixed by the
patch for WL#2934).
2009-01-28 20:59:08 +03:00
Davi Arnaut
d94e00a0ed Remove test case for bug 40264.
Dirty close tricky does not work on Windows.
2009-01-28 14:33:33 -02:00
Georgi Kodinov
7234ca1a44 Bug #42366: server-cert.pem expired: "Not After : Jan 27 08:54:13 2009 GMT"
Re-generated the PKI files needed.
Removed the ones that are not needed.
Updated the tests to reference the correct SSL subject.
2009-01-28 16:18:50 +02:00
Bjorn Munch
640491287a merge 2009-01-28 14:44:22 +01:00
Bjorn Munch
e08d21b708 Bug #42216 mysqltest: Use of diff belonging to current OS, with wrong option for Solaris
Check for existence of diff fails on Solaris due to unsupported "-v"
Fix is to do this check only on Windows where it was needed
2009-01-28 14:14:05 +01:00
Joerg Bruehe
a5706380dc Backport of a fix done by Kent for bug#42278
into the 5.0.72sp1 branch.

Original changeset (in the main 5.0 branch):
> committer: Kent Boortz <kent@kent-amd64>
> branch nick: mysql-5.0-build-bug42278
> timestamp: Fri 2009-01-23 02:59:03 +0100
2009-01-26 22:06:42 +01:00
Chad MILLER
6841772b58 Merge from team tree. 2009-01-26 12:34:55 -05:00
Kent Boortz
63c4888cf9 From 5.0.48 the NDB client libraries has been missing in the cluster
packages, this is now corrected (Bug#42278)
2009-01-23 02:59:03 +01:00
Davi Arnaut
6a834d1f4f Bug#40264: Aborted cached query causes query to hang indefinitely on next cache hit
The problem is that the query cache was storing partial results
if the statement failed when sending the results to the client.
This could cause clients to hang when trying to read the results
from the cache as they would, for example, wait indefinitely for
a eof packet that wasn't saved.

The solution is to always discard the caching of a query that
failed to send its results to the associated client.
2009-01-22 08:28:01 -02:00
Georgi Kodinov
7fc8286257 auto merge 2009-01-16 16:48:41 +02:00
Georgi Kodinov
23fac1b529 merged 5.0-main -> 5.0-bugteam 2009-01-16 13:19:42 +02:00
Georgi Kodinov
7a6dda5077 merged Bug 38795 to 5.0-bugteam 2009-01-15 16:15:38 +02:00
Joerg Bruehe
4ecaa45d11 Merge some tool fixes from the 5.0.72sp1 build back into the tree.
This is not the final merge of that release build, but we need early
access to these tool fixes (use of "awk" in the BDB configuration).
2009-01-15 12:08:09 +01:00
Joerg Bruehe
887126a9fb Merge the changes of the 5.0.66sp1 build back into the tree. 2009-01-15 11:48:31 +01:00
Alexander Nozdrin
50a8cdc6c8 Pull from 5.0-bugteam 2009-01-15 13:10:20 +03:00
Davi Arnaut
080853635d Auto-merge from 5.1-bugteam 2009-01-15 07:52:06 -02:00
Alexander Nozdrin
333aa975ec Backport patch for Bug#31222 (com_% global status counters behave randomly
with mysql_change_user) to 5.0.
2009-01-15 12:36:34 +03:00
Georgi Kodinov
1233360cc2 merge 5.0-main to 5.0-bugteam 2009-01-15 06:35:18 +02:00
MySQL Build Team
d535a2b92e Oops, bumped version too high. Drop it back down from 5.0.78 to 5.0.77. 2009-01-15 00:14:07 +01:00
timothy.smith@sun.com
10408c632d Raise version number after cloning 5.0.76 2009-01-14 20:16:10 +01:00
Chad MILLER
0ba397e0b2 Merge from dev tree. 2009-01-14 11:15:11 -05:00
Chad MILLER
8c9e81e8af Bug#38145: .frm file isn't sync'd with sync_frm enabled
Views weren't sync()d the same way other structures were.

In creating the FRM for views, obey the same rules for variable 
"sync_frm" as for everything else.
2009-01-14 11:11:31 -05:00
Chad MILLER
6ab0034f5a Fix comment. Boolean function returns true/false, not zero/one. 2009-01-14 11:10:36 -05:00
Davi Arnaut
918a038165 Bug#36326: nested transaction and select
The problem is that the query cache stores packets containing
the server status of the time when the cached statement was run.
This might lead to a wrong transaction status in the client side
if a statement is cached during a transaction and is later served
outside a transaction context (and vice-versa).

The solution is to take into account the transaction status when
storing in and serving from the query cache.
2009-01-13 20:07:06 -02:00
Joerg Bruehe
b72506881b Tool fix, needed for "compile-dist" to succeed on Solaris:
The default "awk" there cannot handle some of the scripts
which are used by BDB for configuration.

The fix:
1) Introduce a variable "AWK" in some of the BDB shell scripts,
2) search "gawk" and give it precedence over "awk"
   when assigning a value to the "AWK" variable,
   fail if neither is found,
3) use that variable when calling an "awk" program with one
   of the critical scripts.

The perfect solution would be to use the "awk" program found
by "configure", but we cannot follow that approach because
BDB's configuration is handled as a special case before the
overall "configure" is run. Because of this,
1) the "configure" result isn't yet available,
2) "configure" will not handle these BDB files.
Searching "gawk" is a (not-so-nice) way out.

Note that all this need not be perfectly portable,
it is needed only when we create a source distribution tarball
from a develkopment tree.
2009-01-13 14:52:22 +01:00
Georgi Kodinov
83823a1477 Bug #38795: Automatic search depth and nested join's results in server crash
The greedy optimizer tracks the current level of nested joins and the position
inside these by setting and maintaining a state that's global for the whole FROM
clause.
This state was correctly maintained inside the selection of the next partial plan
table (in best_extension_by_limited_search()). 
greedy_search() also moves the current position by adding the last partial match 
table when there's not enough tables in the partial plan found by 
best_extension_by_limited_search().
This may require update of the global state variables that describe the current
position in the plan if the last table placed by greedy_search is not a top-level 
join table.
Fixed by updating the state after placing the partial plan table in greedy_search()
in the same way this is done on entering the best_extension_by_limited_search().
Fixed the signature of the function called to update the state : 
check_interleaving_with_nj
2009-01-13 13:09:12 +02:00
Joerg Bruehe
f730c8e4b9 Set the version: 5.0.72sp1 2009-01-12 22:02:40 +01:00
Joerg Bruehe
4d97b06b4c Backport of a 5.0.74 fix into 5.0.72sp1:
Bug #39920: MySQL cannot deal with Leap Second expression in string literal.

Updated MySQL time handling code to react correctly on UTC leap second additions.
MySQL functions that return the OS current time, like e.g. CURDATE(), NOW() etc
will return :59:59 instead of :59:60 or 59:61.
As a result the reader will receive :59:59 for 2 or 3 consecutive seconds
during the leap second.

Original changesets:
> revision-id: kgeorge@mysql.com-20081201141835-rg8nnnadujj5wl9f
> parent: gshchepa@mysql.com-20081114172557-xh0jlzwal8ze3cy6
> committer: Georgi Kodinov <kgeorge@mysql.com>
> branch nick: B39920-5.0-bugteam
> timestamp: Mon 2008-12-01 16:18:35 +0200

> revision-id: kgeorge@mysql.com-20081201154106-c310zzy5or043rqa
> parent: kgeorge@mysql.com-20081201145656-6kjq91oga5nxbbob
> committer: Georgi Kodinov <kgeorge@mysql.com>
> branch nick: B39920-merge-5.0-bugteam
> timestamp: Mon 2008-12-01 17:41:06 +0200
2009-01-12 17:40:29 +01:00
Joerg Bruehe
037093b696 Backport of a 5.0.74 fix into 5.0.72sp1:
Bug#34760 Character set autodetection appears to fail
the problem is the same as reported in bug#20835,
so the fix is backport of bug#20835 patch.

Original changeset:
> revision-id: sergey.glukhov@sun.com-20081121123959-58ffhp2nitg7f40h
> parent: ramil@mysql.com-20081120100836-gct60cm67b1rui29
> committer: Sergey Glukhov <Sergey.Glukhov@sun.com>
> branch nick: mysql-5.0-bugteam
> timestamp: Fri 2008-11-21 16:39:59 +0400
2009-01-12 17:24:00 +01:00
Joerg Bruehe
c13bbbdace Backport of a 5.0.74 fix into 5.0.72sp1:
BUG#38842 - Fix for 25951 seems incorrect

Original changeset:
> revision-id: svoj@mysql.com-20081111091051-54pr96nf1z2s30gx
> parent: vvaintroub@mysql.com-20081110201804-bi98gcs9avsf58ff
> committer: Sergey Vojtovich <svoj@mysql.com>
> branch nick: mysql-5.0-bugteam-bug38842
> timestamp: Tue 2008-11-11 13:10:51 +0400
2009-01-12 17:18:53 +01:00
Joerg Bruehe
505df896b8 Backport of a 5.0.74 fix into 5.0.72sp1:
Bug #40021: Renaming view fails, archived .frm for view is
            missing after downgrade

Original changeset:
> revision-id: gshchepa@mysql.com-20081114172557-xh0jlzwal8ze3cy6
> parent: ramil@mysql.com-20081114074229-vj4fvfrpmz8jfub9
> committer: Gleb Shchepa <gshchepa@mysql.com>
> branch nick: mysql-5.0-bugteam
> timestamp: Fri 2008-11-14 21:25:57 +0400
2009-01-12 17:09:03 +01:00
Joerg Bruehe
cafe06c29a Backport of a 5.0.74 fix into 5.0.72sp1:
Remove bashisms from BUILD/compile-dist and configure.in,
so Bootstrap works on Solaris box;
- force GNU make in compile-dist;
- remove unportable "grep -q" from configure.in

Original changeset:
  revision-id: build@mysql.com-20081203041148-icwscut3bk09ds47
  parent: kgeorge@mysql.com-20081202125040-eiu6s7bk6s96s4xh
  author: timothy.smith@sun.com
  committer: MySQL Build Team <build@mysql.com>
  branch nick: mysql-5.0.74-release
  timestamp: Wed 2008-12-03 05:11:48 +0100
2009-01-12 16:46:19 +01:00
Tatiana A. Nurnberg
2048bd7117 auto-merge 2009-01-09 23:06:07 +01:00
Georgi Kodinov
06b3e7e21d fixed a compile warning 2009-01-09 20:30:55 +02:00
Tatiana A. Nurnberg
bbb6d2d00d auto-merge 2009-01-09 16:49:03 +01:00
Georgi Kodinov
054bdbb43a merged 41437 to 5.0-bugteam 2009-01-09 17:08:42 +02:00
Georgi Kodinov
7c3ae51647 Bug #41437: Value stored in 'case' lacks charset, causes segfault
When substituting system constant functions with a constant result
the server was not expecting that the function may return NULL.
Fixed by checking for NULL and returning Item_null (in the relevant
collation) if the result of the system constant function was NULL.
2009-01-09 13:50:18 +02:00
Tatiana A. Nurnberg
17bbe30cb0 Bug#41470: DATE_FORMAT() crashes the complete server with a valid date
Passing dubious "year zero" in non-zero date (not "0000-00-00") could
lead to negative value for year internally, while variable was unsigned.
This led to Really Bad Things further down the line.

Now doing calculations with signed type for year internally.
2009-01-08 10:25:31 +01:00
Patrick Crews
de5a933bd6 merge 2009-01-07 15:55:07 -05:00
Patrick Crews
ece07248f4 Bug#38833: mysql-test-run needs diff. Problem w/ error handling in calling diff on Windows.
Added function to check for diff and return an error message if the utility is not present.
Previously, the way we did this didn't work on Windows, but did work on *Nix systems.
2009-01-05 12:10:22 -05:00
Georgi Kodinov
8d16eb71b3 merge 5.0 -> 5.0-bugteam 2009-01-05 18:04:14 +02:00
Georgi Kodinov
e56284128f Reverted the fix for bug #25830 because of omissions and non-complete test
case.
2009-01-05 12:37:56 +02:00
Tatiana A. Nurnberg
4c788d93b1 auto-merge 2008-12-30 12:47:34 +01:00
Sergey Glukhov
f67ce47617 Bug#41131 "Questions" fails to increment - ignores statements instead stored procs(5.0 ver)
Added global status variable 'Queries' which represents
total amount of queries executed by server including
statements executed by SPs.
note: It's old behaviour of 'Questions' variable.
2008-12-29 16:06:53 +04:00
Joerg Bruehe
a94bfcf78b Merge from main 5.0 tree (includes 5.0.74), in preparation for pushing back. 2008-12-28 14:34:58 +01:00
Kent Boortz
b89aaffb25 Increased thread stack size to 128K, as this is the minimum (Bug#41577) 2008-12-28 07:57:09 +01:00
Sergey Glukhov
a31795b82d Bug#40953 SELECT query throws "ERROR 1062 (23000): Duplicate entry..." error
Table could be marked dependent because it is
either 1) an inner table of an outer join, or 2) it is a part of
STRAIGHT_JOIN. In case of STRAIGHT_JOIN table->maybe_null should not
be assigned. The fix is to set st_table::maybe_null to 'true' only
for those tables which are used in outer join.
2008-12-24 19:24:11 +04:00
Sergey Glukhov
026e9c3676 Bug#41456 SET PASSWORD hates CURRENT_USER()
init user->user struct with 
thd->security_ctx->priv_user context
if user->user is not initializied
2008-12-24 19:14:59 +04:00
Sergey Glukhov
59543e9f80 Bug#25830 SHOW TABLE STATUS behaves differently depending on table name
replace wild_case_compare with my_wildcmp which is multibyte safe function
2008-12-24 19:01:41 +04:00