1. 25 Oct, 2010 1 commit
  2. 23 Oct, 2010 1 commit
    • unknown's avatar
      Bug#27606 GRANT statement should be replicated with DEFINER information · 650f0081
      unknown authored
      "Grantor" columns' data is lost when replicating mysql.tables_priv.
      Slave SQL thread used its default user ''@'' as the grantor of GRANT|REVOKE
      statements executing on it.
      
      In this patch, current user is put in query log event for all GRANT and REVOKE
      statement, SQL thread uses the user in query log event as grantor.
      
      
      mysql-test/suite/rpl/r/rpl_do_grant.result:
        Add test for this bug.
      mysql-test/suite/rpl/t/rpl_do_grant.test:
        Add test for this bug.
      sql/log_event.cc:
        Refactoring THD::current_user_used and related functions.
        current_user_used is used to judge if current user should be
        binlogged in query log event. So it is better to call it m_binlog_invoker.
        The related functions are renamed too.
      sql/sql_class.cc:
        Refactoring THD::current_user_used and related functions.
        current_user_used is used to judge if current user should be
        binlogged in query log event. So it is better to call it m_binlog_invoker.
        The related functions are renamed too.
      sql/sql_class.h:
        Refactoring THD::current_user_used and related functions.
        current_user_used is used to judge if current user should be
        binlogged in query log event. So it is better to call it m_binlog_invoker.
        The related functions are renamed too.
      sql/sql_parse.cc:
        Call binlog_invoker() for GRANT and REVOKE statements.
      650f0081
  3. 21 Oct, 2010 2 commits
    • Bjorn Munch's avatar
      Follow-up to Bug #55582 which allows checking strings in if · 09694be3
      Bjorn Munch authored
        Simplified cases where a select was used to compare variable against ''
      09694be3
    • unknown's avatar
      Bug#55478 Row events wrongly apply on the temporary table of the same name · ff9140b5
      unknown authored
      Rows events were applied wrongly on the temporary table with the same name.
      But rows events are generated only for base tables. As temporary
      table's data never be binlogged on row mode. Normally, base table of the
      same name cannot be updated if a temporary table has the same name.
      But there are two cases which can generate rows events on 
      the base table of same name.
            
      Case1: 'CREATE TABLE ... SELECT' statement.
      In mixed format, it will generate rows events if it is unsafe.
            
      Case2: Drop a transactional temporary table in a transaction
             (happens only on 5.5+).
      BEGIN;
      DROP TEMPORARY TABLE t1;       # t1 is a InnoDB table
      INSERT INTO t1 VALUES(rand()); # t1 is a MyISAM table
      COMMIT;
      'DROP TEMPORARY TABLE' will be put in the transaction cache and
      binlogged after the rows events generated by the 'INSERT' statement.
            
      After this patch, slave opens only base table when applying a rows event.
      ff9140b5
  4. 20 Oct, 2010 6 commits
  5. 19 Oct, 2010 11 commits
    • Davi Arnaut's avatar
      Bug#45288: pb2 returns a lot of compilation warnings · 267bd161
      Davi Arnaut authored
      Tag or remove unused arguments and variables.
      
      regex/main.c:
        Use the real prototype.
      sql/ha_ndbcluster.cc:
        Make conditions less ambiguous.
      267bd161
    • Davi Arnaut's avatar
      Bug#45288: pb2 returns a lot of compilation warnings · 378fd294
      Davi Arnaut authored
      Ensure that fdatasync is properly declared as on Mac OS X, the
      function is available but there is no prototype. Also, port a
      fix for a warning from the InnoDB plugin over to the builtin. 
      
      configure.in:
        Check that fdatasync is declared.
      mysys/my_sync.c:
        Use fdatasync only if it is declared.
      storage/innobase/include/ut0dbg.h:
        Port over from the plugin a fix for a warning.
      378fd294
    • Davi Arnaut's avatar
      Bug#45288: pb2 returns a lot of compilation warnings on linux · c64ef835
      Davi Arnaut authored
      Tag unused arguments.
            
      Approved by: Marko (via IRC)
      c64ef835
    • Davi Arnaut's avatar
      Bug#45288: pb2 returns a lot of compilation warnings on linux · 8464f12e
      Davi Arnaut authored
      Tag unused arguments.
      
      Approved by: Marko (via IRC)
      8464f12e
    • Davi Arnaut's avatar
      Bug#45288: pb2 returns a lot of compilation warnings on linux · 28f9f07e
      Davi Arnaut authored
      Fix assorted compiler warnings on Mac OS X.
      
      BUILD/SETUP.sh:
        Remove -Wctor-dtor-privacy flag to workaround a GCC bug that
        causes it to not properly detect that implicitly generated
        constructors are always public.
      cmd-line-utils/readline/terminal.c:
        tgetnum and tgetflag might not take a const string argument.
      mysys/my_gethostbyname.c:
        Tag unused arguments.
      mysys/my_sync.c:
        Tag unused arguments.
      28f9f07e
    • Bjorn Munch's avatar
      Bug #56654 pb2 log is very hard to read · 3398089e
      Bjorn Munch authored
      Added some more info in a number of fail cases
      (re-commit for administrative reasons)
      3398089e
    • Bjorn Munch's avatar
      Bug #52828 Tests that use perl fail when perl is not in path · cc983551
      Bjorn Munch authored
      main.mysqltest skipped on Windows because a perl intentionally does exit(1)
      Use exit(2), as exit(1) on Windows is indistinguishable from failing to
      execute perl.
      cc983551
    • Bjorn Munch's avatar
    • Magne Mahre's avatar
      Bug #46941 crash with lower_case_table_names=2 and foreign key · 1dd39c09
      Magne Mahre authored
                 data dictionary confusion
      
      On file systems with case insensitive file names, and
      lower_case_table_names set to '2', the server could crash
      due to a table definition cache inconsistency.  This is 
      the default setting on MacOSX, but may also be set and
      used on MS Windows.
      
      The bug is caused by using two different strategies for
      creating the hash key for the table definition cache, resulting
      in failure to look up an entry which is present in the cache,
      or failure to delete an existing entry.  One strategy was to
      use the real table name (with case preserved), and the other
      to use a normalized table name (i.e a lower case version).
      
      This is manifested in two cases.  One is  during 'DROP DATABASE', 
      where all known files are removed.  The removal from
      the table definition cache is done via a generated list of
      TABLE_LIST with keys (wrongly) created using the case preserved 
      name.  The other is during CREATE TABLE, where the cache lookup
      is also (wrongly) based on the case preserved name.
         
      The fix was to use only the normalized table name when
      creating hash keys.
      
      
      sql/sql_db.cc:
        Normalize table name (i.e lower case it)
      sql/sql_table.cc:
        table_name contains the normalized name
        alias contains the real table name
      1dd39c09
    • Jon Olav Hauglid's avatar
      Bug #57274 SET GLOBAL debug crashes on Solaris in embedded server mode · 487019ec
      Jon Olav Hauglid authored
                 (variables_debug fails)
      
      The problem was that "SET GLOBAL debug" could cause a crash on Solaris.
      The crash happened if the server failed to open the trace file given in 
      the "SET GLOBAL debug" statement. This caused an error message to be
      printed to stderr containing the process name. However, printing to
      stderr crashed the server since the pointer to the process name had
      not been initialized.
      
      This patch fixes the problem by initializing the process name 
      properly when doing "SET GLOBAL debug".
      
      No test case added as this bug was repeatable with existing test
      coverage in variables_debug.test.
      487019ec
    • Tor Didriksen's avatar
      74cc3528
  6. 18 Oct, 2010 3 commits
  7. 16 Oct, 2010 1 commit
    • unknown's avatar
      Bug#56118 STOP SLAVE does not wait till trx with CREATE TMP TABLE ends, · 64fe07cc
      unknown authored
                replication aborts
      
      When recieving a 'SLAVE STOP' command, slave SQL thread will roll back the
      transaction and stop immidiately if there is only transactional table updated,
      even through 'CREATE|DROP TEMPOARY TABLE' statement are in it. But These
      statements can never be rolled back. Because the temporary tables to the user
      session mapping remain until 'RESET SLAVE', Therefore it will abort SQL thread
      with an error that the table already exists or doesn't exist, when it restarts
      and executes the whole transaction again.
      
      After this patch, SQL thread always waits till the transaction ends and then stops,
      if 'CREATE|DROP TEMPOARY TABLE' statement are in it.
      
      mysql-test/extra/rpl_tests/rpl_stop_slave.test:
        Auxiliary file which is used to test this bug.
      mysql-test/suite/rpl/t/rpl_stop_slave.test:
        Test case for this bug.
      sql/slave.cc:
        Checking if OPTION_KEEP_LOG is set. If it is set, SQL thread should wait
        until the transaction ends.
      sql/sql_parse.cc:
        Add a debug point for testing this bug.
      64fe07cc
  8. 13 Oct, 2010 3 commits
  9. 11 Oct, 2010 1 commit
    • unknown's avatar
      Bug#56226 Table map set to 0 after altering MyISAM table · 7525e068
      unknown authored
      After ALTER TABLE which changed only table's metadata, row-based
      binlog sometimes got corrupted since the tablemap was unexpectedly
      set to 0 for subsequent updates to the same table.
      
      ALTER TABLE which changed only table's metadata always reset
      table_map_id for the table share to 0. Despite the fact that
      0 is a valid value for table_map_id, this step caused problems
      as it could have created situation in which we had more than
      one table share with table_map_id equal 0. If more than one
      table with table_map_id are 0 were updated in the same statement,
      updates to these different tables were written into the same
      rows event. This caused slave server to crash.
      
      This bug happens only on 5.1. It doesn't affect 5.5+.
      
      This patch solves this problem by ensuring that ALTER TABLE
      statements which change metadata only never reset table_map_id
      to 0. To do this it changes reopen_table() to correctly use
      refreshed table_map_id value instead of using the old one/
      resetting it.
      
      
      mysql-test/suite/rpl/r/rpl_alter.result:
        Add test for BUG#56226
      mysql-test/suite/rpl/t/rpl_alter.test:
        Add test for BUG#56226
      7525e068
  10. 10 Oct, 2010 1 commit
  11. 09 Oct, 2010 1 commit
    • unknown's avatar
      Bug#55375 Transaction bigger than max_binlog_cache_size crashes slave · 3ed0e521
      unknown authored
      When slave executes a transaction bigger than slave's max_binlog_cache_size,
      slave will crash. It is caused by the assert that server should only roll back
      the statement but not the whole transaction if the error ER_TRANS_CACHE_FULL 
      happens. But slave sql thread always rollbacks the whole transaction when
      an error happens.
                  
      Ather this patch, we always clear any error set in sql thread(it is different
      from the error in 'SHOW SLAVE STATUS') and it is cleared before rolling back
      the transaction.
      
      
      mysql-test/suite/rpl/r/rpl_binlog_max_cache_size.result:
        SET binlog_cache_size and max_binlog_cache_size for all test cases.
        Add test case for bug#55375.
      mysql-test/suite/rpl/t/rpl_binlog_max_cache_size-master.opt:
        binlog_cache_size and max_binlog_cache_size can be set in the client connection.
        so remove this option file.
      mysql-test/suite/rpl/t/rpl_binlog_max_cache_size.test:
        SET binlog_cache_size and max_binlog_cache_size for all test cases.
        Add test case for bug#55375.
      sql/log_event.cc:
        Some functions don't return the error code, so it is a wrong error code.
        The error should always be set into thd->main_da. So we use 
        slave_rows_error_report to report the right error.
      sql/slave.cc:
        exec_relay_log_event() need call cleanup_context() to clear context. 
        clearup_context() will call end_trans().
                
        Clear thd's error before cleanup_context. It avoid to trigger the assert
        which cause this bug.
      3ed0e521
  12. 07 Oct, 2010 1 commit
    • Martin Hansson's avatar
      Bug#56423: Different count with SELECT and CREATE SELECT queries · 0f3b2f79
      Martin Hansson authored
      This is a regression from the fix for bug no 38999. A storage engine capable
      of reading only a subset of a table's columns updates corresponding bits in
      the read buffer to signal that it has read NULL values for the corresponding
      columns. It cannot, and should not, update any other bits. Bug no 38999
      occurred because the implementation of UPDATE statements compare the NULL bits
      using memcmp, inadvertently comparing bits that were never requested from the
      storage engine. The regression was caused by the storage engine trying to
      alleviate the situation by writing to all NULL bits, even those that it had no
      knowledge of. This has devastating effects for the index merge algorithm,
      which relies on all NULL bits, except those explicitly requested, being left
      unchanged.
      
      The fix reverts the fix for bug no 38999 in both InnoDB and InnoDB plugin and
      changes the server's method of comparing records. For engines that always read
      entire rows, we proceed as usual. For engines capable of reading only select
      columns, the record buffers are now compared on a column by column basis. An
      assertion was also added so that non comparable buffers are never read. Some
      relevant copy-pasted code was also consolidated in a new function.
      0f3b2f79
  13. 06 Oct, 2010 2 commits
    • Luis Soares's avatar
      BUG#38718: slave sql thread crashes when reading relay log · c13a5ace
      Luis Soares authored
            
      Suprisingly, a Slave_log_event would show up in the binary
      log. This event is never used and should not appear in the
      logs. As such, when the slave (or the mysqlbinlog tool) reads the
      event, it will hit an invalid pointer (reference to the
      descriptor event when deserializing the Slave_log_event was
      purposodely set to NULL).
            
      The presence of the Slave_log_event denotes a corrupted log, but
      we cannot tell how the log got corrupted in the first
      place. However, we can make the server cope with such events when
      it reads them - in case of log corruption - and fail gracefully.
           
      This patch makes the server/mysqlbinlog to report that it has
      found an invalid log event when Slave_log_event is read.
      c13a5ace
    • Alfranio Correia's avatar
      BUG#57098 RBR breaks on changing user password on 5.1 master -> 5.5 slave · 5b76c8ed
      Alfranio Correia authored
      Backported the patch for BUG#55452.
      5b76c8ed
  14. 05 Oct, 2010 6 commits