1. 15 Apr, 2010 2 commits
    • Jon Olav Hauglid's avatar
      Bug #51391 Deadlock involving events during rqg_info_schema test · b6f0c3a1
      Jon Olav Hauglid authored
      This was a deadlock between CREATE/ALTER/DROP EVENT and a query
      accessing both the mysql.event table and I_S.GLOBAL_VARIABLES.
      
      The root of the problem was that the LOCK_event_metadata mutex was
      used to both protect the "event_scheduler" global system variable
      and the internal event data structures used by CREATE/ALTER/DROP EVENT.
      
      The deadlock would occur if CREATE/ALTER/DROP EVENT held
      LOCK_event_metadata while trying to open the mysql.event table,
      at the same time as the query had mysql.event open, trying to
      lock LOCK_event_metadata to access "event_scheduler".
      
      This bug was fixed in the scope of Bug#51160 by using only
      LOCK_global_system_variables to protect "event_scheduler".
      This makes it so that the query above won't lock LOCK_event_metadata,
      thereby preventing this deadlock from occuring.
      
      This patch contains no code changes.
      Test case added to lock_sync.test.
      b6f0c3a1
    • Jon Olav Hauglid's avatar
      Bug #51327 MyISAM table is automatically repaired on ALTER · e232fbe0
      Jon Olav Hauglid authored
                 even if myisam-recover is OFF
      
      The problem was that a corrupted MyISAM table was auto repaired
      even if the myisam_recover_options server variable (or the 
      myisam_recover option) was set to OFF.
      
      The reason was that the auto_repair() function, which is supposed
      to say if auto repair is to be used, did not use the server variable
      setting correctly. This bug was a regression introduced by WL#4738.
      
      This patch fixes the problem by making sure auto_repair() returns
      FALSE if myisam_recover_options is set to OFF.
      
      Test case added to myisam.test.
      e232fbe0
  2. 14 Apr, 2010 2 commits
    • Jon Olav Hauglid's avatar
      Bug #52593 SHOW CREATE TABLE is blocked if table is locked · d18275c2
      Jon Olav Hauglid authored
                 for write by another connection
      
      The problem was that if a table was locked in one connection by
      LOCK TABLES ... WRITE, REPAIR TABLE or OPTIMIZE TABLE, SHOW CREATE
      TABLE from another connection would be blocked. As SHOW CREATE TABLE
      only reads metadata about the table, such blocking is not needed.
      
      The problem was that when SHOW CREATE TABLE tried to get a metadata
      lock on the table in order to open it, it used the wrong type of
      metadata lock request. It used MDL_SHARED_READ which is used when
      the intent is to read both table metadata and table data. Instead
      it should have used MDL_SHARED_HIGH_PRIO which signifies an intent
      to only read metadata.
      
      This patch fixes the problem by making sure SHOW CREATE TABLE uses
      the MDL_SHARED_HIGH_PRIO metadata lock request type when trying to
      open the table. The patch also fixes a similar problem with the
      mysql_list_fields API call.
      
      Test case added to show_check.test.
      d18275c2
    • Jon Olav Hauglid's avatar
      Bug #52367 Deadlock involving SET GLOBAL EVENT_SCHEDULER = OFF · 7e6eddd3
      Jon Olav Hauglid authored
                 during rqg_mdl_deadlock test
      
      The problem was that if two connection threads simultaneously tries
      to execute "SET GLOBAL EVENT_SCHEDULER = OFF", one of them could
      hang waiting for the scheduler to stop.
      
      The first connection thread would kill the event scheduler thread
      and then start waiting for it to exit. The second connection thread
      would then find the event scheduler thread in the process of exiting
      and also wait for it to exit. However, since the event scheduler 
      thread used signal to wake only one waiting thread, the other connection
      thread would be left waiting.
      
      This bug was a regression introduced by the fix for Bug#51160.
      Before #51160 it was not possible for two connection threads to 
      try to stop the event scheduler thread simultaneously.
      
      This patch fixes the problem my making sure the event scheduler
      thread uses broadcast to notify all waiters that it is exiting.
      
      No test case added as this would require adding debug sync points
      to parts of the code where sync points are currently not used.
      The patch has been tested with the non-deterministic test case
      from the bug description as well as using the RQG.
      7e6eddd3
  3. 17 Mar, 2010 2 commits
  4. 16 Mar, 2010 1 commit
  5. 15 Mar, 2010 11 commits
    • Mats Kindahl's avatar
      Merging with mysql-trunk-bugfixing · a9d145ac
      Mats Kindahl authored
      a9d145ac
    • Mats Kindahl's avatar
      Merging with mysql-trunk-bugfixing · dc35b61f
      Mats Kindahl authored
      dc35b61f
    • Konstantin Osipov's avatar
      A post-review fix for type-aware metadata locks. · a9520bcf
      Konstantin Osipov authored
      DDL no longer aborts mysql_lock_tables(), and hence
      we no longer need to support need_reopen flag of this
      call. 
      Remove the flag, and all the code in the server
      that was responsible for handling the case when
      it was set. This allowed to simplify: 
      open_and_lock_tables_derived(), the delayed thread,
      multi-update.
      
      Rename MYSQL_LOCK_IGNORE_FLUSH to MYSQL_OPEN_IGNORE_FLUSH,
      since we now only support this flag in open_table().
      
      Rename MYSQL_LOCK_PERF_SCHEMA to MYSQL_LOCK_LOG_TABLE,
      to avoid confusion.
      
      Move the wait for the global read lock for cases
      when we do updates in SELECT f1() or DO (UPDATE) to 
      open_table() from mysql_lock_tables(). When waiting
      for the read lock, we could raise need_reopen flag,
      which is no longer present in mysql_lock_tables().
      Since the block responsible for waiting for GRL
      was moved, MYSQL_LOCK_IGNORE_GLOBAL_READ_LOCK
      was renamed to MYSQL_OPEN_IGNORE_GLOBAL_READ_LOCK.
      a9520bcf
    • Vladislav Vaintroub's avatar
      merge · 74211ed9
      Vladislav Vaintroub authored
      74211ed9
    • Alexander Nozdrin's avatar
      Auto-merge from mysql-trunk. · 9cc2d776
      Alexander Nozdrin authored
      9cc2d776
    • Alexander Nozdrin's avatar
      A patch for Bug#52071 (rpl_ndb.rpl_ndb_ctype_ucs2_def fails). · fa2d2c18
      Alexander Nozdrin authored
      Use new command line options instead of deprecated and removed ones.
      fa2d2c18
    • Alexander Nozdrin's avatar
      d9a074e1
    • Magnus Blåudd's avatar
      Merge · a9541803
      Magnus Blåudd authored
      a9541803
    • Magnus Blåudd's avatar
      Merge in fix for bug#42589 · fda5004d
      Magnus Blåudd authored
      fda5004d
    • Jon Olav Hauglid's avatar
      Bug #51160 Deadlock around SET GLOBAL EVENT_SCHEDULER = ON|OFF · dd69b281
      Jon Olav Hauglid authored
      This deadlock could occour betweeen one connection executing
      SET GLOBAL EVENT_SCHEDULER= ON and another executing SET GLOBAL
      EVENT_SCHEDULER= OFF. The bug was introduced by WL#4738.
      
      The first connection would hold LOCK_event_metadata (protecting
      the global variable) while trying to lock LOCK_global_system_variables
      starting the event scheduler thread (in THD:init()).
      
      The second connection would hold LOCK_global_system_variables
      while trying to get LOCK_event_scheduler after stopping the event
      scheduler inside event_scheduler_update().
      
      This patch fixes the problem by not using LOCK_event_metadata to
      protect the event_scheduler variable. It is still protected using
      LOCK_global_system_variables. This fixes the deadlock as it removes 
      one of the two mutexes used to produce it.
      
      However, this patch opens up the possibility that the event_scheduler
      variable and the real event_scheduler state can become out of sync
      (e.g. variable = OFF, but scheduler running). But this can only
      happen under very unlikely conditions - two concurrent SET GLOBAL
      statments, with one thread interrupted at the exact wrong moment.
      This is preferable to having the possibility of a deadlock.
      
      This patch also fixes a bug where it was possible to exit create_event()
      without releasing LOCK_event_metadata if running out of memory during
      its exection.
      
      No test case added since a repeatable test case would have required
      excessive use of new sync points. Instead we rely on the fact that
      this bug was easily reproduceable using RGQ tests.
      dd69b281
    • Alexander Nozdrin's avatar
      Auto-merge from mysql-trunk. · 27bb4377
      Alexander Nozdrin authored
      27bb4377
  6. 14 Mar, 2010 1 commit
    • Mats Kindahl's avatar
      Bug #51938 plugin_dir gets bad default value · d21fa142
      Mats Kindahl authored
      When building the script directory using a CMake-based build, both the
      variables in config.h.cmake (including PLUGINDIR) and the variables in
      CMakeList.txt (which includes pkgplugindir).
      
      However, for autotools-based builds, only pkgplugindir is substituted,
      which means that the plugin-path is not substituted.
      
      This patch solves the problem by using pkgplugindir, which works on both
      CMake-based and autotools-based builds, instead of PLUGINDIR.
      d21fa142
  7. 13 Mar, 2010 1 commit
  8. 12 Mar, 2010 8 commits
  9. 11 Mar, 2010 8 commits
  10. 10 Mar, 2010 4 commits
    • Luis Soares's avatar
      Fix for BUG#51716 and BUG#51787: test case improvements. · 9b5a6748
      Luis Soares authored
      Split rpl_row_charset into:
      
        - rpl_row_utf16.
        - rpl_row_utf32.
      
      This way these tests can run independently if server supports
      either one of the charsets but not both.
      
      Cleaned up rpl_row_utf32 which had a spurious instruction:
      -- let $reset_slave_type_conversions= 0
      9b5a6748
    • Davi Arnaut's avatar
      Automatic merge. · 09f90142
      Davi Arnaut authored
      09f90142
    • Luis Soares's avatar
      Fix for BUG#51716 and BUG#51787. · 2c368f05
      Luis Soares authored
      In BUG#51787 we were using the wrong charset to print out the
      data. We were using the field charset for the string that would
      hold the information. This caused the assertion, because the
      string length was not aligned with UTF32 bytes requirements for
      storage.
      
      We fix this by using &my_charset_latin1 in the string object
      instead of the field->charset(). As a side-effect, we needed to
      extend the show_sql_type interface so that it took the field
      charset is now passed as a parameter, so that one is able to
      calculate the correct field size.
      
      In BUG#51716 we had issues with Field_string::pack and
      Field_string::unpack. When packing, the length was incorrectly
      calculated. When unpacking, the padding the string would be
      padded with the wrong bytes (a few bytes less than it should).
      
      We fix this by resorting to charset abstractions (functions) that
      calculate the correct length when packing and pad correctly the
      string when unpacking.
      2c368f05
    • Joerg Bruehe's avatar
      Automerge into next-mr-bugfixing. · b016f1b2
      Joerg Bruehe authored
      b016f1b2