1. 31 Aug, 2009 3 commits
  2. 30 Aug, 2009 3 commits
    • Staale Smedseng's avatar
      Merge from 5.1-bugteam · 7aa88fcb
      Staale Smedseng authored
      7aa88fcb
    • Alexey Kopytov's avatar
      Automerge. · 6070491d
      Alexey Kopytov authored
      6070491d
    • Alexey Kopytov's avatar
      Bug #46607: Assertion failed: (cond_type == Item::FUNC_ITEM) · 62b95b90
      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(). 
      62b95b90
  3. 29 Aug, 2009 1 commit
    • 's avatar
      Bug #44331 Restore of database with events produces warning in replication · 90e25c6f
      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.
      90e25c6f
  4. 28 Aug, 2009 8 commits
  5. 27 Aug, 2009 6 commits
    • Alfranio Correia's avatar
      BUG#46861 Auto-closing of temporary tables broken by replicate-rewrite-db · fe03c7dc
      Alfranio Correia authored
      When a connection is dropped any remaining temporary table is also automatically
      dropped and the SQL statement of this operation is written to the binary log in
      order to drop such tables on the slave and keep the slave in sync. Specifically,
      the current code base creates the following type of statement:
      DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `db`.`table`;
      
      Unfortunately, appending the database to the table name in this manner circumvents
      the replicate-rewrite-db option (and any options that check the current database).
      To solve the issue, we started writing the statement to the binary as follows:
      use `db`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `table`;
      fe03c7dc
    • Alfranio Correia's avatar
      BUG#46864 Incorrect update of InnoDB table on slave when using trigger with myisam table · c21fbff3
      Alfranio Correia authored
      Slave does not correctly handle "expected errors" leading to inconsistencies
      between the mater and slave. Specifically, when a statement changes both
      transactional and non-transactional tables, the transactional changes are
      automatically rolled back on the master but the slave ignores the error and
      does not roll them back thus leading to inconsistencies.
            
      To fix the problem, we automatically roll back a statement that fails on
      the slave but note that the transaction is not rolled back unless a "rollback"
      command is in the relay log file.
      c21fbff3
    • Sergey Glukhov's avatar
      5.0-bugteam->5.1-bugteam merge · be4b0278
      Sergey Glukhov authored
      be4b0278
    • Sergey Glukhov's avatar
      Bug#46184 Crash, SELECT ... FROM derived table procedure analyze · d9d71d0f
      Sergey Glukhov authored
      The crash happens because select_union object is used as result set
      for queries which have derived tables.
      select_union use temporary table as data storage and if
      fields count exceeds 10(count of values for procedure ANALYSE())
      then we get a crash on fill_record() function.
      d9d71d0f
    • Alfranio Correia's avatar
      Post-fix for BUG#28976. · 01eda659
      Alfranio Correia authored
      Updated main.mysqlbinlog_row_trans's result file as 
      TRUNCATE statements are wrapped in BEGIN...COMMIT.
      01eda659
    • Georgi Kodinov's avatar
      merged 5.0-bugteam -> 5.1-bugteam · 83984db0
      Georgi Kodinov authored
      83984db0
  6. 26 Aug, 2009 5 commits
    • Alfranio Correia's avatar
      BUG#28976 Mixing trans and non-trans tables in one transaction results in incorrect · dbcfef4c
      Alfranio Correia authored
      binlog
      
      Mixing transactional (T) and non-transactional (N) tables on behalf of a
      transaction may lead to inconsistencies among masters and slaves in STATEMENT
      mode. The problem stems from the fact that although modifications done to
      non-transactional tables on behalf of a transaction become immediately visible
      to other connections they do not immediately get to the binary log and therefore
      consistency is broken. Although there may be issues in mixing T and M tables in
      STATEMENT mode, there are safe combinations that clients find useful.
      
      In this bug, we fix the following issue. Mixing N and T tables in multi-level
      (e.g. a statement that fires a trigger) or multi-table table statements (e.g.
      update t1, t2...) were not handled correctly. In such cases, it was not possible
      to distinguish when a T table was updated if the sequence of changes was N and T.
      In a nutshell, just the flag "modified_non_trans_table" was not enough to reflect
      that both a N and T tables were changed. To circumvent this issue, we check if an
      engine is registered in the handler's list and changed something which means that
      a T table was modified.
      
      Check WL 2687 for a full-fledged patch that will make the use of either the MIXED or
      ROW modes completely safe.
      dbcfef4c
    • 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
  7. 24 Aug, 2009 5 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
    • Georgi Kodinov's avatar
      Bug #37044: Read overflow in opt_range.cc found during "make test" · e4f8deb2
      Georgi Kodinov authored
      The code was using a special global buffer for the value of IS NULL ranges.
      This was not always long enough to be copied by a regular memcpy. As a 
      result read buffer overflows may occur.
      Fixed by setting the null byte to 1 and setting the rest of the field disk image
      to NULL with a bzero (instead of relying on the buffer and memcpy()).
      e4f8deb2
    • Alfranio Correia's avatar
    • Alfranio Correia's avatar
    • Anurag Shekhar's avatar
      Bug #44723 Larger read_buffer_size values can cause performance · 90032c10
      Anurag Shekhar authored
               decrease for INSERTs
      
      
      Bulk inserts (multiple row, CREATE ... SELECT, INSERT ... SELECT) into
      MyISAM tables were performed inefficiently. This was mainly affecting
      use cases where read_buffer_size was considerably large (>256K) and low
      number of rows was inserted (e.g. 30-100).
      
      The problem was that during I/O cache initialization (this happens
      before each bulk insert) allocated I/O buffer was unnecessarily
      initialized to '\0'.
      
      This was happening because of mess in flag values. MyISAM informs I/O
      cache to wait for free space (if out of disk space) by passing
      MY_WAIT_IF_FULL flag. Since MY_WAIT_IF_FULL and MY_ZEROFILL have the
      same values, memory allocator was initializing memory to '\0'.
      
      The performance gain provided with this patch may only be visible with
      non-debug binaries, since safemalloc always initializes allocated memory
      to 0xA5A5...
      90032c10
  8. 21 Aug, 2009 8 commits
  9. 20 Aug, 2009 1 commit