1. 24 Mar, 2010 4 commits
    • Sergey Vojtovich's avatar
      Applying InnoDB snapshot · 11edd18a
      Sergey Vojtovich authored
      Detailed revision comments:
      
      r6780 | vasil | 2010-03-08 19:13:20 +0200 (Mon, 08 Mar 2010) | 4 lines
      branches/5.1:
      
      Whitespace fixup.
      11edd18a
    • Sergey Vojtovich's avatar
      Applying InnoDB snapshot, fixes BUG#51653 · 3a658104
      Sergey Vojtovich authored
      Detailed revision comments:
      
      r6774 | calvin | 2010-03-03 23:56:10 +0200 (Wed, 03 Mar 2010) | 2 lines
      branches/5.1: fix bug#51653: outdated reference to set-variable
      Non functional change.
      3a658104
    • Sergey Glukhov's avatar
      5.0-bugteam->5.1-bugteam merge · f12f903f
      Sergey Glukhov authored
      f12f903f
    • Sergey Glukhov's avatar
      Bug#48483 crash in get_best_combination() · 3e1ee393
      Sergey Glukhov authored
      The crash happens because greedy_serach
      can not determine best plan due to
      wrong inner table dependences. These
      dependences affects join table sorting
      which performs before greedy_search starting.
      In our case table which has real 'no dependences'
      should be put on top of the list but it does not
      happen as inner tables have no dependences as well.
      The fix is to exclude RAND_TABLE_BIT mask from
      condition which checks if table dependences
      should be updated.
      
      
      mysql-test/r/join.result:
        test result
      mysql-test/t/join.test:
        test case
      sql/sql_select.cc:
        RAND_TABLE_BIT mask should not be counted as it
        prevents update of inner table dependences.
        For example it might happen if RAND() function
        is used in JOIN ON clause.
      3e1ee393
  2. 23 Mar, 2010 1 commit
    • Georgi Kodinov's avatar
      Bug #51850: crash/memory overlap when using load data infile and set · f84368fd
      Georgi Kodinov authored
        col equal to itself!
      
      There's no need to copy the value of a field into itself.
      While generally harmless (except for some performance penalties)
      it may be dangerous when the copy code doesn't expect this.
      Fixed by checking if the source field is the same as the destination
      field before copying the data.
      Note that we must preserve the order of assignment of the null 
      flags (hence the null_value assignment addition).
      f84368fd
  3. 22 Mar, 2010 7 commits
  4. 21 Mar, 2010 1 commit
  5. 19 Mar, 2010 5 commits
    • Sergey Glukhov's avatar
      Bug#51242 HAVING clause on table join produce incorrect results · 9e9f7f7f
      Sergey Glukhov authored
      The problem is that when we make conditon for
      grouped result const part of condition is cut off.
      It happens because some parts of 'having' condition
      which refer to outer join become const after
      make_join_statistics. These parts may be lost
      during further having condition transformation
      in JOIN::exec. The fix is adding 'having'
      condition check for const tables after
      make_join_statistics is performed.
      
      
      mysql-test/r/having.result:
        test case
      mysql-test/t/having.test:
        test result
      sql/sql_select.cc:
        added 'having' condition check for const tables
        after make_join_statistics is performed.
      9e9f7f7f
    • Andrei Elkin's avatar
      Bug #51648 DBUG_SYNC_POINT is not defined on all platforms and mtr cant pre-check that · 700fca4c
      Andrei Elkin authored
      
      DBUG_SYNC_POINT has at least one strong limitation that it's not defined
      on all platforms. It has issues cooperating with @@debug.
      All in all its functionality is superseded by DEBUG_SYNC facility and
      there is no reason to maintain the old less flexible one.
      
      Fixed with adding debug_sync_set_action() function as a facility to set up
      a sync-action in the server sources code and re-writing existing simulations
      (found 3) to use it.
      Couple of tests have been reworked as well.
      
      The patch offers a pattern for setting sync-points in replication threads
      where the standard DEBUG_SYNC does not suffice to reach goals.
      
      
      
      
      
      mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test:
        rewriting the test from GET_LOCK()-based to DEBUG_SYNC-based;
        a pattern of usage DEBUG_SYNC for replication testing is provided.
      mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result:
        results are changed.
      mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test:
        rewriting the test from GET_LOCK()-based to DEBUG_SYNC-based;
        limiting the test to run only with MIXED binlog-format as the test last
        some 10 secs sensitively contributing to the total of tests run.
      mysql-test/suite/rpl/t/rpl_show_slave_running.test:
        rewriting the test from GET_LOCK()-based to DEBUG_SYNC-based.
      sql/debug_sync.cc:
        adding debug_sync_set_action() function as a facility to set up
        a sync-action in the server sources code.
      sql/debug_sync.h:
        externalizing debug_sync_set_action().
      sql/item_func.cc:
        purging sources from DBUG_SYNC_POINT.
      sql/mysql_priv.h:
        purging sources from DBUG_SYNC_POINT.
      sql/slave.cc:
        rewriting failure simulations to base on DEBUG_SYNC rather than GET_LOCK()-based DBUG_SYNC_POINT.
      sql/sql_repl.cc:
        removing an orphan failure simulation line because no counterpart in tests existing.
      700fca4c
    • Martin Hansson's avatar
      Post-push fix to disable a subset of the test case for Bug#47762. · 5c87c97c
      Martin Hansson authored
      This has been back-ported from 6.0 as the problems proved to afflict 
      5.1 as well.
      The fix exposed two new bugs. They were reported as follows.
            
      Bug no 52174: Sometimes wrong plan when reading a MAX value 
      from non-NULL index
            
      Bug no 52173: Reading NULL value from non-NULL index gives wrong 
      result in embedded server 
            
      Both bugs taken together affect a much smaller class of queries than #47762, 
      so the fix stays for now.
      5c87c97c
    • Sergey Glukhov's avatar
      Bug#51598 Inconsistent behaviour with a COALESCE statement inside an IN comparison · f341fff1
      Sergey Glukhov authored
      Optimizer erroneously translated LEFT JOIN into INNER JOIN.
      It leads to cutting rows with NULL right side. It happens
      because Item_row uses not_null_tables() method form the
      base(Item) class and does not calculate 'null tables'
      properly. The fix is adding calculation of 'not null tables'
      to Item_row.
      
      
      mysql-test/r/join_outer.result:
        test result
      mysql-test/t/join_outer.test:
        test case
      sql/item_row.cc:
        adding calculation of 'not null tables' to Item_row.
      sql/item_row.h:
        adding calculation of 'not null tables' to Item_row.
      f341fff1
    • Sergey Glukhov's avatar
      Bug#51494 crash with join, explain and 'sounds like' operator · 895cf531
      Sergey Glukhov authored
      The crash happens because of discrepancy between values of
      conts_tables and join->const_table_map(make_join_statisctics).
      Calculation of conts_tables used condition with
      HA_STATS_RECORDS_IS_EXACT flag check. Calculation of
      join->const_table_map does not use this flag check.
      In case of MERGE table without union with index
      the table does not become const table and
      thus join_read_const_table() is not called
      for the table. join->const_table_map supposes
      this table is const and later in make_join_select
      this table is used for making&calculation const
      condition. As table record buffer is not populated
      it leads to crash.
      The fix is adding a check if an engine supports
      HA_STATS_RECORDS_IS_EXACT flag before updating
      join->const_table_map.
      
      
      mysql-test/r/merge.result:
        test result
      mysql-test/t/merge.test:
        test case
      sql/sql_select.cc:
        adding a check if an engine supports
        HA_STATS_RECORDS_IS_EXACT flag before updating
        join->const_table_map.
      895cf531
  6. 18 Mar, 2010 2 commits
  7. 17 Mar, 2010 3 commits
    • Mats Kindahl's avatar
      Merging with mysql-5.1-bugteam · 70b83adc
      Mats Kindahl authored
      70b83adc
    • Mats Kindahl's avatar
      BUG#49618: Field length stored incorrectly in binary log · 028d1256
      Mats Kindahl authored
                 for InnoDB
                  
      The class Field_bit_as_char stores the metadata for the
      field incorrecly because bytes_in_rec and bit_len are set
      to (field_length + 7 ) / 8 and 0 respectively, while
      Field_bit has the correct values field_length / 8 and
      field_length % 8.
                  
      Solved the problem by re-computing the values for the
      metadata based on the field_length instead of using the
      bytes_in_rec and bit_len variables.
                  
      To handle compatibility with old server, a table map
      flag was added to indicate that the bit computation is
      exact. If the flag is clear, the slave computes the
      number of bytes required to store the bit field and
      compares that instead, effectively allowing replication
      *without conversion* from any field length that require
      the same number of bytes to store.
      
      
      mysql-test/suite/rpl/t/rpl_typeconv_innodb.test:
        Adding test to check compatibility for bit field
        replication when using InnoDB
      sql/field.cc:
        Extending compatible_field_size() with flags from
        table map to allow fields to check master info.
      sql/field.h:
        Extending compatible_field_size() with flags from
        table map to allow fields to check master info.
      sql/log.cc:
        Removing table map flags since they are not used
        outside table map class.
      sql/log_event.cc:
        Removing flags parameter from table map constructor
        since it is not used and does not have to be exposed.
      sql/log_event.h:
        Adding flag to denote that bit length for bit field type
        is exact and not potentially rounded to even bytes.
      sql/rpl_utility.cc:
        Adding fields to table_def to store table map flags.
      sql/rpl_utility.h:
        Removing obsolete comment and adding flags to store
        table map flags from master.
      028d1256
    • Georgi Kodinov's avatar
      Bug #49838: DROP INDEX and ADD UNIQUE INDEX for same index may corrupt · b71491b5
      Georgi Kodinov authored
         definition at engine
      
      If a single ALTER TABLE contains both DROP INDEX and ADD INDEX using 
      the same index name (a.k.a. index modification) we need to disable 
      in-place alter table because we can't ask the storage engine to have 
      two copies of the index with the same name even temporarily (if we 
      first do the ADD INDEX and then DROP INDEX) and we can't modify 
      indexes that are needed by e.g. foreign keys if we first do 
      DROP INDEX and then ADD INDEX.
      Fixed the problem by disabling in-place ALTER TABLE for these cases.
      b71491b5
  8. 14 Mar, 2010 2 commits
    • Staale Smedseng's avatar
      Bug #49829 Many "hides virtual function" warnings with · 0c07d7c4
      Staale Smedseng authored
      SunStudio
            
      SunStudio compilers of late warn about methods that might hide
      methods in base classes due to the use of overloading combined
      with overriding. SunStudio also warns about variables defined
      in local socpe or method arguments that have the same name as
      a member attribute of the class.
            
      This patch renames methods that might hide base class methods,
      to make it easier both for humans and compilers to see what is
      actually called. It also renames variables in local scope.
      
      
      sql/field.cc:
        Local scope variable or method argument same as class 
        attribute.
      sql/item_cmpfunc.cc:
        Local scope variable or method argument same as class 
        attribute.
      sql/item_create.cc:
        Renaming base class create() to create_func().
      sql/item_create.h:
        Renaming base class create() to create_func().
      sql/protocol.cc:
        Local scope variable or method argument same as class 
        attribute.
      sql/sql_profile.cc:
        Local scope variable or method argument same as class 
        attribute.
      sql/sql_select.cc:
        Local scope variable or method argument same as class 
        attribute.
      sql/sql_yacc.yy:
        Renaming base class create() to create_func().
      storage/federated/ha_federated.cc:
        Local scope variable or method argument same as class 
        attribute.
      storage/myisammrg/ha_myisammrg.cc:
        Local scope variable or method argument same as class 
        attribute.
      0c07d7c4
    • Davi Arnaut's avatar
      6c5d8911
  9. 13 Mar, 2010 1 commit
  10. 10 Mar, 2010 4 commits
    • Sergey Vojtovich's avatar
      An addition to fix for · 41bbf45a
      Sergey Vojtovich authored
      BUG#51342 - more xid crashing
      
      Restore autocommit variable by supplying explicit value.
      
      mysql-test/r/xa.result:
        Restore autocommit variable by supplying explicit value.
      mysql-test/t/xa.test:
        Restore autocommit variable by supplying explicit value.
      41bbf45a
    • Sergey Vojtovich's avatar
      Merge fix for BUG51342 to 5.0-bugteam. · 25395164
      Sergey Vojtovich authored
      25395164
    • Sergey Vojtovich's avatar
      BUG#51342 - more xid crashing · ffc0137d
      Sergey Vojtovich authored
      SET autocommit=1 while XA transaction is active may
      cause various side effects, including memory corruption
      and server crash.
      
      The problem is that SET autocommit=1 and further queries
      attempt to commit local transaction, whereas XA transaction
      is still active.
      
      As local and XA transactions are mutually exclusive, this
      patch forbids enabling autocommit mode while XA transaction
      is active.
      
      mysql-test/r/xa.result:
        A test case for BUG#51342.
      mysql-test/t/xa.test:
        A test case for BUG#51342.
      sql/set_var.cc:
        Forbid enabling autocommit mode while XA transaction is
        active.
      ffc0137d
    • Georgi Kodinov's avatar
  11. 09 Mar, 2010 1 commit
    • Davi Arnaut's avatar
      Bug#47761: crash when killing a query during subquery execution... · dfa528d0
      Davi Arnaut authored
      The problem was that killing a query during the optimization
      phase of a subselect would lead to crashes. The root of the
      problem is that the subselect execution engine ignores failures
      (eg: killed) during the optimization phase (JOIN::optimize),
      leading to a crash once the subquery is executed due to
      partially initialized structures (in this case a join tab).
      
      The optimal solution would be to cleanup certain optimizer
      structures if the optimization phase fails, but currently
      there is no infrastructure to properly to track and cleanup
      the structures. To workaround the whole problem one somewhat
      good solution is to avoid executing a subselect if the query
      has been killed. Cutting short any problems caused by failures
      during the optimization phase.
      
      sql/item_subselect.cc:
        Do not execute a subselect if the session or query has been killed.
      dfa528d0
  12. 16 Mar, 2010 8 commits
  13. 15 Mar, 2010 1 commit