1. 05 Jul, 2010 1 commit
    • Jon Olav Hauglid's avatar
      Bug #54401 assert in Diagnostics_area::set_eof_status , HANDLER · ecfd9958
      Jon Olav Hauglid authored
      This assert checks that the server does not try to send EOF to the
      client if there has been some error during processing. This to make
      sure that the error is in fact sent to the client.
      
      The problem was that any errors during processing of WHERE conditions
      in HANDLER ... READ statements where not detected by the handler code.
      The handler code therefore still tried to send EOF to the client,
      triggering the assert. The bug was only noticeable in debug builds.
      
      This patch fixes the problem by making sure that the handler code
      checks for errors during condition processing and acts accordingly.
      ecfd9958
  2. 02 Jul, 2010 4 commits
    • Konstantin Osipov's avatar
      A fix and a test case for Bug#36171 "CREATE TEMPORARY TABLE and · 635ccedb
      Konstantin Osipov authored
      MERGE engine".
      Backport the patch from 6.0 by Ingo Struewing:
      revid:ingo.struewing@sun.com-20091028183659-6kmv1k3gdq6cpg4d
      Bug#36171 - CREATE TEMPORARY TABLE and MERGE engine
      
      In former MySQL versions, up to 5.1.23/6.0.4 it was possible to create
      temporary MERGE tables with non-temporary MyISAM tables.
              
      This has been changed in the mentioned version due to Bug 19627
      (temporary merge table locking). MERGE children were locked through
      the parent table. If the parent was temporary, it was not locked and
      so the children were not locked either. Parallel use of the MyISAM
      tables corrupted them.
             
      Since 6.0.6 (WL 4144 - Lock MERGE engine children), the children are
      locked independently from the parent. Now it is possible to allow
      non-temporary children with a temporary parent. Even though the
      temporary MERGE table itself is not locked, each non-temporary
      MyISAM table is locked anyway.
              
      NOTE: Behavior change: In 5.1.23/6.0.4 we prohibited non-temporary
      children with a temporary MERGE table. Now we re-allow it.
      An important side-effect is that temporary tables, which overlay
      non-temporary MERGE children, overlay the children in the MERGE table.
      635ccedb
    • Konstantin Osipov's avatar
      A test case for Bug#50788 "main.merge fails on HPUX", · 0e9b910d
      Konstantin Osipov authored
      and a backport of relevant changes from the 6.0
      version of the fix done by Ingo Struewing.
      The bug itself was fixed by the patch for Bug#54811.
      
      
      MyISAMMRG engine would try to use MMAP on its children
      even on platforms that don't support it and even if
      myisam_use_mmap option was off.
      This lead to an infinite hang in INSERT ... SELECT into 
      a MyISAMMRG table when the destination MyISAM table
      was also selected from.
      
      A bug in duplicate detection fixed by 54811 was essential to 
      the hang - when a duplicate is detected, the optimizer 
      disables the use of memory mapped files, and it wasn't the case.
      
      The patch below is also to not turn on MMAP on children tables
      if myisam_use_mmap is off.
      A test case is added to cover MyISAMMRG and myisam_use_mmap
      option.
      0e9b910d
    • Jon Olav Hauglid's avatar
      Followup for Bug #54360 Deadlock DROP/ALTER/CREATE DATABASE · 4e2a2bc9
      Jon Olav Hauglid authored
                              with open HANDLER
      
      Fixes a problem with schema.test visible using embedded server.
      The HANDLER was not closed which caused the test to hang.
      
      The problem was not visible if the test was run on a normal server
      as the the handler there was implicitly closed by DATABASE DDL
      statements doing Events::drop_schema_events().
      4e2a2bc9
    • Jon Olav Hauglid's avatar
      Followup to Bug #54360 Deadlock DROP/ALTER/CREATE DATABASE · d93301eb
      Jon Olav Hauglid authored
                             with open HANDLER
      
      Fixes problem which caused mdl_sync.test to fail on Solaris and
      Windows due to path name differences in error messages in the
      result file.
      d93301eb
  3. 01 Jul, 2010 3 commits
    • Dmitry Lenev's avatar
      Another follow-up for 5.5 version of fix for bug#54360 · f84ec55e
      Dmitry Lenev authored
      "Deadlock DROP/ALTER/CREATE DATABASE with open HANDLER".
      
      Fixes production build which was broken by the fix for
      bug#54360 due to missing instantiation of some Hash_set 
      template's methods.
      
      Circumvent requirement of explicit instantiation of 
      non-inline methods by making all Hash_set methods
      inline.
      f84ec55e
    • Dmitry Lenev's avatar
      A follow-up for 5.5 version of fix for bug#54360 "Deadlock · 8ad1aa56
      Dmitry Lenev authored
      DROP/ALTER/CREATE DATABASE with open HANDLER".
      
      Remove wait_for_condition() which became unused after 
      database locks were replaced with MDL scoped locks.
      If one needs functionality provided by this call one can 
      always use THD::enter_cond()/exit_cond() methods.
      
      Also removed an unused include from sql_db.cc and updated 
      comment describing one of used includes to reflect current
      situation.
      8ad1aa56
    • Jon Olav Hauglid's avatar
      A 5.5 version of the fix for Bug #54360 "Deadlock DROP/ALTER/CREATE · 41a3dfe4
      Jon Olav Hauglid authored
      DATABASE with open HANDLER"
      
      Remove LOCK_create_db, database name locks, and use metadata locks instead.
      This exposes CREATE/DROP/ALTER DATABASE statements to the graph-based
      deadlock detector in MDL, and paves the way for a safe, deadlock-free
      implementation of RENAME DATABASE.
      
      Database DDL statements will now take exclusive metadata locks on
      the database name, while table/view/routine DDL statements take
      intention exclusive locks on the database name. This prevents race
      conditions between database DDL and table/view/routine DDL.
      (e.g. DROP DATABASE with concurrent CREATE/ALTER/DROP TABLE)
      
      By adding database name locks, this patch implements
      WL#4450 "DDL locking: CREATE/DROP DATABASE must use database locks" and
      WL#4985 "DDL locking: namespace/hierarchical locks".
      
      The patch also changes code to use init_one_table() where appropriate.
      The new lock_table_names() function requires TABLE_LIST::db_length to
      be set correctly, and this is taken care of by init_one_table().
      
      This patch also adds a simple template to help work with 
      the mysys HASH data structure.
      
      Most of the patch was written by Konstantin Osipov.
      41a3dfe4
  4. 30 Jun, 2010 2 commits
  5. 29 Jun, 2010 2 commits
  6. 28 Jun, 2010 2 commits
  7. 26 Jun, 2010 3 commits
    • Jon Olav Hauglid's avatar
      Bug #49891 View DDL breaks REPEATABLE READ · e79d4189
      Jon Olav Hauglid authored
      The problem was that if a query accessing a view was blocked due to
      conflicting locks on tables in the view definition, it would be possible
      for a different connection to alter the view definition before the view
      query completed. When the view query later resumed, it used the old view
      definition. This meant that if the view query was later repeated inside
      the same transaction, the two executions of the query would give different
      results, thus breaking repeatable read. (The first query used the old
      view definition, the second used the new view definition).
      
      This bug is no longer repeatable with the recent changes to the metadata
      locking subsystem (revno: 3040). The view query will no longer back-off
      and release the lock on the view definiton. Instead it will wait for
      the conflicting lock(s) to go away while keeping the view definition lock.
      This means that it is no longer possible for a concurrent connection to
      alter the view definition. Instead, any such attempt will be blocked.
      
      In the case from the bug report where the same view query was executed
      twice inside the same transaction, any ALTER VIEW from other connections
      will now be blocked until the transaction has completed (or aborted).
      The view queries will therefore use the same view definition and we will
      have repeatable read.
      
      Test case added to innodb_mysql_lock.test.
      This patch contains no code changes.
      e79d4189
    • Alexander Nozdrin's avatar
      Make few tests experimental. · 759aabe3
      Alexander Nozdrin authored
      759aabe3
    • Alexander Nozdrin's avatar
      Auto-merge from mysql-trunk. · 59ef962b
      Alexander Nozdrin authored
      59ef962b
  8. 25 Jun, 2010 5 commits
    • Gleb Shchepa's avatar
      6941da51
    • Alexander Nozdrin's avatar
      Backport of revid:ingo.struewing@sun.com-20091223200354-r2uzbdkj2v6yv111 · 514b9b25
      Alexander Nozdrin authored
         Bug#47633 - assert in ha_myisammrg::info during OPTIMIZE
       
         The server crashed on an attempt to optimize a MERGE table with
         non-existent child table.
       
         mysql_admin_table() relied on the table to be successfully open
         if a table object had been allocated.
       
         Changed code to check return value of the open function before
         calling a handler:: function on it.
      514b9b25
    • Konstantin Osipov's avatar
      Merge trunk -> trunk-runtime · e4557d6d
      Konstantin Osipov authored
      e4557d6d
    • Jon Olav Hauglid's avatar
      Bug #50124 Rpl failure on DROP table with concurrent txn/non-txn · 80af1318
      Jon Olav Hauglid authored
                 DML flow and SAVEPOINT
      
      The problem was that replication could break if a transaction involving
      both transactional and non-transactional tables was rolled back to a
      savepoint. It broke if a concurrent connection tried to drop a
      transactional table which was locked after the savepoint was set.
      This DROP TABLE completed when ROLLBACK TO SAVEPOINT was executed as the
      lock on the table was dropped by the transaction. When the slave later
      tried to apply the binlog, it would fail as the table would already
      have been dropped.
      
      The reason for the problem is that transactions involving both
      transactional and non-transactional tables are written fully to the
      binlog during ROLLBACK TO SAVEPOINT. At the same time, metadata locks
      acquired after a savepoint, were released during ROLLBACK TO SAVEPOINT.
      This allowed a second connection to drop a table only used between
      SAVEPOINT and ROLLBACK TO SAVEPOINT. Which caused the transaction binlog
      to refer to a non-existing table when it was written during ROLLBACK
      TO SAVEPOINT.
      
      This patch fixes the problem by not releasing metadata locks when
      ROLLBACK TO SAVEPOINT is executed if binlogging is enabled.
      80af1318
    • Jon Olav Hauglid's avatar
      Bug #53757 assert in mysql_truncate_by_delete · 9702d53f
      Jon Olav Hauglid authored
      The assert was triggered if a connection executing TRUNCATE
      on a InnoDB table was killed during open_tables.
      
      This bug was fixed in the scope of Bug #45643
      "InnoDB does not support replication of TRUNCATE TABLE".
      
      This patch adds test coverage to innodb_mysql_sync.test.
      9702d53f
  9. 23 Jun, 2010 10 commits
  10. 22 Jun, 2010 6 commits
    • Gleb Shchepa's avatar
      Bug #30584: delete with order by and limit clauses does not · da4d2327
      Gleb Shchepa authored
                  use limit efficiently
      Bug #36569: UPDATE ... WHERE ... ORDER BY... always does a
                  filesort even if not required
      
      Also two bugs reported after QA review (before the commit
      of bugs above to public trees, no documentation needed):
      
      Bug #53737: Performance regressions after applying patch
                  for bug 36569
      Bug #53742: UPDATEs have no effect after applying patch
                  for bug 36569
      
      
      Execution of single-table UPDATE and DELETE statements did not use the 
      same optimizer as was used in the compilation of SELECT statements. 
      Instead, it had an optimizer of its own that did not take into account 
      that you can omit sorting by retrieving rows using an index.
      
      Extra optimization has been added: when applicable, single-table 
      UPDATE/DELETE statements use an existing index instead of filesort. A 
      corresponding SELECT query would do the former.
      
      Also handling of the DESC ordering expression has been added when
      reverse index scan is applicable.
      
      From now on most single table UPDATE and DELETE statements show the 
      same disk access patterns as the corresponding SELECT query. We verify 
      this by comparing the result of SHOW STATUS LIKE 'Sort%
      
      Currently the get_index_for_order function 
      a) checks quick select index (if any) for compatibility with the
         ORDER expression list or
      b) chooses the cheapest available compatible index, but only if 
         the index scan is cheaper than filesort.
      Second way is implemented by the new test_if_cheaper_ordering
      function (extracted part the test_if_skip_sort_order()).
      da4d2327
    • Vladislav Vaintroub's avatar
      Fix syntax error (missing space in SET command), that effectively prevents... · a4baec5c
      Vladislav Vaintroub authored
      Fix syntax error (missing space in SET command),  that effectively prevents mysqld from being build with SSL.
      a4baec5c
    • Vladislav Vaintroub's avatar
      Fix ~1000 warnings class/struct mismatch. · 1ef39ee2
      Vladislav Vaintroub authored
      Handle this warning in the future as error, this will prevent pushing to main trees.
      1ef39ee2
    • Alexander Nozdrin's avatar
      Auto-merge (empty) from mysql-trunk. · 04f9d612
      Alexander Nozdrin authored
      04f9d612
    • Alexander Nozdrin's avatar
      Auto-merge from mysql-trunk-bugfixing. · 13495fae
      Alexander Nozdrin authored
      13495fae
    • Magne Mahre's avatar
      Post-push fixups for WL#5349 · b4f77c40
      Magne Mahre authored
      b4f77c40
  11. 21 Jun, 2010 2 commits