Commit graph

58273 commits

Author SHA1 Message Date
5903c1e94c Bug #45677 Slave stops with Duplicate entry for key PRIMARY when using trigger
The problem is that there is only one autoinc value associated with 
the query when binlogging. If more than one autoinc values are used 
in the query, the autoinc values after the first one can be inserted 
wrongly on slave. So these autoinc values can become inconsistent on 
master and slave.

The problem is resolved by marking all the statements that invoke 
a trigger or call a function that updated autoinc fields as unsafe, 
and will switch to row-format in Mixed mode. Actually, the statement 
is safe if just one autoinc value is used in sub-statement, but it's 
impossible to check how many autoinc values are used in sub-statement.)
2009-10-01 07:19:36 +08:00
Davi Arnaut
33be6a3a9a Manual merge. 2009-09-30 20:06:08 -03:00
Davi Arnaut
1442ef0f25 Post-merge cleanup: Reorganize code for better comprehensibility.
Removes the need of a hack (the jump to label).
2009-09-30 19:59:30 -03:00
Davi Arnaut
5a420e6d37 Manual merge. 2009-09-30 19:25:06 -03:00
Davi Arnaut
e1e038ab1e Post-merge fix: DBUG macros are wrapped inside a loop. 2009-09-30 19:14:55 -03:00
Davi Arnaut
d941a1f304 Bug#47525: MySQL crashed (Federated)
On Mac OS X or Windows, sending a SIGHUP to the server or a
asynchronous flush (triggered by flush_time), would cause the
server to crash.

The problem was that a hook used to detach client API handles
wasn't prepared to handle cases where the thread does not have
a associated session.

The solution is to verify whether the thread has a associated
session before trying to detach a handle.
2009-09-30 18:38:02 -03:00
Kristofer Pettersson
70891edd19 Null merge mysql-5.0-bugteam => mysql-5.1-bugteam 2009-09-30 21:37:52 +02:00
Jonathan Perkin
ddc52dc040 Merge into mysql-5.1-bugteam 2009-09-30 14:48:16 +01:00
Jonathan Perkin
e1f4344e68 bug#41546: mysql-stress-run.pl is not packaged on Windows
Copy mysql-stress-run.pl into noinstall package.
2009-09-30 14:46:47 +01:00
Kristofer Pettersson
f7ebdaef80 Bug#34895 'show procedure status' or 'show function status' +
'flush tables' crashes

The server crashes when 'show procedure status' and 'flush tables' are
run concurrently.

This is caused by the way mysql.proc table is added twice to the list
of table to lock although the requirements on the current locking API
assumes differently.

No test case is submitted because of the nature of the crash which is 
currently difficult to reproduce in a deterministic way.

This is a backport from 5.1
2009-09-30 14:50:25 +02:00
Martin Hansson
4545c5ba3c Merge of Bug#35996 2009-09-30 09:31:20 +02:00
f4b6aeaf5b Bug #46998 mysqlbinlog can't output BEGIN even if the database is included in a transaction
The 'BEGIN/COMMIT/ROLLBACK' log event could be filtered out if the
database is not selected by --database option of mysqlbinlog command.
This can result in problem if there are some statements in the
transaction are not filtered out.

To fix the problem, mysqlbinlog will output 'BEGIN/ROLLBACK/COMMIT' 
in regardless of the database filtering rules.
2009-09-30 10:31:25 +08:00
869c011218 Bug #46998 mysqlbinlog can't output BEGIN even if the database is included in a transaction
The 'BEGIN/COMMIT/ROLLBACK' log event could be filtered out if the
database is not selected by --database option of mysqlbinlog command.
This can result in problem if there are some statements in the
transaction are not filtered out.

To fix the problem, mysqlbinlog will output 'BEGIN/ROLLBACK/COMMIT' 
in regardless of the database filtering rules.
2009-09-30 10:01:52 +08:00
Tatiana A. Nurnberg
00e5cea84d auto-merge 2009-09-29 09:09:17 -07:00
Kristofer Pettersson
4e9be70589 Null merge mysql-5.0-bugteam => mysql-5.1-bugteam 2009-09-29 17:26:54 +02:00
Tatiana A. Nurnberg
caf38a020c auto-merge 2009-09-29 08:19:46 -07:00
Kristofer Pettersson
f79b783b7e autocommit 2009-09-29 17:18:55 +02:00
Kristofer Pettersson
21d401c202 Bug#42108 Wrong locking for UPDATE with subqueries leads to broken statement
replication
              
