Commit graph

65875 commits

Author SHA1 Message Date
Georgi Kodinov
ac738d8265 merge 2010-06-04 17:10:22 +03:00
Georgi Kodinov
121e04732e Bug #52315: utc_date() crashes when system time > year 2037
Some of the server implementations don't support dates later
than 2038 due to the internal time type being 32 bit.
Added checks so that the server will refuse dates that cannot
be handled by either throwing an error when setting date at 
runtime or by refusing to start or shutting down the server if 
the system date cannot be stored in my_time_t.
2010-06-04 16:21:19 +03:00
Horst.Hunger
517f586762 Patch for bug#52913: Inserted check if mysqlhotcopy script is existing as requested by review. DIsabled the test until bug#54129 will befixed. 2010-06-04 10:53:18 +02:00
Luis Soares
ef0200bd49 BUG 53893: Automerged from mysql-5.1-bugteam-gca into mysql-5.1-bugteam.
Post-push fix.
2010-06-04 00:49:09 +01:00
Luis Soares
aad9408658 BUG 53893: Automerged from mysql-5.1-bugteam-gca into mysql-trunk-merge.
Post-push fix.
2010-06-04 00:47:30 +01:00
Luis Soares
1b61dcf434 BUG#53893: RBR: nullable unique key can lead to out-of-sync slave
Post-push fix.
  
There was a valgrind issue on the loop that checks whether there
are NULL fields in the UNIQUE KEY or not. In detail, for the last 
iteration the server may read out of the key_part array boundaries,
making valgrind to output warnings.

We fix this by correcting the loop, ie, moving the part that reads
from the key_part to be inside the loop statement block. This way
the assignment is protected by the loop condition.
2010-06-04 00:45:07 +01:00
Konstantin Osipov
cbf4019a1b A follow up for the previous patch, titled:
A code review comment for Bug#52289.
Encapsulate the deadlock detection functionality into
a visitor class...

Remove a race introduced by omission: 
initialize iterators under a read lock on the object.

sql/mdl.cc:
  Initialize iterators under a read lock on the object.
2010-06-03 18:32:56 +04:00
Konstantin Osipov
e7854c86a7 A code review comment for Bug#52289.
Encapsulate the deadlock detection functionality into 
a visitor class, and separate it from the wait-for graph
traversal code.

Use "Internal iterator" and "Visitor" patterns to 
achieve the desired separation of responsibilities.

Add comments.

sql/mdl.cc:
  Encapsulate deadlock detection into a class.
sql/mdl.h:
  Adjust for a rename of a class.
2010-06-03 18:08:22 +04:00
Jimmy Yang
5f336d9956 Remove the unneccesary innobase_strcasecmp() in
innobase_get_mysql_key_number_for_index() created as a bug fix for
#53592 since dict_table_t could already unique identify
the table.
2010-06-03 06:37:01 -07:00
Davi Arnaut
745d2141ba Don't enable safemalloc for valgrind builds, it's too slow. 2010-06-03 09:54:37 -03:00
Marko Mäkelä
c440ee8676 Merge a change from mysql-5.1-innodb:
------------------------------------------------------------
revno: 3500
revision-id: marko.makela@oracle.com-20100603095032-v5ptkkzt1bhz0m1d
parent: marko.makela@oracle.com-20100603094859-8cibt7xns239jjvc
committer: Marko Mäkelä <marko.makela@oracle.com>
branch nick: 5.1-innodb
timestamp: Thu 2010-06-03 12:50:32 +0300
message:
  Move some InnoDB tests to mysql-test/suite/innodb.
2010-06-03 13:28:40 +03:00
Horst.Hunger
5c6a9a5f6f Patch for bug#52913 including all review results and changes of date format. 2010-06-03 10:31:26 +02:00
Tor Didriksen
7cfc7d7265 Skip perfschema.misc if "var" is a symlink (due to Bug 51447).
mysql-test/include/not_var_link.inc:
  Chop off /$child_num before testing if "var" is a symlink
