1. 22 Mar, 2010 1 commit
    • Sergey Vojtovich's avatar
      BUG#51868 - crash with myisam_use_mmap and partitioned · b602127b
      Sergey Vojtovich authored
                  myisam tables
      
      Queries following TRUNCATE of partitioned MyISAM table
      may crash server if myisam_use_mmap is true.
      
      Internally this is MyISAM bug, but limited to partitioned
      tables, because MyISAM doesn't use ::delete_all_rows()
      method for TRUNCATE, but goes via table recreate instead.
      
      MyISAM didn't properly fall back to non-mmaped I/O after
      mmap() failure. Was not repeatable on linux before, likely
      because (quote from man mmap):
        SUSv3  specifies  that  mmap() should fail if length is 0.
        However, in kernels before 2.6.12, mmap() succeeded in
        this case: no mapping was created and the call returned
        addr. Since kernel 2.6.12, mmap() fails with the error
        EINVAL for this case.
      
      mysql-test/r/partition.result:
        A test case for BUG#51868.
      mysql-test/t/partition.test:
        A test case for BUG#51868.
      storage/myisam/mi_delete_all.c:
        _mi_unmap_file() is compressed record format specific,
        which is read-only. As compressed MyISAM data files are
        read-only, we must never use _mi_unmap_file() in
        mi_delete_all_rows().
      storage/myisam/mi_dynrec.c:
        Make myisam mmap code more durable to errors:
        - set file_read/file_write handlers if mmap succeeded;
        - reset file_read/file_write handlers on unmap.
      storage/myisam/mi_extra.c:
        Moved file_read/file_write handlers initialization to
        mi_dynmap_file().
      storage/myisam/myisamdef.h:
        Added mi_munmap_file() declaration.
      b602127b
  2. 18 Mar, 2010 1 commit
  3. 17 Mar, 2010 3 commits
    • Mats Kindahl's avatar
      Merging with mysql-5.1-bugteam · 96d4a038
      Mats Kindahl authored
      96d4a038
    • Mats Kindahl's avatar
      BUG#49618: Field length stored incorrectly in binary log · 2c5f439d
      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.
      2c5f439d
    • Georgi Kodinov's avatar
      Bug #49838: DROP INDEX and ADD UNIQUE INDEX for same index may corrupt · ae49d971
      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.
      ae49d971
  4. 09 Mar, 2010 1 commit
    • Davi Arnaut's avatar
      Bug#47761: crash when killing a query during subquery execution... · ed92f915
      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.
      ed92f915
  5. 16 Mar, 2010 8 commits
  6. 15 Mar, 2010 1 commit
  7. 14 Mar, 2010 2 commits
    • Staale Smedseng's avatar
      Bug #49829 Many "hides virtual function" warnings with · c7fad393
      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.
      c7fad393
    • Davi Arnaut's avatar
      57a96c77
  8. 13 Mar, 2010 1 commit
  9. 12 Mar, 2010 5 commits
  10. 11 Mar, 2010 5 commits
  11. 10 Mar, 2010 11 commits
    • Martin Hansson's avatar
      Bug#50545: Single table UPDATE IGNORE crashes on · dcc5b43b
      Martin Hansson authored
      join view in sql_safe_updates mode. 
      
      This bug was unexpectedly fixed along with bug 
      number 49534. This patch contains only the test
      case.
      dcc5b43b
    • Sergey Vojtovich's avatar
    • Sergey Vojtovich's avatar
      An addition to fix for · 2a667b7b
      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.
      2a667b7b
    • Sergey Vojtovich's avatar
      Merge fix for BUG51307 to 5.1-bugteam. · f0c4da7c
      Sergey Vojtovich authored
      f0c4da7c
    • Sergey Vojtovich's avatar
      Merge fix for BUG51342 to 5.1-bugteam. · 680cc263
      Sergey Vojtovich authored
      680cc263
    • Mattias Jonsson's avatar
      Bug#51830: Incorrect partition pruning on range partition · 29b39e7a
      Mattias Jonsson authored
      (regression)
      
      Problem was that partition pruning did not exclude the
      last partition if the range was beyond it
      (i.e. not using MAXVALUE)
      
      Fix was to not include the last partition if the
      partitioning function value was not within the partition
      range.
      
      mysql-test/r/partition_innodb.result:
        Bug#51830: Incorrect partition pruning on range partition
        (regression)
        
        Updated result
      mysql-test/r/partition_pruning.result:
        Bug#51830: Incorrect partition pruning on range partition
        (regression)
        
        Updated result
      mysql-test/t/partition_innodb.test:
        Bug#51830: Incorrect partition pruning on range partition
        (regression)
        
        Added test for pruning in InnoDB, since it does not show
        for MyISAM due to 'Impossible WHERE noticed after reading
        const tables'.
      mysql-test/t/partition_pruning.test:
        Bug#51830: Incorrect partition pruning on range partition
        (regression)
        
        Added test
      sql/sql_partition.cc:
        Bug#51830: Incorrect partition pruning on range partition
        (regression)
        
        Also increase the partition id if not inside the last partition
        (and no MAXVALUE is defined).
        
        Added comments and DBUG_ASSERT.
      29b39e7a
    • Sergey Vojtovich's avatar
      Merge fix for BUG51342 to 5.0-bugteam. · 992f6754
      Sergey Vojtovich authored
      992f6754
    • Sergey Vojtovich's avatar
      BUG#51342 - more xid crashing · 405fd822
      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.
      405fd822
    • Georgi Kodinov's avatar
      merge · e48779e9
      Georgi Kodinov authored
      e48779e9
    • Georgi Kodinov's avatar
      merge · d03dd16b
      Georgi Kodinov authored
      d03dd16b
    • Georgi Kodinov's avatar
  12. 09 Mar, 2010 1 commit
    • Georgi Kodinov's avatar
      Bug #35250: readline check breaks when doing vpath build · d63b0a5c
      Georgi Kodinov authored
      MySQL uses two source layouts when building : the bzr 
      layout and the source package layout.
      The previous fix for bug 35250 contained 1 change that is
      valid for both modes and a number of changes that are valid
      only for the bzr source layout.
      The important thing was to fix the source package layout.
      And for this the change in configure.in was sufficient.
      It's not trivial (and not requested by this bug) to support 
      VPATH builds from the bzr trees.
      This is why the other changes are reverted and the change to
      fix the VPATH build for source distributions is left intact.
      d63b0a5c