MySQL server uses wrong lock type (always TL_READ instead of
TL_READ_NO_INSERT when appropriate) for tables used in
subqueries of UPDATE statement. This leads in some cases to
a broken replication as statements are written in the wrong
order to the binlog.
2009-09-29 17:06:51 +02:00
Martin Hansson
e6b1bade90 Merge of Bug#35996. 2009-09-29 16:57:20 +02:00
Alexey Botchkov
355b040547 merging 2009-09-29 18:28:01 +05:00
Davi Arnaut
73153f1cb3 Don't use the semicolon character as a argument separator as it
can be interpreted as a shell metacharacter in some circumstances.
For example, it is interpreted as a command separator when invoking
a debugger.
2009-09-29 11:11:46 -03:00
Alexey Botchkov
2cafcbb50c merging 2009-09-29 18:23:30 +05:00
Tatiana A. Nurnberg
ba6bd99620 auto-merge 2009-09-29 06:08:18 -07:00
Alexey Botchkov
45bdc1e063 merging 2009-09-29 17:49:36 +05:00
Davi Arnaut
fc3740368a Bug#45567: Fast ALTER TABLE broken for enum and set
The problem was that appending values to the end of an existing
ENUM or SET column was being treated as table data modification,
preventing a immediately (fast) table alteration that occurs when
only table metadata is being modified.

The cause was twofold: adding a enumeration or set members to the 
end of the list of valid member values was not being considered
a "compatible" table alteration, and for SET columns, the check
was being done upon the max display length and not the underlying
(pack) length of the field.

The solution is to augment the function that checks wether two ENUM
or SET fields are compatible -- by comparing the pack lengths and
performing a limited comparison of the member values.
2009-09-29 07:58:42 -03:00
Mattias Jonsson
ecc556f492 merge 2009-09-29 10:12:04 +02:00
Sergey Glukhov
4299943064 Bug#47150 Assertion in Field_long::val_int() on MERGE + TRIGGER + multi-table UPDATE
The bug is not related to MERGE table or TRIGGER. More correct description
would be 'assertion on multi-table UPDATE + NATURAL JOIN + MERGEABLE VIEW'.
On PREPARE stage(see test case) we call mark_common_columns() func which
creates ON condition for NATURAL JOIN and sets appropriate
table read_set bitmaps for fields which are used in ON condition.
On EXECUTE stage mark_common_columns() is not called, we set
necessary read_set bitmaps in setup_conds(). But 'B.f1' field
is already processed and related item alredy fixed before
setup_conds() as updated field and setup_conds can not set
read_set bitmap because of that.
The fix is to set read_set bitmap for appropriate table field even
if Item_direct_view_ref item which represents a refernce to this field
is fixed.
2009-09-29 07:23:38 +05:00
Jonathan Perkin
3e56bac07c Merge up to mysql-5.1-bugteam 2009-09-28 17:32:14 +01:00
Jonathan Perkin
2f0a79a05a Merge to mysql-5.0-bugteam 2009-09-28 15:24:52 +01:00
Jonathan Perkin
8f640b6239 bug#30954: "configure" script in binary distributions considered harmfull
Add --help option.
2009-09-28 15:14:33 +01:00
Georgi Kodinov
da5d0c90a4 Fixed Sun Studio 8 compilation failures as suggested by Jorgen and reviewed
by Svoj over e-mail.
2009-09-28 16:55:01 +03:00
Georgi Kodinov
0213cd7976 merge 2009-09-28 16:48:40 +03:00
Magnus Blåudd
f165fa96b4 Merge 2009-09-28 14:54:36 +02:00
Tatiana A. Nurnberg
197182d749 Bug#43746: YACC return wrong query string when parse 'load data infile' sql statement
"load data" statements were written to the binlog as a mix of the original statement
and bits recreated from parse-info. This relied on implementation details and broke
with IGNORE_SPACES and versioned comments.

We now completely resynthesize the query for LOAD DATA for binlog (which among other
things normalizes them somewhat with regard to case, spaces, etc.).
We have already parsed the query properly, so we make use of that rather
than mix-and-match string literals and parsed items.
This should make us safe with regard to versioned comments, even those
spanning multiple tokens. Also no longer affected by IGNORE_SPACES.
2009-09-28 05:41:10 -07:00
Magnus Blåudd
0b4b556911 Merge bug#42850 to 5.1 2009-09-28 14:40:45 +02:00
Magnus Blåudd
56b7b74b25 Merge bug#42850 to 5.0 2009-09-28 14:38:06 +02:00
Martin Hansson
4b17ef621f Bug#35996: SELECT + SHOW VIEW should be enough to display
view definition

