Commit graph

24484 commits

Author SHA1 Message Date
Magnus Blåudd
ec025c694b BUG#47129 fix small bug in test 2009-10-08 14:00:43 +02:00
Magnus Blåudd
edd89cf7f7 Merge 2009-10-08 13:25:11 +02:00
Luis Soares
482503d278 BUG#44661: automerge local 5.1-bt bug branch --> local 5.1-bt up to date 2009-10-07 22:26:36 +01:00
Alfranio Correia
2a243fa2ce mysql-5.1-bugteam (local) --> mysql-5.1-bugteam 2009-10-06 11:25:36 +01:00
Georgi Kodinov
cfd737a472 merge mysql-5.1-pe 2009-10-06 10:10:47 +03:00
Alfranio Correia
b31e0c9a48 BUG#47678 Changes to n-tables that happen early in a trans. are only flushed upon commit
Let
    - T be a transactional table and N non-transactional table.
    - B be begin, C commit and R rollback.
    - N be a statement that accesses and changes only N-tables.
    - T be a statement that accesses and changes only T-tables.

In RBR, changes to N-tables that happen early in a transaction are not immediately flushed
upon committing a statement. This behavior may, however, break consistency in the presence
of concurrency since changes done to N-tables become immediately visible to other
connections. To fix this problem, we do the following:

  . B N N T C would log - B N C B N C B T C.
  . B N N T R would log - B N C B N C B T R.

Note that we are not preserving history from the master as we are introducing a commit that
never happened. However, this seems to be more acceptable than the possibility of breaking
consistency in the presence of concurrency.
2009-10-06 01:54:00 +01:00
Alfranio Correia
678eb3d66f BUG#47287 RBR: replication diff on basic case with txn- and non-txn tables in a statement
Let
  - T be a transactional table and N non-transactional table.
  - B be begin, C commit and R rollback.
  - M be a mixed statement, i.e. a statement that updates both T and N.
  - M* be a mixed statement that fails while updating either T or N.

This patch restore the behavior presented in 5.1.37 for rows either produced in
the RBR or MIXED modes, when a M* statement that happened early in a transaction
had their changes written to the binary log outside the boundaries of the
transaction and wrapped in a BEGIN/ROLLBACK. This was done to keep the slave
consistent with with the master as the rollback would keep the changes on N and
undo them on T. In particular, we do what follows:

  . B M* T C would log - B M* R B T C.

Note that, we are not preserving history from the master as we are introducing a
rollback that never happened. However, this seems to be more acceptable than
making the slave diverge. We do not fix the following case:

  . B T M* C would log B T M* C.

The slave will diverge as the changes on T tables that originated from the M
statement are rolled back on the master but not on the slave. Unfortunately, we
cannot simply rollback the transaction as this would undo any uncommitted
changes on T tables.

SBR is not considered in this patch because a failing statement is written to
the binary along with the error code and a slave executes and then rolls back
the statement when it has an associated error code, thus undoing the effects
on T. In RBR and MBR, a full-fledged fix will be pushed after the WL 2687.
2009-10-06 01:38:58 +01:00
John H. Embretsen
23bdf0d805 Bug#47746 - main.innodb_mysql fails sporadically:
Mask part of EXPLAIN output with '#' to account for varying row count estimation.
2009-10-05 15:16:27 +02:00
Satya B
37e4f861ed Applying InnoDB snapshot 5.1-ss5921, part 2. Fixes BUG#44369
BUG#44369 - InnoDB: Does not uniformly disallow disallowed column names

Detailed revision comments:

r5741 | jyang | 2009-09-03 07:16:01 +0300 (Thu, 03 Sep 2009) | 5 lines
branches/5.1: Block creating table with column name conflicting
with Innodb reserved key words. (Bug #44369) rb://151 approved
by Sunny Bains.


r5760 | jyang | 2009-09-04 07:07:34 +0300 (Fri, 04 Sep 2009) | 3 lines
branches/5.1: This is to revert change 5741. A return status for
create_table_def() needs to be fixed.

r5834 | jyang | 2009-09-11 00:43:05 +0300 (Fri, 11 Sep 2009) | 5 lines
branches/5.1: Block creating table with column name conflicting
with Innodb reserved key words. (Bug #44369) rb://151 approved
by Sunny Bains.
2009-10-05 16:47:48 +05:30
Satya B
cfae755d7d Applying InnoDB snapshot 5.1-ss5921, Part 1. Fixes BUG#46000
1. BUG#46000 - using index called GEN_CLUST_INDEX crashes server

Detailed revision comments:

r5895 | jyang | 2009-09-15 03:39:21 +0300 (Tue, 15 Sep 2009) | 5 lines
branches/5.1: Disallow creating index with the name of
"GEN_CLUST_INDEX" which is reserved for the default system
primary index. (Bug #46000) rb://149 approved by Marko Makela.
2009-10-05 16:39:07 +05:30
Georgi Kodinov
67ac3fac7f fixed typos in exeprimental list 2009-10-05 11:18:59 +03:00
Gleb Shchepa
2b78dbff54 Bug #44139: Table scan when NULL appears in IN clause
SELECT ... WHERE ... IN (NULL, ...) does full table scan,
even if the same query without the NULL uses efficient range scan.

The bugfix for the bug 18360 introduced an optimization:
if
  1) all right-hand arguments of the IN function are constants
  2) result types of all right argument items are compatible
     enough to use the same single comparison function to
     compare all of them to the left argument,

then

  we can convert the right-hand list of constant items to an array
  of equally-typed constant values for the further
  QUICK index access etc. (see Item_func_in::fix_length_and_dec()).

The Item_null constant item objects have STRING_RESULT
result types, so, as far as Item_func_in::fix_length_and_dec()
is aware of NULLs in the right list, this improvement efficiently
optimizes IN function calls with a mixed right list of NULLs and
string constants. However, the optimization doesn't affect mixed
lists of NULLs and integers, floats etc., because there is no
unique common comparator.


New optimization has been added to ignore the result type
of NULL constants in the static analysis of mixed right-hand lists.
This is safe, because at the execution phase we care about
presence of NULLs anyway.

1. The collect_cmp_types() function has been modified to optionally
   ignore NULL constants in the item list.
2. NULL-skipping code of the Item_func_in::fix_length_and_dec()
   function has been modified to work not only with in_string
   vectors but with in_vectors of other types.
2009-10-05 10:27:36 +05:00
Georgi Kodinov
5992e70623 rpl.rpl_trigger made experimental because of bug #47810 :
rpl.rpl_trigger.test fails with valgrind errors with the innodb plugin
2009-10-04 13:31:55 +03:00
Georgi Kodinov
b2511985ae Make innodb-autoinc.test experimental until bug#47809 is fixed. 2009-10-04 13:16:56 +03:00
Georgi Kodinov
2c14b845ae Disable innodb_information_schema.test until bug #47808 is fixed. 2009-10-04 13:15:53 +03:00
Ingo Struewing
c2e1614814 auto-merge 2009-10-02 13:27:48 +02:00
Ingo Struewing
0c522f7453 auto-merge 2009-10-01 15:54:11 +02:00
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
5a420e6d37 Manual merge. 2009-09-30 19:25:06 -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
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
Ingo Struewing
21586dfb08 WL#4259 - Debug Sync Facility
Backport from 6.0 to 5.1.
Only those sync points are included, which are used in debug_sync.test.

  The Debug Sync Facility allows to place synchronization points
  in the code:
  
  open_tables(...)
  
  DEBUG_SYNC(thd, "after_open_tables");
  
  lock_tables(...)
  
  When activated, a sync point can
  
  - Send a signal and/or
  - Wait for a signal
  
  Nomenclature:
  
  - signal:            A value of a global variable that persists
                       until overwritten by a new signal. The global
                       variable can also be seen as a "signal post"
                       or "flag mast". Then the signal is what is
                       attached to the "signal post" or "flag mast".
  
  - send a signal:     Assign the value (the signal) to the global
                       variable ("set a flag") and broadcast a
                       global condition to wake those waiting for
                       a signal.
  
  - wait for a signal: Loop over waiting for the global condition until
                       the global value matches the wait-for signal.
  
  Please find more information in the top comment in debug_sync.cc
  or in the worklog entry.
2009-09-29 17:38:40 +02:00
Tatiana A. Nurnberg
caf38a020c auto-merge 2009-09-29 08:19:46 -07: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
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
Georgi Kodinov
0213cd7976 merge 2009-09-28 16:48:40 +03: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
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
ea6cb65089 BUG#44661: rpl_ndb.rpl_ndb_circular_simplex fails because of
failure to cleanup of table

The test case was not dropping a table before exiting (ie, it was
not cleaning itself after execution). In this case, the warning
message stating that the test did not do a proper cleanup was
deterministic (which can be annoying).

I have found other tests cases on which mtr sporadically reports
that they have not cleaned up after execution:

 - rpl_ndb_circular
 - rpl_failed_optimize

In this case, the master was dropping a table but there was no
synchronization between the slave and the master.

This patch addresses the rpl_ndb_circular_simplex case by adding
the missing DROP table. The other cases are fixed by deploying
the missing sync_slave_with_master instruction.
2009-09-27 23:03:05 +01: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
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
7dde009fff added suppressions for existing warnings in the result file. 2009-09-24 16:19:06 +03:00
Satya B
0c9b77803c merge to mysql-5.1-bugteam 2009-09-23 17:45:56 +05:30