Commit graph

65886 commits

Author SHA1 Message Date
Georgi Kodinov
3617e5a159 merge 2010-06-07 13:01:54 +03:00
Georgi Kodinov
80acd9573f Addendum to the fix for bug #52315: need to set a proper shutdown type
when an out-of-supported-range date is detected.
2010-06-07 12:49:52 +03:00
Alexander Nozdrin
8a247e963d Manual merge from mysql-trunk-bugfixing.
Conflicts:
  - BUILD/SETUP.sh
  - mysql-test/mysql-test-run.pl
  - mysql-test/r/partition_error.result
  - mysql-test/t/disabled.def
  - mysql-test/t/partition_error.test
  - sql/share/errmsg-utf8.txt
2010-06-07 12:47:04 +04:00
Dmitry Lenev
571acc878b Patch that changes approach to how we acquire metadata
locks for DML statements and changes the way MDL locks
are acquired/granted in contended case.

Instead of backing-off when a lock conflict is encountered
and waiting for it to go away before restarting open_tables()
process we now wait for lock to be released without releasing
any previously acquired locks. If conflicting lock goes away
we resume opening tables. If waiting leads to a deadlock we
try to resolve it by backing-off and restarting open_tables()
immediately.

As result both waiting for possibility to acquire and
acquiring of a metadata lock now always happen within the
same MDL API call. This has allowed to make release of a lock
and granting it to the most appropriate pending request an
atomic operation.
Thanks to this it became possible to wake up during release
of lock only those waiters which requests can be satisfied
at the moment as well as wake up only one waiter in case
when granting its request would prevent all other requests
from being satisfied. This solves thundering herd problem
which occured in cases when we were releasing some lock and
woke up many waiters for SNRW or X locks (this was the issue
in bug#52289 "performance regression for MyISAM in sysbench
OLTP_RW test".
This also allowed to implement more fair (FIFO) scheduling
among waiters with the same priority.
It also opens the door for introducing new types of requests
for metadata locks such as low-prio SNRW lock which is
necessary in order to support LOCK TABLES LOW_PRIORITY WRITE.

Notice that after this sometimes can report ER_LOCK_DEADLOCK
error in cases in which it has not happened before.
Particularly we will always report this error if waiting for
conflicting lock has happened in the middle of transaction
and resulted in a deadlock. Before this patch the error was
not reported if deadlock could have been resolved by backing
off all metadata locks acquired by the current statement.
2010-06-07 11:06:55 +04:00
Jon Olav Hauglid
1af11051bf manual merge from mysql-trunk-bugfixing
Conflicts:
Text conflict in mysql-test/r/archive.result
Contents conflict in mysql-test/r/innodb_bug38231.result
Text conflict in mysql-test/r/mdl_sync.result
Text conflict in mysql-test/suite/binlog/t/disabled.def
Text conflict in mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result
Text conflict in mysql-test/t/archive.test
Contents conflict in mysql-test/t/innodb_bug38231.test
Text conflict in mysql-test/t/mdl_sync.test
Text conflict in sql/sp_head.cc
Text conflict in sql/sql_show.cc
Text conflict in sql/table.cc
Text conflict in sql/table.h
2010-06-06 13:19:29 +02:00
Davi Arnaut
75dce25ca8 Post-merge fix: header is used by the client API. Obvious in retrospect.
Also, update a few cases missed by the initial patch.
2010-06-05 16:39:03 -03:00
Ramil Kalimullin
e4ab997642 Automerge. 2010-06-04 22:09:10 +04:00
Ramil Kalimullin
78a9c728fe Automerge. 2010-06-04 22:01:27 +04:00
Ramil Kalimullin
752db5b2e8 Fix for bug #53912: Fails to build from source
NET::skip_big_packet isn't defined for the embedded server,
hide it in such a case.
2010-06-04 21:58:41 +04:00
Vasil Dimov
30dfa67e73 Merge mysql-trunk-bugfixing -> mysql-trunk-innodb 2010-06-04 19:22:53 +03:00
Georgi Kodinov
085c4928c9 merge 2010-06-04 19:09:50 +03:00
Georgi Kodinov
1a101920f3 merge 2010-06-04 17:10:22 +03:00
Georgi Kodinov
5321e49da6 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
dcd9abee2e 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
444568e48c 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
2786f54993 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
ee0738edfe 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
ec97ce952e 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.
2010-06-03 18:32:56 +04:00
Konstantin Osipov
f29298d91c 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.
2010-06-03 18:08:22 +04:00
Jimmy Yang
cf8de25318 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
373f2ed817 Don't enable safemalloc for valgrind builds, it's too slow. 2010-06-03 09:54:37 -03:00
Marko Mäkelä
9cd413929b 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
fc1928c8b4 Patch for bug#52913 including all review results and changes of date format. 2010-06-03 10:31:26 +02:00
Tor Didriksen
f72832953f Skip perfschema.misc if "var" is a symlink (due to Bug 51447). 2010-06-03 09:52:15 +02:00
Alexander Nozdrin
04ce78aad8 Disable binlog.binlog_spurious_ddl_errors due to Bug 54195. 2010-06-03 11:50:50 +04:00
Luis Soares
d91dde90d3 BUG 53893: automerged from mysql-5.1-bugteam into mysql-trunk-merge. 2010-06-03 00:08:35 +01:00
Luis Soares
0ade82fe03 BUG 53893: automerged bug branch into mysql-5.1-bugteam latest. 2010-06-03 00:04:27 +01:00
Luis Soares
8ce9f9b317 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
32aa144551 Auto merge 2010-06-02 21:24:53 +08:00
He Zhenxing
a06e034dd4 Auto merge from 5.1-rep-semisync 2010-06-02 20:57:39 +08:00
Vasil Dimov
e8e1ea917c Adjust .bzr-mysql/default.conf that was reverted by a recent bzr pull 2010-06-02 15:49:05 +03:00
Vasil Dimov
271dcd8e0c Merge mysql-trunk-bugfixing from bk-internal into my local tree 2010-06-02 15:43:14 +03:00
Vasil Dimov
1a5cf2618b Merge mysql-trunk-innodb -> mysql-trunk-bugfixing 2010-06-02 15:40:49 +03:00
Alexander Barkov
56c3b98065 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
5e24bb532e BUG 54161: automerged mysql-5.1-bugteam into mysql-trunk-merge. 2010-06-02 13:16:47 +01:00
Luis Soares
21634b92e5 BUG 54161: automerged bzr bundle from bug report. 2010-06-02 13:13:30 +01:00
Vasil Dimov
acf187a276 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
Marko Mäkelä
a887c0c28f ut_strerr(): Handle DB_SUCCESS_LOCKED_REC. 2010-06-02 14:52:11 +03:00
Marko Mäkelä
823439c402 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ä
765c195e85 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
2a8a739561 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
b59ef3c5ec Port bug fix #53592 from mysql-5.1-innodb to mysql-trunk-innodb. 2010-06-02 04:04:00 -07:00
He Zhenxing
f2a9896c47 Post fix for bug#52748 2010-06-02 18:57:52 +08:00
Jonathan Perkin
2400a20c9b Revert Oracle Enterprise Linux changes. 2010-06-02 11:38:13 +01:00
Alexey Kopytov
6633d23f02 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
36d2769928 Automerge. 2010-06-02 13:54:40 +04:00
Magnus Blåudd
f142f5bf53 Merge trunk-bug53983 -> trunk-bugfixing 2010-06-02 11:03:26 +02:00
Magnus Blåudd
3b1cc6e357 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
f3e12c7567 Add comments to a few MDL deadlock-search related variables
and methods.
2010-06-02 12:06:07 +04:00
Jimmy Yang
987a04b417 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