2010-06-03 09:52:15 +02:00
Alexander Nozdrin
b2b8a220f7 Disable binlog.binlog_spurious_ddl_errors due to Bug 54195. 2010-06-03 11:50:50 +04:00
Luis Soares
d9c910b008 BUG 53893: automerged from mysql-5.1-bugteam into mysql-trunk-merge. 2010-06-03 00:08:35 +01:00
Luis Soares
20fc48fc38 BUG 53893: automerged bug branch into mysql-5.1-bugteam latest. 2010-06-03 00:04:27 +01:00
Luis Soares
1b27674429 BUG#53893: RBR: nullable unique key can lead to out-of-sync slave
When using Unique Keys with nullable parts in RBR, the slave can
choose the wrong row to update. This happens because a table with
an unique key containing nullable parts cannot strictly guarantee 
uniqueness. As stated in the manual, for all engines, a UNIQUE 
index allows multiple NULL values for columns that can contain 
NULL.

We fix this at the slave by extending the checks before assuming
that the row found through an unique index is is the correct
one. This means that when a record (R) is fetched from the storage
engine and a key that is not primary (K) is used, the server does 
the following: 

 - If K is unique and has no nullable parts, it returns R;
 - Otherwise, if any field in the before image that is part of K
   is null do an index scan;
 - If there is no NULL field in the BI part of K, then return R.

A side change: renamed the existing test case file and added a
test case covering the changes in this patch.
2010-06-02 23:26:12 +01:00
He Zhenxing
fa71264e0d Auto merge 2010-06-02 21:24:53 +08:00
He Zhenxing
c54259446d Auto merge from 5.1-rep-semisync 2010-06-02 20:57:39 +08:00
Vasil Dimov
b591cce1d2 Adjust .bzr-mysql/default.conf that was reverted by a recent bzr pull 2010-06-02 15:49:05 +03:00
Vasil Dimov
ca24c12b5c Merge mysql-trunk-bugfixing from bk-internal into my local tree 2010-06-02 15:43:14 +03:00
Vasil Dimov
ee07d63945 Merge mysql-trunk-innodb -> mysql-trunk-bugfixing 2010-06-02 15:40:49 +03:00
Luis Soares
ce79ca3b7e WL#5408: Reduce Pushbuild2 turnaround times for rpl suite.
Follow up patch to prefix all entries in disabled-per-push.list
with "rpl.", now that BUG#54161 has been pushed.
2010-06-02 13:24:55 +01:00
Alexander Barkov
eed26e92a6 Bug#52520 Difference in tinytext utf column metadata
Problems:
      - regression (compating to version 5.1) in metadata for BLOB types
      - inconsistency between length metadata in server and embedded for BLOB types
      - wrong max_length calculation in items derived from BLOB columns
     @ libmysqld/lib_sql.cc
        Calculating length metadata in embedded similary to server version,
        using new function char_to_byte_length_safe().
     @ mysql-test/r/ctype_utf16.result
        Adding tests
     @ mysql-test/r/ctype_utf32.result
        Adding tests
     @ mysql-test/r/ctype_utf8.result
        Adding tests
     @ mysql-test/r/ctype_utf8mb4.result
        Adding tests
     @ mysql-test/t/ctype_utf16.test
        Adding tests
     @ mysql-test/t/ctype_utf32.test
        Adding tests
     @ mysql-test/t/ctype_utf8.test
        Adding tests
     @ mysql-test/t/ctype_utf8mb4.test
        Adding tests
     @ sql/field.cc
        Overriding char_length() for Field_blob:
        unlike in generic Item::char_length() we don't
        divide to mbmaxlen for BLOBs.
     @ sql/field.h
        - Making Field::char_length() virtual
        - Adding prototype for Field_blob::char_length()
     @ sql/item.h
        - Adding new helper function char_to_byte_length_safe()
        - Using new function
     @ sql/protocol.cc
        Using new function char_to_byte_length_safe().

    modified:
      libmysqld/lib_sql.cc
      mysql-test/r/ctype_utf16.result
      mysql-test/r/ctype_utf32.result
      mysql-test/r/ctype_utf8.result
      mysql-test/r/ctype_utf8mb4.result
      mysql-test/t/ctype_utf16.test
      mysql-test/t/ctype_utf32.test
      mysql-test/t/ctype_utf8.test
      mysql-test/t/ctype_utf8mb4.test
      sql/field.cc
      sql/field.h
      sql/item.h
      sql/protocol.cc
