Commit graph

58245 commits

Author SHA1 Message Date
Tatiana A. Nurnberg
e8d45e1be7 manual merge 2009-08-31 12:40:33 -07:00
Tatiana A. Nurnberg
c3aac11c08 Bug#35132: MySQLadmin --wait ping always crashes on Windows systems
Failing to connect would release parts of the MYSQL struct.
We would then proceed to try again to connect without re-
initializing the struct.

We prevent the unwanted freeing of data we'll still need now.
2009-08-31 10:01:13 -07:00
Georgi Kodinov
b1dbd5c50f automerge 2009-08-31 17:11:54 +03:00
Georgi Kodinov
e926c448b8 automerge 5.1-main -> 5.1-bugteam 2009-08-31 17:09:09 +03:00
Georgi Kodinov
0366cbd563 merge 5.0-main -> 5.0-bugteam 2009-08-31 17:08:10 +03:00
Georgi Kodinov
4adb05e282 automerge 2009-08-31 16:40:35 +03:00
Bjorn Munch
84bd45c849 merge 2009-08-31 15:22:54 +02:00
Anurag Shekhar
600703e50a merging bugfix from 5.0 2009-08-31 13:26:09 +05:30
Anurag Shekhar
9b97856d82 merging with changes in bugteam branch. 2009-08-31 13:02:31 +05:30
Bjorn Munch
86a3262d26 forgot : in rpl's disabled.def 2009-08-31 09:24:59 +02:00
f37a5879b4 Bug #44331 Restore of database with events produces warning in replication
Update the test case for BUG#44331 to fix the push build failure.
2009-08-31 10:26:01 +08:00
Staale Smedseng
7aa88fcb95 Merge from 5.1-bugteam 2009-08-30 19:01:48 +02:00
Bjorn Munch
2194a927a9 yet another 42408 followup 2009-08-30 12:01:08 +02:00
Alexey Kopytov
6070491d4e Automerge. 2009-08-30 11:38:49 +04:00
Alexey Kopytov
62b95b90df Bug #46607: Assertion failed: (cond_type == Item::FUNC_ITEM)
results in server crash 
 
check_group_min_max_predicates() assumed the input condition 
item to be one of COND_ITEM, SUBSELECT_ITEM, or FUNC_ITEM. 
Since a condition of the form "field" is also a valid condition 
equivalent to "field <> 0", using such a condition in a query 
where the loose index scan was chosen resulted in a debug 
assertion failure. 
 
Fixed by handling conditions of the FIELD_ITEM type in 
check_group_min_max_predicates().
2009-08-30 11:03:37 +04:00
Bjorn Munch
7941f3c3a0 even more suppression fixes 2009-08-29 23:29:47 +02:00
90e25c6fb0 Bug #44331 Restore of database with events produces warning in replication
If an EVENT is created without the DEFINER clause set explicitly or with it set  
to CURRENT_USER, the master and slaves become inconsistent. This issue stems from 
the fact that in both cases, the DEFINER is set to the CURRENT_USER of the current 
thread. On the master, the CURRENT_USER is the mysqld's user, while on the slave,  
the CURRENT_USER is empty for the SQL Thread which is responsible for executing 
the statement.

To fix the problem, we do what follows. If the definer is not set explicitly,  
a DEFINER clause is added when writing the query into binlog; if 'CURRENT_USER' is 
used as the DEFINER, it is replaced with the value of the current user before 
writing to binlog.
2009-08-29 16:52:22 +08:00
Bjorn Munch
bc6ea4ced7 A few more suppression fixes after 42408 2009-08-29 10:30:59 +02:00
Davi Arnaut
2d6c97e0e6 Reduce test case runtime. 2009-08-28 18:49:16 -03:00
Staale Smedseng
f59ef9eafa Merge from 5.0 for 43414 2009-08-28 18:21:54 +02:00
Staale Smedseng
2217de2513 Bug #43414 Parenthesis (and other) warnings compiling MySQL
with gcc 4.3.2
      
This patch fixes a number of GCC warnings about variables used
before initialized. A new macro UNINIT_VAR() is introduced for
use in the variable declaration, and LINT_INIT() usage will be
gradually deprecated. (A workaround is used for g++, pending a
patch for a g++ bug.)
      