During SHOW CREATE VIEW there is no reason to 'anonymize'
errors that name objects that a user does not have access
to. Moreover it was inconsistently implemented. For example
base tables being referenced from a view appear to be ok,
but not views. The manual on the other hand is clear: If a
user has the privileges SELECT and SHOW VIEW, the view
definition is available to that user, period. The fix
changes the behavior to support the manual.
2009-09-28 13:25:47 +02:00
Martin Hansson
99bb6acb62 Bug#46958: Assertion in Diagnostics_area::set_ok_status,
trigger, merge table
            
The problem with break statements is that they have very
local effects. Hence a break statement within the inner loop
of a nested-loops join caused execution to proceed to the
next table even though a serious error occurred. The problem
was fixed by breaking out the inner loop into its own
method. The change empowers all errors to terminate the
execution.
            
The errors that will now halt multi-DELETE execution
altogether are 
  - triggers returning errors
  - handler errors
  - server being killed
2009-09-28 12:48:52 +02:00
90d4b21d1d BUG#43579 mysql_upgrade tries to alter log tables on replicated database
All statements executed by mysql_upgrade are binlogged and then are replicated to slave.
This will result in some errors. The report of this bug has demonstrated some examples.

Master and slave should be upgraded separately. All statements executed by
mysql_upgrade will not be binlogged. 
--write-binlog and --skip-write-binlog options are added into mysql_upgrade. 
These options control whether sql statements are binlogged or not.
2009-09-28 14:24:19 +08:00
f8f2362bf4 BUG #46572 DROP TEMPORARY table IF EXISTS does not have a consistent behavior in ROW mode
In RBR, 'DROP TEMPORARY TABLE IF EXISTS...' statement is binlogged when the table
does not exist.
      
In fact, 'DROP TEMPORARY TABLE ...' statement should never be binlogged in RBR
no matter if the table exists or not. 
This patch addresses this by checking whether we are dropping a
temporary table or not, when building the custom drop statement.
2009-09-28 10:23:06 +08:00
Luis Soares
80f96fae63 BUG#47312: RBR: Disabling key on slave breaks replication:
HA_ERR_WRONG_INDEX
      
In RBR, disabling keys on slave table will break replication when
updating or deleting a record. When the slave thread tries to
find the row, by searching in the storage engine, it checks
whether the table has a key or not. If it has one, then the slave
thread uses it to search the record.
      
Nonetheless, the slave only checks whether the key exists or not,
it does not verify if it is active. Should the key be
disabled (eg, DBA has issued an ALTER TABLE ... DISABLE KEYS)
then it will result in error: HA_ERR_WRONG_INDEX.
      
This patch addresses this issue by making the slave thread also
check whether the key is active or not before actually using it.
2009-09-27 22:02:47 +01:00
9256ace00a Bug #43913 rpl_cross_version can't pass on conflicts complainig clash with --slave-load-tm
The failure is not reproduced on 5.1, so enable the 'rpl_cross_version' test.
2009-09-27 18:12:58 +08:00
774a8db960 Bug #46931 rpl.rpl_get_master_version_and_clock fails on hpux11.31
Network error happened here, but it can be caused by CR_CONNECTION_ERROR, 
CR_CONN_HOST_ERROR, CR_SERVER_GONE_ERROR, CR_SERVER_LOST, ER_CON_COUNT_ERROR, 
and ER_SERVER_SHUTDOWN. We just check CR_SERVER_LOST here, so the test fails.

To fix the problem, check all errors that can be cause by the master shutdown.
2009-09-27 17:00:29 +08:00
Omer BarNir
864ed1efd0 Checking in new version of 'mysql-stress-test.pl that was used for the last few month
from test-extra tree.

Changes include improvements to error handling and are based on WL#4685
2009-09-25 08:27:55 -07:00
Georgi Kodinov
2c1c014367 fixed a typo in valgrind.supp 2009-09-25 14:52:41 +03:00
Georgi Kodinov
1648dad6ed merge 2009-09-25 14:39:05 +03:00
Mattias Jonsson
7d9548d26b Bug#32430: 'show innodb status' causes errors
Invalid (old?) table or database name in logs

Problem was still not completely fixed, due to
qouting.

This is the server side only fix (in explain_filename),
the change from filename_to_tablename to use explain_filename
in the InnoDB code must be done before the bug is
fixed.
2009-09-25 11:26:49 +02:00
Georgi Kodinov
90f570b5b3 added more valgrind suppressions for glibc 2.6.1 2009-09-25 11:57:14 +03:00
Georgi Kodinov
138474ec03 More valgrind suppressions added for libc 2.6.1 64 bit 2009-09-24 18:29:00 +03:00
Georgi Kodinov
b67de14d44 merged compilation warning fixes 2009-09-24 16:28:13 +03:00