2010-06-02 16:23:50 +04:00
Luis Soares
ec6285d5f7 BUG 54161: automerged mysql-5.1-bugteam into mysql-trunk-merge. 2010-06-02 13:16:47 +01:00
Luis Soares
f448197d64 BUG 54161: automerged bzr bundle from bug report. 2010-06-02 13:13:30 +01:00
Vasil Dimov
4c1fe7ebf4 Fix the failing innodb.innodb test:
innodb.innodb                            [ fail ]
          Test ended at 2010-06-02 15:04:06
  
  CURRENT_TEST: innodb.innodb
  --- /usr/w/mysql-trunk-innodb/mysql-test/suite/innodb/r/innodb.result	2010-05-23 23:10:26.576407000 +0300
  +++ /usr/w/mysql-trunk-innodb/mysql-test/suite/innodb/r/innodb.reject	2010-06-02 15:04:05.000000000 +0300
  @@ -2648,7 +2648,7 @@
   create table t4 (s1 char(2) binary,primary key (s1)) engine=innodb;
   insert into t1 values (0x41),(0x4120),(0x4100);
   insert into t2 values (0x41),(0x4120),(0x4100);
  -ERROR 23000: Duplicate entry 'A\x00' for key 'PRIMARY'
  +ERROR 23000: Duplicate entry 'A' for key 'PRIMARY'
   insert into t2 values (0x41),(0x4120);

The change in the printout was introduced in:

  ------------------------------------------------------------
  revno: 3008.6.2
  revision-id: sergey.glukhov@sun.com-20100527160143-57nas8nplzpj26dz
  parent: sergey.glukhov@sun.com-20100527155443-24vqi9o8rpnkyci7
  committer: Sergey Glukhov <Sergey.Glukhov@sun.com>
  branch nick: mysql-trunk-bugfixing
  timestamp: Thu 2010-05-27 20:01:43 +0400
  message:
    Bug#52430 Incorrect key in the error message for duplicate key error involving BINARY type
    For BINARY(N) strip trailing zeroes to make the error message nice-looking
  
   @ mysql-test/r/errors.result
      test case
  
   @ mysql-test/r/type_binary.result
      result fix
  
   @ mysql-test/t/errors.test
      test case
  
   @ sql/key.cc
      For BINARY(N) strip trailing zeroes to make the error message nice-looking

and its author (Sergey) did not notice the test failure because that test
has been disabled in his tree.
2010-06-02 15:09:18 +03:00
Luis Soares
9f4859e78b WL#5408: Reduce Pushbuild2 turnaround times for rpl suite.
This patch aims at moving some rpl tests to be run on a daily
basis instead of running on a per push basis. To accomplish such
goal the following modifications are proposed:

- MTR: added --skip-test-list cli parameter

  This option allows the user to specify more than one
  disabled.def file, for example:

  perl mtr --skip-test-list=list1.list --skip-test-list=list2.list

- Added collections/disabled-per-push.list

  This file lists the test cases that should be disabled per
  push.

- Changed mysql-test/collections/default.push

  Added --skip-test-list=collections/disabled-per-push.list
  to rpl_binlog_row, ps_row and n_mix runs.

- Changed mysql-test/collections/default.daily

  Added rpl_binlog_row run (since it is partially run per push we
  should run it fully on a daily basis).