GCC warnings for unused results (attribute warn_unused_result)
for a number of system calls (present at least in later
Ubuntus, where the usual void cast trick doesn't work) are
also fixed.
2009-08-28 17:51:31 +02:00
Davi Arnaut
a0e44ec1e8 Fix for a few assorted compiler warnings. 2009-08-28 12:06:59 -03:00
Bjorn Munch
dbbf8d83ff Bug #42408 Faulty regex for detecting [Warning] and [ERROR] in mysqld error log
Some follow-up test fixes after seeing effect in PB2
2009-08-28 16:13:27 +02:00
Bjorn Munch
013c46cb36 Bug #46973 MTR: extract_warning_lines does not check it's extracting lines for current test
Rewrote logic (first commit was incomplete, sorry)
2009-08-28 15:02:48 +02:00
Mattias Jonsson
edb71b0cdd merge 2009-08-28 13:54:17 +02:00
Mattias Jonsson
2c5e227875 Manual merge between bug#46362 and bug#20577. 2009-08-28 12:55:59 +02:00
Alfranio Correia
831129493e merge mysql-5.0-bugteam --> mysql-5.1-bugteam 2009-08-28 10:45:57 +01:00
Alfranio Correia
95d185693d auto-merge mysql-5.0-bugteam (local) --> mysql-5.0-bugteam 2009-08-28 10:29:04 +01:00
Alfranio Correia
fe03c7dce6 BUG#46861 Auto-closing of temporary tables broken by replicate-rewrite-db
When a connection is dropped any remaining temporary table is also automatically
dropped and the SQL statement of this operation is written to the binary log in
order to drop such tables on the slave and keep the slave in sync. Specifically,
the current code base creates the following type of statement:
DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `db`.`table`;

Unfortunately, appending the database to the table name in this manner circumvents
the replicate-rewrite-db option (and any options that check the current database).
To solve the issue, we started writing the statement to the binary as follows:
use `db`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `table`;
2009-08-27 17:28:09 +01:00
Bjorn Munch
d458d55755 Bug #46322 Sporadic timeout in mysql_upgrade.test
Apparently caused by logging to table
Turn on logging to file only, add to .opt file for tests needing log to table
2009-08-27 15:17:09 +02:00
Alfranio Correia
c21fbff338 BUG#46864 Incorrect update of InnoDB table on slave when using trigger with myisam table
Slave does not correctly handle "expected errors" leading to inconsistencies
between the mater and slave. Specifically, when a statement changes both
transactional and non-transactional tables, the transactional changes are
automatically rolled back on the master but the slave ignores the error and
does not roll them back thus leading to inconsistencies.
      
To fix the problem, we automatically roll back a statement that fails on
the slave but note that the transaction is not rolled back unless a "rollback"
command is in the relay log file.
2009-08-27 13:46:29 +01:00
Georgi Kodinov
8ca8f70daa Bug #46749: Segfault in add_key_fields() with outer subquery level
field references

This error requires a combination of factors : 
1. An "impossible where" in the outermost SELECT
2. An aggregate in the outermost SELECT
3. A correlated subquery with a WHERE clause that includes an outer 
field reference as a top level WHERE sargable predicate

When JOIN::optimize detects an "impossible WHERE" it will bail out
without doing the rest of the work and initializations. It will not
call make_join_statistics() as well.  And make_join_statistics fills 
in various structures for each table referenced.
When processing the result of the "impossible WHERE" the query must
send a single row of data if there are aggregate functions in it.
In this case the server marks all the aggregates as having received 
no rows and calls the relevant Item::val_xxx() method on the SELECT
list. However if this SELECT list happens to contain a correlated 
subquery this subquery is evaluated in a normal evaluation mode.
And if this correlated subquery has a reference to a field from the 
outermost "impossible where" SELECT the add_key_fields will mistakenly
consider the outer field reference as a "local" field reference when 
looking for sargable predicates.
But since the SELECT where the outer field reference refers to is not
completely initialized due to the "impossible WHERE" in this level
we'll get a NULL pointer reference.
Fixed by making a better condition for discovering if a field is "local"
to the SELECT level being processed. 
It's not enough to look for OUTER_REF_TABLE_BIT in this case since 
for outer references to constant tables the Item_field::used_tables() 
will return 0 regardless of whether the field reference is from the 
local SELECT or not.
2009-08-27 14:40:42 +03:00
Sergey Glukhov
be4b02784a 5.0-bugteam->5.1-bugteam merge 2009-08-27 15:59:25 +05:00
Bjorn Munch
d307fbbf2c Bug #46164 memory leak in mysqltest after parse error with --debug
Moved some dynstr_free() further up
2009-08-27 12:34:07 +02:00
Sergey Glukhov
d9d71d0f50 Bug#46184 Crash, SELECT ... FROM derived table procedure analyze
The crash happens because select_union object is used as result set
for queries which have derived tables.
select_union use temporary table as data storage and if
fields count exceeds 10(count of values for procedure ANALYSE())
then we get a crash on fill_record() function.
2009-08-27 15:22:19 +05:00
Alfranio Correia
01eda6596d Post-fix for BUG#28976.
Updated main.mysqlbinlog_row_trans's result file as 
TRUNCATE statements are wrapped in BEGIN...COMMIT.
2009-08-27 10:32:27 +01:00
Georgi Kodinov
83984db0fc merged 5.0-bugteam -> 5.1-bugteam 2009-08-27 10:46:35 +03:00
Alfranio Correia
dbcfef4cf2 BUG#28976 Mixing trans and non-trans tables in one transaction results in incorrect
binlog

Mixing transactional (T) and non-transactional (N) tables on behalf of a
transaction may lead to inconsistencies among masters and slaves in STATEMENT
mode. The problem stems from the fact that although modifications done to
non-transactional tables on behalf of a transaction become immediately visible
to other connections they do not immediately get to the binary log and therefore
consistency is broken. Although there may be issues in mixing T and M tables in
STATEMENT mode, there are safe combinations that clients find useful.

In this bug, we fix the following issue. Mixing N and T tables in multi-level
(e.g. a statement that fires a trigger) or multi-table table statements (e.g.
update t1, t2...) were not handled correctly. In such cases, it was not possible
to distinguish when a T table was updated if the sequence of changes was N and T.
In a nutshell, just the flag "modified_non_trans_table" was not enough to reflect
that both a N and T tables were changed. To circumvent this issue, we check if an
engine is registered in the handler's list and changed something which means that
a T table was modified.

Check WL 2687 for a full-fledged patch that will make the use of either the MIXED or
ROW modes completely safe.
2009-08-27 00:13:03 +01:00
Mattias Jonsson
f56dc20835 merge 2009-08-26 14:45:50 +02:00
Mattias Jonsson
b19ad3f807 merge 2009-08-26 14:40:18 +02:00
Mattias Jonsson
401fb7c6fb Bug#20577: Partitions: use of to_days() function leads to selection failures
Problem was that the partition containing NULL values
was pruned away, since '2001-01-01' < '2001-02-00' but
TO_DAYS('2001-02-00') is NULL.

Added the NULL partition for RANGE/LIST partitioning on TO_DAYS()
function to be scanned too.

Also fixed a bug that added ALLOW_INVALID_DATES to sql_mode
(SELECT * FROM t WHERE date_col < '1999-99-99' on a RANGE/LIST
partitioned table would add it).
2009-08-26 12:59:49 +02:00
Mattias Jonsson
3b756a01a0 Bug#46362: Endpoint should be set to false for TO_DAYS(DATE)
There were a problem since pruning uses the field
for comparison (while evaluate_join_record uses longlong),
resulting in pruning failures when comparing DATE to DATETIME.

Fix was to always comparing DATE vs DATETIME as DATETIME,
by adding ' 00:00:00' to the DATE string.

And adding optimization for comparing with 23:59:59, so that
DATETIME_col > '2001-02-03 23:59:59' ->
TO_DAYS(DATETIME_col) > TO_DAYS('2001-02-03 23:59:59') instead
of '>='.
2009-08-26 12:51:23 +02:00
Bjorn Munch
4994e66783 Bug #42408 Faulty regex for detecting [Warning] and [ERROR] in mysqld error log
Enabled proper pattern for Warnings and ERRORs
Added some suppressions
2009-08-25 15:56:50 +02:00
Jonathan Perkin
c5c392af51 Disable ftexample to match other packages, ride previous changelog entry. 2009-08-25 13:00:23 +02:00
Davi Arnaut
31afccc407 Bug#45261: Crash, stored procedure + decimal
The problem was that creating a DECIMAL column from a decimal
value could lead to a failed assertion as decimal values can
have a higher precision than those attached to a table. The
assert could be triggered by creating a table from a decimal
with a large (> 30) scale. Also, there was a problem in
calculating the number of digits in the integral and fractional
parts if both exceeded the maximum number of digits permitted
by the new decimal type.

The solution is to ensure that truncation procedure is executed
when deducing a DECIMAL column from a decimal value of higher
precision. If the integer part is equal to or bigger than the
maximum precision for the DECIMAL type (65), the integer part
is truncated to fit and the fractional becomes zero. Otherwise,
the fractional part is truncated to fit into the space left
after the integer part is copied.

This patch borrows code and ideas from Martin Hansson's patch.
2009-08-24 16:47:08 -03:00
Georgi Kodinov
e4f8deb226 Bug #37044: Read overflow in opt_range.cc found during "make test"
The code was using a special global buffer for the value of IS NULL ranges.
This was not always long enough to be copied by a regular memcpy. As a 
result read buffer overflows may occur.
Fixed by setting the null byte to 1 and setting the rest of the field disk image
to NULL with a bzero (instead of relying on the buffer and memcpy()).
2009-08-24 15:28:03 +03:00
Jonathan Perkin
ac01a89909 Tidy previous, put example storage engine back as it's used by tests. 2009-08-24 14:06:01 +02:00
Alfranio Correia
793e523b4e auto-merge mysql-5.1-bugteam (local) --> mysql-5.1-bugteam 2009-08-24 11:37:44 +01:00
Alfranio Correia
bb14ffb452 auto-merge mysql-5.1-bugteam (local) --> mysql-5.1-bugteam 2009-08-24 10:24:52 +01:00
Jonathan Perkin
c4fa4f31ae Apply changes from mysql-5.1.38-release clone:
- Add conditionals for bundled zlib and innodb plugin.
 - Apply patch from bug#46834 to install the test suite in RPMs.
 - Add plugins to RPMs.  Disable example plugins.
2009-08-24 10:13:34 +01:00