Commit graph

58081 commits

Author SHA1 Message Date
Satya B
fc2243d69b merge mysql-5.0-bugteam to mysql-5.1-bugteam 2009-09-03 17:59:25 +05:30
Satya B
4a9e7e8e25 Fix for BUG#46591 - .frm file isn't sync'd with sync_frm enabled for
CREATE TABLE...LIKE...
      
The mysql server option 'sync_frm' is ignored when table is created with 
syntax CREATE TABLE .. LIKE.. 
      
Fixed by adding the MY_SYNC flag and calling my_sync() from my_copy() when
the flag is set.

In mysql_create_table(), when the 'sync_frm' is set, MY_SYNC flag is passed 
to my_copy(). 
      
Note: TestCase is not attached and can be tested manually using debugger.
2009-09-03 16:02:03 +05:30
Georgi Kodinov
80d872bd9d back to -bugteam 2009-09-02 19:42:46 +03:00
Georgi Kodinov
b14439985f null merge of 5.0 fixes backported from 5.1 2009-09-02 18:45:33 +03:00
Georgi Kodinov
21a01bd60e fixed a valgrind warning in partition_pruning 2009-09-02 18:42:08 +03:00
Georgi Kodinov
db8471aa85 Backported the --parallel=str option from mtr2 for backward compatibility
with the newer pb2 testing environments
2009-09-02 16:36:52 +03:00
Georgi Kodinov
e254a67787 merge 2009-09-02 16:07:52 +03:00
Georgi Kodinov
bb4c5acfb3 merge 2009-09-02 15:33:18 +03:00
Georgi Kodinov
f68c3c0a6e automerge 2009-09-02 15:22:32 +03:00
Georgi Kodinov
7d9f97f5ee fixed a valgrind warning in partitioning code 2009-09-02 15:20:47 +03:00
Davi Arnaut
f076ba2803 Manual merge. 2009-09-02 09:12:18 -03:00
Davi Arnaut
ca96ac5351 Post-merge fix. Observe C declaration placement rules. 2009-09-02 09:02:22 -03:00
Davi Arnaut
5109313e66 Increase thread stack size on HP-UX when built with debug. 2009-09-02 08:45:48 -03:00
Georgi Kodinov
6cfe48d727 moved version to 5.0-main 2009-09-02 13:23:37 +03:00
Georgi Kodinov
8f5b17f529 Fixed win32 compilation warnings 2009-09-02 13:22:47 +03:00
Georgi Kodinov
f7fa5d5a02 fixed compilation warnings 2009-09-02 13:09:01 +03:00
Mattias Jonsson
a04801b6fc merge to update with latest mysql-5.1-bugteam 2009-09-01 15:54:59 +02:00
Georgi Kodinov
dfcbeee1b4 Fixed a problem in how BUILD/check_cpu handles Core 2 Duo processors.
This fixes the regression introduced in 5.1 that prevents 64 bit builds on Intel while still keeping the core2 hack operational so the cluster can build.
2009-09-01 16:39:13 +03:00
Mattias Jonsson
02585b608a post push fix for bug#20577 and bug#46362, disabling warnings 2009-09-01 14:53:27 +02:00
Davi Arnaut
004427a9bb Bug#45611: Minor code cleanup
Remove a self assignment.
Rework a few constructs to avoid a potential overflow.

Based upon patch contributed by Michal Hrusecky
2009-09-01 09:32:26 -03:00
Mattias Jonsson
35ba36d13d Post fix patch for bug#20577 and bug#46362.
On 64-bits machines the calculation gets the wrong types and results
in very large numbers. Fixed by explicitly cast month to (int)
2009-09-01 13:04:56 +02:00
Tatiana A. Nurnberg
cdea23eba4 auto-merge 2009-08-31 12:56:01 -07:00
Tatiana A. Nurnberg
a88c86f67f auto-merge 2009-08-31 12:54:22 -07:00
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
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
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
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
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
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
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
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
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