1. 14 Jul, 2009 6 commits
    • Sven Sandberg's avatar
      Merged fix for BUG#39934 up a few revisions. · 45f724ec
      Sven Sandberg authored
      NOTE: This undoes changes by BUG#42829 in sql_class.cc:binlog_query().
      I will revert the change in a post-push fix (the binlog filter should
      be checked in sql_base.cc:decide_logging_format()).
      45f724ec
    • Sven Sandberg's avatar
      BUG#39934: Slave stops for engine that only support row-based logging · f3985c64
      Sven Sandberg authored
      General overview:
      The logic for switching to row format when binlog_format=MIXED had
      numerous flaws. The underlying problem was the lack of a consistent
      architecture.
      General purpose of this changeset:
      This changeset introduces an architecture for switching to row format
      when binlog_format=MIXED. It enforces the architecture where it has
      to. It leaves some bugs to be fixed later. It adds extensive tests to
      verify that unsafe statements work as expected and that appropriate
      errors are produced by problems with the selection of binlog format.
      It was not practical to split this into smaller pieces of work.
      
      Problem 1:
      To determine the logging mode, the code has to take several parameters
      into account (namely: (1) the value of binlog_format; (2) the
      capabilities of the engines; (3) the type of the current statement:
      normal, unsafe, or row injection). These parameters may conflict in
      several ways, namely:
       - binlog_format=STATEMENT for a row injection
       - binlog_format=STATEMENT for an unsafe statement
       - binlog_format=STATEMENT for an engine only supporting row logging
       - binlog_format=ROW for an engine only supporting statement logging
       - statement is unsafe and engine does not support row logging
       - row injection in a table that does not support statement logging
       - statement modifies one table that does not support row logging and
         one that does not support statement logging
      Several of these conflicts were not detected, or were detected with
      an inappropriate error message. The problem of BUG#39934 was that no
      appropriate error message was written for the case when an engine
      only supporting row logging executed a row injection with
      binlog_format=ROW. However, all above cases must be handled.
      Fix 1:
      Introduce new error codes (sql/share/errmsg.txt). Ensure that all
      conditions are detected and handled in decide_logging_format()
      
      Problem 2:
      The binlog format shall be determined once per statement, in
      decide_logging_format(). It shall not be changed before or after that.
      Before decide_logging_format() is called, all information necessary to
      determine the logging format must be available. This principle ensures
      that all unsafe statements are handled in a consistent way.
      However, this principle is not followed:
      thd->set_current_stmt_binlog_row_based_if_mixed() is called in several
      places, including from code executing UPDATE..LIMIT,
      INSERT..SELECT..LIMIT, DELETE..LIMIT, INSERT DELAYED, and
      SET @@binlog_format. After Problem 1 was fixed, that caused
      inconsistencies where these unsafe statements would not print the
      appropriate warnings or errors for some of the conflicts.
      Fix 2:
      Remove calls to THD::set_current_stmt_binlog_row_based_if_mixed() from
      code executed after decide_logging_format(). Compensate by calling the
      set_current_stmt_unsafe() at parse time. This way, all unsafe statements
      are detected by decide_logging_format().
      
      Problem 3:
      INSERT DELAYED is not unsafe: it is logged in statement format even if
      binlog_format=MIXED, and no warning is printed even if
      binlog_format=STATEMENT. This is BUG#45825.
      Fix 3:
      Made INSERT DELAYED set itself to unsafe at parse time. This allows
      decide_logging_format() to detect that a warning should be printed or
      the binlog_format changed.
      
      Problem 4:
      LIMIT clause were not marked as unsafe when executed inside stored
      functions/triggers/views/prepared statements. This is
      BUG#45785.
      Fix 4:
      Make statements containing the LIMIT clause marked as unsafe at
      parse time, instead of at execution time. This allows propagating
      unsafe-ness to the view.
      f3985c64
    • Georgi Kodinov's avatar
      merge 5.1-main -> 5.1-bugteam · 5b178e9a
      Georgi Kodinov authored
      5b178e9a
    • Georgi Kodinov's avatar
      merge 5.0-bugteam -> 5.1-bugteam · 18990b11
      Georgi Kodinov authored
      18990b11
    • Georgi Kodinov's avatar
      automerge · 392259bb
      Georgi Kodinov authored
      392259bb
    • Georgi Kodinov's avatar
      automerge · aa737dfc
      Georgi Kodinov authored
      aa737dfc
  2. 13 Jul, 2009 9 commits
  3. 12 Jul, 2009 1 commit
  4. 11 Jul, 2009 1 commit
    • Gleb Shchepa's avatar
      Bug #41156: List of derived tables acts like a chain of · 8724706a
      Gleb Shchepa authored
                  mutually-nested subqueries
      
      Queries of the form
      
        SELECT * FROM (SELECT 1) AS t1,
                      (SELECT 2) AS t2,...
                      (SELECT 32) AS t32
      
      caused the "Too high level of nesting for select" error
      as if the query has a form
      
        SELECT * FROM (SELECT 1 FROM (SELECT 2 FROM (SELECT 3 FROM...
      
      
      The table_factor parser rule has been modified to adjust
      the LEX::nest_level variable value after every derived table.
      8724706a
  5. 10 Jul, 2009 16 commits
  6. 08 Jul, 2009 4 commits
    • Staale Smedseng's avatar
      Bug #43397 mysql headers redefine pthread_mutex_init · f46dba5a
      Staale Smedseng authored
      unnecessarily
            
      The problem is that libmysqlclient.so is built with THREAD
      undefined, while a client compiling against the same header
      files will see THREAD as defined and definitions in
      my_pthread.h will be included, possibly resulting in undefined
      symbols that cannot be resolved with libmysqlclient.so.
            
      The suggested solution is to require that clients wanting to
      link with libmysqlclient.so should be built with
      MYSQL_CLIENT_NO_THREADS defined. This requires a documentation
      change, and more details for this will be supplied if this
      patch is approved.
            
      The MYSQL_CLIENT_NO_THREADS define was renamed from
      UNDEF_THREADS_HACK, to get a more suitable (less suspicious)
      name for the define. (The UNDEF_THREADS_HACK is retained for
      backwards compatibility, though.)
            
      This patch is also in anticipation of WL#4958, which will
      remove this problem altogether by dropping the building of
      libmysqlclient.
      f46dba5a
    • Georgi Kodinov's avatar
      automerge · 1bf7e45b
      Georgi Kodinov authored
      1bf7e45b
    • Georgi Kodinov's avatar
      Addendum to the fix for bug 45807 : initialize a member needed in · 7c28ec97
      Georgi Kodinov authored
      Item_field::fix_fields()
      7c28ec97
    • Georgi Kodinov's avatar
  7. 07 Jul, 2009 3 commits