1. 28 Aug, 2009 1 commit
  2. 26 Aug, 2009 4 commits
    • Mattias Jonsson's avatar
      merge · f56dc208
      Mattias Jonsson authored
      f56dc208
    • Mattias Jonsson's avatar
      merge · b19ad3f8
      Mattias Jonsson authored
      b19ad3f8
    • Mattias Jonsson's avatar
      Bug#20577: Partitions: use of to_days() function leads to selection failures · 401fb7c6
      Mattias Jonsson authored
      Problem was that the partition containing NULL values
      was pruned away, since '2001-01-01' < '2001-02-00' but
      TO_DAYS('2001-02-00') is NULL.
      
      Added the NULL partition for RANGE/LIST partitioning on TO_DAYS()
      function to be scanned too.
      
      Also fixed a bug that added ALLOW_INVALID_DATES to sql_mode
      (SELECT * FROM t WHERE date_col < '1999-99-99' on a RANGE/LIST
      partitioned table would add it).
      401fb7c6
    • Mattias Jonsson's avatar
      Bug#46362: Endpoint should be set to false for TO_DAYS(DATE) · 3b756a01
      Mattias Jonsson authored
      There were a problem since pruning uses the field
      for comparison (while evaluate_join_record uses longlong),
      resulting in pruning failures when comparing DATE to DATETIME.
      
      Fix was to always comparing DATE vs DATETIME as DATETIME,
      by adding ' 00:00:00' to the DATE string.
      
      And adding optimization for comparing with 23:59:59, so that
      DATETIME_col > '2001-02-03 23:59:59' ->
      TO_DAYS(DATETIME_col) > TO_DAYS('2001-02-03 23:59:59') instead
      of '>='.
      3b756a01
  3. 24 Aug, 2009 3 commits
    • Davi Arnaut's avatar
      Bug#45261: Crash, stored procedure + decimal · 31afccc4
      Davi Arnaut authored
      The problem was that creating a DECIMAL column from a decimal
      value could lead to a failed assertion as decimal values can
      have a higher precision than those attached to a table. The
      assert could be triggered by creating a table from a decimal
      with a large (> 30) scale. Also, there was a problem in
      calculating the number of digits in the integral and fractional
      parts if both exceeded the maximum number of digits permitted
      by the new decimal type.
      
      The solution is to ensure that truncation procedure is executed
      when deducing a DECIMAL column from a decimal value of higher
      precision. If the integer part is equal to or bigger than the
      maximum precision for the DECIMAL type (65), the integer part
      is truncated to fit and the fractional becomes zero. Otherwise,
      the fractional part is truncated to fit into the space left
      after the integer part is copied.
      
      This patch borrows code and ideas from Martin Hansson's patch.
      31afccc4
    • Alfranio Correia's avatar
    • Alfranio Correia's avatar
  4. 21 Aug, 2009 8 commits
  5. 20 Aug, 2009 3 commits
  6. 19 Aug, 2009 3 commits
    • Alfranio Correia's avatar
      BUG#45694 Deadlock in replicated statement is not retried · f132d6b4
      Alfranio Correia authored
      If the SQL Thread fails to execute an event due to a temporary error (e.g.
      ER_LOCK_DEADLOCK) and the option "--slave_transaction_retries" is set the SQL
      Thread should not be aborted and the transaction should be restarted from the
      beginning and re-executed.
      
      Unfortunately, a wrong interpretation of the THD::is_fatal_error was preventing
      this behavior. In a nutshell, "this variable is set to TRUE if an execution of a
      compound statement cannot continue. In particular, it is used to disable access
      to the CONTINUE or EXIT handlers of stored routines. So even temporary errors
      may have this variable set.
      
      To fix the bug, we have done what follows:
      
         DBUG_ENTER("has_temporary_error");
      
      -  if (thd->is_fatal_error)
      -    DBUG_RETURN(0);
      -
         DBUG_EXECUTE_IF("all_errors_are_temporary_errors",
                         if (thd->main_da.is_error())
                         {
      f132d6b4
    • Georgi Kodinov's avatar
      Bug #46019: ERROR 1356 When selecting from within another · 4207e50e
      Georgi Kodinov authored
      view that has Group By
            
      Table access rights checking function check_grant() assumed
      that no view is opened when it's called.
      This is not true with nested views where the inner view
      needs materialization. In this case the view is already 
      materialized when check_grant() is called for it.
      This caused check_grant() to not look for table level
      grants on the materialized view table.
      Fixed by checking if a view is already materialized and if 
      it is check table level grants using the original table name
      (not the ones of the materialized temp table).
      4207e50e
    • Georgi Kodinov's avatar
      0c8690e5
  7. 17 Aug, 2009 3 commits
  8. 14 Aug, 2009 1 commit
  9. 13 Aug, 2009 5 commits
    • Davi Arnaut's avatar
      Merge from mysql-5.0-bugteam. · 1cf02d95
      Davi Arnaut authored
      1cf02d95
    • Davi Arnaut's avatar
      Bug#46013: rpl_extraColmaster_myisam fails on pb2 · 97dbd987
      Davi Arnaut authored
      Bug#45243: crash on win in sql thread clear_tables_to_lock() -> free()
      Bug#45242: crash on win in mysql_close() -> free()
      Bug#45238: rpl_slave_skip, rpl_change_master failed (lost connection) for STOP SLAVE
      Bug#46030: rpl_truncate_3innodb causes server crash on windows
      Bug#46014: rpl_stm_reset_slave crashes the server sporadically in pb2
      
      When killing a user session on the server, it's necessary to
      interrupt (notify) the thread associated with the session that
      the connection is being killed so that the thread is woken up
      if waiting for I/O. On a few platforms (Mac, Windows and HP-UX)
      where the SIGNAL_WITH_VIO_CLOSE flag is defined, this interruption
      procedure is to asynchronously close the underlying socket of
      the connection.
      
      In order to enable this schema, each connection serving thread
      registers its VIO (I/O interface) so that other threads can
      access it and close the connection. But only the owner thread of
      the VIO might delete it as to guarantee that other threads won't
      see freed memory (the thread unregisters the VIO before deleting
      it). A side note: closing the socket introduces a harmless race
      that might cause a thread attempt to read from a closed socket,
      but this is deemed acceptable.
      
      The problem is that this infrastructure was meant to only be used
      by server threads, but the slave I/O thread was registering the
      VIO of a mysql handle (a client API structure that represents a
      connection to another server instance) as a active connection of
      the thread. But under some circumstances such as network failures,
      the client API might destroy the VIO associated with a handle at
      will, yet the VIO wouldn't be properly unregistered. This could
      lead to accesses to freed data if a thread attempted to kill a
      slave I/O thread whose connection was already broken.
      
      There was a attempt to work around this by checking whether
      the socket was being interrupted, but this hack didn't work as
      intended due to the aforementioned race -- attempting to read
      from the socket would yield a "bad file descriptor" error.
      
      The solution is to add a hook to the client API that is called
      from the client code before the VIO of a handle is deleted.
      This hook allows the slave I/O thread to detach the active vio
      so it does not point to freed memory.
      97dbd987
    • Ramil Kalimullin's avatar
      Fix for bug #46614: Assertion in show_create_trigger() · 1aec6f7a
      Ramil Kalimullin authored
      on SHOW CREATE TRIGGER + MERGE table
      
      Problem: SHOW CREATE TRIGGER erroneously relies on fact
      that we have the only underlying table for a trigger
      (wrong for merge tables).
      
      Fix: remove erroneous assert().
      1aec6f7a
    • Alfranio Correia's avatar
      BUG#46130 Slave does not correctly handle "expected errors" · d7c288f6
      Alfranio Correia authored
      In STATEMENT based replication, a statement that failed on the master but that
      updated non-transactional tables is written to binary log with the error code
      appended to it. On the slave, the statement is executed and the same error is
      expected. However, when an "expected error" did not happen on the slave and was
      either ignored or was related to a concurrency issue on the master, the slave
      did not rollback the effects of the statement and as such inconsistencies might
      happen.
      
      To fix the problem, we automatically rollback a statement that should have
      failed on a slave but succeded and whose expected failure is either ignored or
      stems from a concurrency issue on the master.
      d7c288f6
    • 's avatar
      BUG#45574 CREATE IF NOT EXISTS is not binlogged if the object exists · 10e90a1f
      authored
      There is an inconsistency with DROP DATABASE|TABLE|EVENT IF EXISTS and
      CREATE DATABASE|TABLE|EVENT IF NOT EXISTS. DROP IF EXISTS statements are
      binlogged even if either the DB, TABLE or EVENT does not exist. In
      contrast, Only the CREATE EVENT IF NOT EXISTS is binlogged when the EVENT
      exists.  
      
      This patch fixes the following cases for all the replication formats:
      CREATE DATABASE IF NOT EXISTS.
      CREATE TABLE IF NOT EXISTS,
      CREATE TABLE IF NOT EXISTS ... LIKE,
      CREAET TABLE IF NOT EXISTS ... SELECT.
      10e90a1f
  10. 12 Aug, 2009 9 commits