2010-06-02 13:01:42 +01:00
Marko Mäkelä
eaf7013d6b ut_strerr(): Handle DB_SUCCESS_LOCKED_REC. 2010-06-02 14:52:11 +03:00
Marko Mäkelä
a2b9532188 Merge from mysql-5.1-innodb:
------------------------------------------------------------
revno: 3495
committer: Marko Mäkelä <marko.makela@oracle.com>
branch nick: 5.1-innodb
timestamp: Wed 2010-06-02 13:37:14 +0300
message:
  Bug#53674: InnoDB: Error: unlock row could not find a 4 mode lock on the record

  In semi-consistent read, only unlock freshly locked non-matching records.

  lock_rec_lock_fast(): Return LOCK_REC_SUCCESS,
  LOCK_REC_SUCCESS_CREATED, or LOCK_REC_FAIL instead of TRUE/FALSE.

  enum db_err: Add DB_SUCCESS_LOCKED_REC for indicating a successful
  operation where a record lock was created.

  lock_sec_rec_read_check_and_lock(),
  lock_clust_rec_read_check_and_lock(), lock_rec_enqueue_waiting(),
  lock_rec_lock_slow(), lock_rec_lock(), row_ins_set_shared_rec_lock(),
  row_ins_set_exclusive_rec_lock(), sel_set_rec_lock(),
  row_sel_get_clust_rec_for_mysql(): Return DB_SUCCESS_LOCKED_REC if a
  new record lock was created. Adjust callers.

  row_unlock_for_mysql(): Correct the function documentation.

  row_prebuilt_t::new_rec_locks: Correct the documentation.
2010-06-02 14:37:33 +03:00
Marko Mäkelä
8f5d78c28b Merge from mysql-5.1-innodb:
------------------------------------------------------------
revno: 3493
revision-id: marko.makela@oracle.com-20100602101940-60x32xiivtqj9va1
parent: marko.makela@oracle.com-20100601135802-hgplcpr8089ura8g
committer: Marko Mäkelä <marko.makela@oracle.com>
branch nick: 5.1-innodb
timestamp: Wed 2010-06-02 13:19:40 +0300
message:
  fil_print_orphaned_tablespaces(): Unused function, remove.
2010-06-02 14:34:41 +03:00
Luis Soares
1d9ab18a1a BUG#54161: MTR: disabled.def lists don't work with FQ test names
MTR will ignore fully qualified test name entries in disabled.def 
lists. Therefore, it would still run the test case, even if it is
listed.

This patch fix this by extending the check when marking the test
case as disabled to take into consideration not only the cases that
contain the simple test name but also those that contain fully 
qualified test names.
2010-06-02 12:20:43 +01:00
Jimmy Yang
0f3b6ab18b Port bug fix #53592 from mysql-5.1-innodb to mysql-trunk-innodb. 2010-06-02 04:04:00 -07:00
He Zhenxing
e0042460e7 Post fix for bug#52748 2010-06-02 18:57:52 +08:00
Jonathan Perkin
e01117534c Revert Oracle Enterprise Linux changes. 2010-06-02 11:38:13 +01:00
Alexey Kopytov
e90af219d2 Manual merge from mysql-5.1-bugteam to mysql-trunk-merge.
conflicts:
   conflict      configure.in
2010-06-02 14:01:26 +04:00
Alexey Kopytov
40d4c07cd0 Automerge. 2010-06-02 13:54:40 +04:00
Magnus Blåudd
1d451c9fda Merge trunk-bug53983 -> trunk-bugfixing 2010-06-02 11:03:26 +02:00
Magnus Blåudd
36f4d92c91 Bug#53983 Placeholder for MASTER_BIND in master.info
- Reserve line 17 in master.info for master_bind which has been
   added in MySQL Cluster 6.3
 - move the line for "list of server id for ignorable servers" to line 18
2010-06-02 10:11:49 +02:00
Konstantin Osipov
8867c0a52c Add comments to a few MDL deadlock-search related variables
and methods.

sql/mdl.cc:
  Add comments.
sql/mdl.h:
  Add a comment.
2010-06-02 12:06:07 +04:00
Jimmy Yang
ee9ce546b9 Fix bug #54159 InnoDB: New warnings on Windows. Provide "signed/unsigned"
parameter to virtual function store() for longlong data type.

rb://371 approved by Sunny.
2010-06-01 22:26:31 -07:00
Alfranio Correia
2fb387b084 BUG#50479 DDL stmt on row-only/stmt-only tables generate spurious binlog_format
errors
            
In the fix of BUG#39934 in 5.1-rep+3, errors are generated when
binlog_format=row and a statement modifies a table restricted to
statement-logging (ER_BINLOG_ROW_MODE_AND_STMT_ENGINE); or if
binlog_format=statement and a statement modifies a table restricted to
row-logging (ER_BINLOG_STMT_MODE_AND_ROW_ENGINE).
            
