1. 14 Oct, 2009 1 commit
    • Sven Sandberg's avatar
      BUG#39934: Slave stops for engine that only support row-based logging · d1cf9f1c
      Sven Sandberg authored
      Post-push fix.
      Problem: After the original bugfix, if a statement is unsafe,
      binlog_format=mixed, and engine is statement-only, a warning was
      generated and the statement executed. However, it is a fundamental
      principle of binlogging that binlog_format=mixed should guarantee
      correct logging, no compromise. So correct behavior is to generate
      an error and don't execute the statement.
      Fix: Generate error instead of warning.
      Since issue_unsafe_warnings can only generate one error message,
      this allows us to simplify the code a bit too:
      decide_logging_format does not have to save the error code for
      issue_unsafe_warnings
      
      
      mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result:
        updated result file
      mysql-test/suite/binlog/r/binlog_stm_ps.result:
        updated result file
      mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result:
        updated result file
      mysql-test/suite/binlog/r/binlog_unsafe.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_stm_found_rows.result:
        updated result file
      mysql-test/suite/rpl/r/rpl_stm_loadfile.result:
        updated result file
      mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result:
        updated result file
      mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test:
        updated test:
         - ER_BINLOG_UNSAFE_AND_STMT_ENGINE is now an error.
         - added test for multiple types of unsafety
      sql/share/errmsg.txt:
         - Reformulated ER_BINLOG_UNSAFE_AND_STMT_ENGINE to reflect that it
           is now an error, not a warning.
         - Added "Reason for unsafeness" to ER_BINLOG_UNSAFE_STATEMENT and
           ER_BINLOG_UNSAFE_AND_STMT_ENGINE.
      sql/sql_class.cc:
        In decide_logging_format:
         - generate an error immediately in case 3, instead of scheduling a
           warning to be generated later. also updated comments accordingly
         - in case 7, there is only one unsafe warning error code now, so we
           don't need to store it in binlog_unsafe_warning_flags
           (see changes in sql_lex.h)
         - fixed compilation warning in DBUG_PRINT
        
        In issue_binlog_warning:
         - moved array of error codes to sql_lex.h (so that they are
           accessible also from decide_logging_format)
         - simplified code after the first set of bits in
           binlog_unsafe_warning_flags was removed
      sql/sql_class.h:
         - got rid of enum_binlog_stmt_warning. It's not needed anymore
           since we only have one type of unsafe warning (one of them
           turned into an error)
         - updated comments accordingly
      sql/sql_lex.cc:
        added initialization of the array of error codes that has been
        moved from THD::issue_unsafe_warnings to LEX.
      sql/sql_lex.h:
        Moved array of error codes from THD::issue_unsafe_warnings to LEX.
      d1cf9f1c
  2. 30 Sep, 2009 3 commits
  3. 04 Sep, 2009 1 commit
  4. 02 Sep, 2009 14 commits
  5. 01 Sep, 2009 6 commits
  6. 31 Aug, 2009 11 commits
  7. 30 Aug, 2009 3 commits
    • Staale Smedseng's avatar
      Merge from 5.1-bugteam · 001e9f14
      Staale Smedseng authored
      001e9f14
    • Alexey Kopytov's avatar
      Automerge. · 9aeb91d3
      Alexey Kopytov authored
      9aeb91d3
    • Alexey Kopytov's avatar
      Bug #46607: Assertion failed: (cond_type == Item::FUNC_ITEM) · 9620aec7
      Alexey Kopytov authored
                  results in server crash 
       
      check_group_min_max_predicates() assumed the input condition 
      item to be one of COND_ITEM, SUBSELECT_ITEM, or FUNC_ITEM. 
      Since a condition of the form "field" is also a valid condition 
      equivalent to "field <> 0", using such a condition in a query 
      where the loose index scan was chosen resulted in a debug 
      assertion failure. 
       
      Fixed by handling conditions of the FIELD_ITEM type in 
      check_group_min_max_predicates(). 
      
      mysql-test/r/group_min_max.result:
        Added a test case for bug #46607.
      mysql-test/t/group_min_max.test:
        Added a test case for bug #46607.
      sql/opt_range.cc:
        Handle conditions of the FUNC_ITEM type in 
        check_group_mix_max_predicates().
      9620aec7
  8. 29 Aug, 2009 1 commit
    • unknown's avatar
      Bug #44331 Restore of database with events produces warning in replication · 13b35da1
      unknown authored
      If an EVENT is created without the DEFINER clause set explicitly or with it set  
      to CURRENT_USER, the master and slaves become inconsistent. This issue stems from 
      the fact that in both cases, the DEFINER is set to the CURRENT_USER of the current 
      thread. On the master, the CURRENT_USER is the mysqld's user, while on the slave,  
      the CURRENT_USER is empty for the SQL Thread which is responsible for executing 
      the statement.
      
      To fix the problem, we do what follows. If the definer is not set explicitly,  
      a DEFINER clause is added when writing the query into binlog; if 'CURRENT_USER' is 
      used as the DEFINER, it is replaced with the value of the current user before 
      writing to binlog.
      
      mysql-test/suite/rpl/r/rpl_create_if_not_exists.result:
        Updated the result file after fixing bug#44331
      mysql-test/suite/rpl/r/rpl_drop_if_exists.result:
        Updated the result file after fixing bug#44331
      mysql-test/suite/rpl/r/rpl_events.result:
        Test result of Bug#44331
      mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result:
        Updated the result file after fixing bug#44331
      mysql-test/suite/rpl/t/rpl_events.test:
        Added test to verify if the definer is consistent between master and slave
        when the event is created without the DEFINER clause set explicitly or the
        DEFINER is set to CURRENT_USER
      sql/events.cc:
        The "create_query_string" function is added to create a new query string 
        for removing executable comments.
      sql/sql_yacc.yy:
        The remember_name token was added for recording the offset of EVENT_SYM.
      13b35da1