However, some DDL statements that lock tables (e.g. ALTER TABLE,
CREATE INDEX and CREATE TRIGGER) were causing spurious errors,
although no row might be inserted into the binary log.
            
To fix the problem, we tagged statements that may generate
rows into the binary log and thence the warning messages are
only printed out when the appropriate conditions hold and rows
might be changed.

sql/log_event.cc:
  Reorganized the Query_log_event's constructor based on the
  CF_CAN_GENERATE_ROW_EVENTS flag and as such any statement
  that has the associated flag should go through a cache
  before being written to the binary log.
sql/share/errmsg-utf8.txt:
  Improved the error message ER_BINLOG_UNSAFE_MIXED_STATEMENT according to Paul's
  suggestion.
sql/sql_class.cc:
  Created a hook to be used by innodb that checks if a statement
  may write rows to the binary log. In other words, if it has
  the CF_CAN_GENERATE_ROW_EVENTS flag associated.
sql/sql_class.h:
  Defined the CF_CAN_GENERATE_ROW_EVENTS flag.
sql/sql_parse.cc:
  Updated the sql_command_flags and added a function to check the 
  CF_CAN_GENERATE_ROW_EVENTS.
sql/sql_parse.h:
  Added a function to check the CF_CAN_GENERATE_ROW_EVENTS.
storage/innobase/handler/ha_innodb.cc:
  Added a call to the hook thd_generates_rows().
storage/innobase/handler/ha_innodb.h:
  Defined an external reference to the hook thd_generates_rows().
2010-06-02 00:25:08 +01:00
Alfranio Correia
f11b030e17 auto-merge mysql-trunk-bugfixing (local) --> mysql-trunk-bugfixing 2010-06-01 20:49:58 +01:00
Alfranio Correia
29c7acd6d4 Post-merge fix for BUG#53421. 2010-06-01 20:34:40 +01:00
Alfranio Correia
126b583825 auto-merge mysql-trunk-bugfixing (local) --> mysql-trunk-bugfixing.merge 2010-06-01 15:40:54 +01:00
Alfranio Correia
ebde6f6de0 BUG#53421 Part of transaction not written in binlog after deadlock, replication
breaks
      
When a "CREATE TEMPORARY TABLE SELECT * FROM" was executed the OPTION_KEEP_LOG was
not set into the thd->variables.option_bits. For that reason, if the transaction
had updated only transactional engines and was rolled back at the end (.e.g due to
a deadlock) the changes were not written to the binary log, including the creation
of the temporary table.
      
To fix the problem, we have set the OPTION_KEEP_LOG into the
thd->variables.option_bits when a "CREATE TEMPORARY TABLE
SELECT * FROM" is executed.
2010-06-01 15:39:07 +01:00
Marko Mäkelä
7d5e44460c Merge a change from mysql-5.1-innodb:
------------------------------------------------------------
  revno: 3491
  revision-id: marko.makela@oracle.com-20100601134335-ccthwwru23kn09qw
  parent: marko.makela@oracle.com-20100601120751-1uq7bbta5n7ts0qr
  committer: Marko Mäkelä <marko.makela@oracle.com>
  branch nick: 5.1-innodb
  timestamp: Tue 2010-06-01 16:43:35 +0300
  message:
    Bug#48197: Concurrent rw_lock_free may cause assertion failure

    rw_lock_t: Remove magic_n unless UNIV_DEBUG is defined.
    rw_lock_free(): Invalidate magic_n only after removing from rw_lock_list.
2010-06-01 17:03:55 +03:00
Alfranio Correia
c54aabc93b auto-merge mysql-trunk-bugfixing (local) --> mysql-trunk-bugfixing.merge 2010-06-01 14:49:31 +01:00
Alexander Nozdrin
ff6cf4bb46 Auto-merge from mysql-trunk-innodb. 2010-06-01 16:40:34 +04:00
Alexander Nozdrin
bf158eed83 Auto-merge from mysql-trunk-bugfixing.
Due to a BZR bug, that merge was done by the following command:
bzr merge -r 'revid:tor.didriksen@sun.com-20100527074248-6qtv0p1ugy6o1hjo..' <mysql-trunk-bugfixing path>
2010-06-01 16:38:01 +04:00