1. 19 Aug, 2008 1 commit
    • Mattias Jonsson's avatar
      Post push fix for valgrind warning in ha_partition.cc · e1f74adb
      Mattias Jonsson authored
      Bug#35161
      Fixed memory leak when failing to open a partition.
      
      Bug#20129
      Added tests for verifying REPAIR PARTITION.
      
      mysql-test/std_data/parts/t1_will_crash#P#p1_first_1024.MYD:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... not working
        
        (see mysql-test/suite/parts/t/partition_repair_myisam.test
        Created by:
        CREATE TABLE t1_will_crash (
          a VARCHAR(255),
          b INT,
          c LONGTEXT,
          PRIMARY KEY (a, b))ENGINE=MyISAM
        PARTITION BY HASH (b)
        PARTITIONS 7;
        INSERT INTO t1_will_crash VALUES ...
        and then
        head -c 1024 var/master-data/test/t1_will_crash#P#p1.MYD
        into this file.
      mysql-test/std_data/parts/t1_will_crash#P#p2.MYD:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... not working
        
        (see mysql-test/suite/parts/t/partition_repair_myisam.test)
        copy of file right after _mi_mark_file_changed in mi_write
        was done.
      mysql-test/std_data/parts/t1_will_crash#P#p2.MYI:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... not working
        
        (see mysql-test/suite/parts/t/partition_repair_myisam.test)
        copy of file right after _mi_mark_file_changed in mi_write
        was done.
      mysql-test/std_data/parts/t1_will_crash#P#p3.MYI:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... not working
        
        (see mysql-test/suite/parts/t/partition_repair_myisam.test)
        copy of file right after *share->write_record was done.
      mysql-test/std_data/parts/t1_will_crash#P#p4.MYI:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... not working
        
        (see mysql-test/suite/parts/t/partition_repair_myisam.test)
        copy of file right after flush_cached_blocks
      mysql-test/std_data/parts/t1_will_crash#P#p6.MYD:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... not working
        
        (see mysql-test/suite/parts/t/partition_repair_myisam.test)
        copy of file right after _mi_write_part_record in
        write_dynamic_record returned for the first time.
      mysql-test/std_data/parts/t1_will_crash#P#p6_2.MYD:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... not working
        
        (see mysql-test/suite/parts/t/partition_repair_myisam.test)
        copy of file right after _mi_write_part_record in
        write_dynamic_record returned for the second time.
      mysql-test/std_data/parts/t1_will_crash#P#p6_3.MYD:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... not working
        
        (see mysql-test/suite/parts/t/partition_repair_myisam.test)
        copy of file right after _mi_write_part_record in
        write_dynamic_record returned for the third time.
        (data file fully updated).
      mysql-test/suite/parts/r/partition_recover_myisam.result:
        Bug#35161
        
        Renamed since it was a test of recover
        and to make repair free for use without
        --myisam-recover
      mysql-test/suite/parts/r/partition_repair_myisam.result:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... not working
        
        New result file for testing CHECK/REPAIR of partitioned tables
      mysql-test/suite/parts/t/partition_recover_myisam-master.opt:
        Bug#35161
        
        Renamed since it was a test of recover
        and to make repair free for use without
        --myisam-recover
      mysql-test/suite/parts/t/partition_recover_myisam.test:
        Bug#35161
        
        Renamed since it was a test of recover
        and to make repair free for use without
        --myisam-recover
      mysql-test/suite/parts/t/partition_repair_myisam.test:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... not working
        
        New test file for testing CHECK/REPAIR of partitioned tables
      sql/ha_partition.cc:
        Bug#35161
        
        Fix of memory leak when open of partition failed.
      e1f74adb
  2. 15 Aug, 2008 3 commits
    • Sergey Glukhov's avatar
      Bug#36638 mysqld crashes when open file limit is passed and general query log enabled · 5aff1f3d
      Sergey Glukhov authored
      The problem:
      CSV storage engine open function returns success even
      thought it failed to open the data file
      The fix:
      return error
      Additional fixes:
      added MY_WME to my_open to avoid mysterious error message
      free share struct if open the file was unsuccessful
      
      
      mysql-test/r/csv.result:
        test result
      mysql-test/t/csv.test:
        test case
      storage/csv/ha_tina.cc:
        The problem:
        CSV storage engine open function returns success even
        thought it failed to open the data file
        The fix:
        return error
        Additional fixes:
        added MY_WME to my_open to avoid mysterious error message
        free share struct if open the file was unsuccessful
      5aff1f3d
    • Ramil Kalimullin's avatar
      Fix for bug#37537: myisamchk fails with Assertion failure with partitioned table · 2be2bf9e
      Ramil Kalimullin authored
      Problem: missed "break" in a switch leads to unexpected assertion failure
      of 'myisamchk compressed_table'.
      
      Fix: add the break.
      
      
      storage/myisam/mi_check.c:
        Fix for bug#37537: myisamchk fails with Assertion failure with partitioned table
        
        In the record links check function (chk_data_link()) 
        missed "break" for case COMPRESSED_RECORD was added.
      2be2bf9e
    • Ramil Kalimullin's avatar
      Fix for bug#37337: Function returns different results · 8010c601
      Ramil Kalimullin authored
      Problem: REGEXP in functions/PSs may return wrong results
      due to improper initialization.
      
      Fix: initialize required REGEXP params.
      
      
      sql/item_cmpfunc.cc:
        Fix for bug#37337: Function returns different results
        
        prev_regexp is used in the Item_func_regex::regcomp()
        to store previous regex and to avoid re-initialization 
        if given the same pattern.
        Shoud be deleted in the Item_func_regex::cleanup() where we
        clean up the regexp structure.
      8010c601
  3. 13 Aug, 2008 6 commits
  4. 12 Aug, 2008 10 commits
    • Marc Alff's avatar
      Merge mysql-5.1-bugteam -> local bugfix branch · 9922445c
      Marc Alff authored
      9922445c
    • Marc Alff's avatar
      Bug#38296 (low memory crash with many conditions in a query) · f60bbd90
      Marc Alff authored
      This fix is for 5.1 only : back porting the 6.0 patch manually
      
      The parser code in sql/sql_yacc.yy needs to be more robust to out of
      memory conditions, so that when parsing a query fails due to OOM,
      the thread gracefully returns an error.
      
      Before this fix, a new/alloc returning NULL could:
      - cause a crash, if dereferencing the NULL pointer,
      - produce a corrupted parsed tree, containing NULL nodes,
      - alter the semantic of a query, by silently dropping token values or nodes
      
      With this fix:
      - C++ constructors are *not* executed with a NULL "this" pointer
      when operator new fails.
      This is achieved by declaring "operator new" with a "throw ()" clause,
      so that a failed new gracefully returns NULL on OOM conditions.
      
      - calls to new/alloc are tested for a NULL result,
      
      - The thread diagnostic area is set to an error status when OOM occurs.
      This ensures that a request failing in the server properly returns an
      ER_OUT_OF_RESOURCES error to the client.
      
      - OOM conditions cause the parser to stop immediately (MYSQL_YYABORT).
      This prevents causing further crashes when using a partially built parsed
      tree in further rules in the parser.
      
      No test scripts are provided, since automating OOM failures is not
      instrumented in the server.
      Tested under the debugger, to verify that an error in alloc_root cause the
      thread to returns gracefully all the way to the client application, with
      an ER_OUT_OF_RESOURCES error.
      f60bbd90
    • Davi Arnaut's avatar
      Merge and fix tree name. · faa54a07
      Davi Arnaut authored
      faa54a07
    • Davi Arnaut's avatar
      Merge and fix tree name. · 9fda5e47
      Davi Arnaut authored
      9fda5e47
    • Davi Arnaut's avatar
      Merge mysql-5.0-bugteam into mysql-5.0 · 17544370
      Davi Arnaut authored
      17544370
    • Mattias Jonsson's avatar
      merge · 7f78acdc
      Mattias Jonsson authored
      7f78acdc
    • Davi Arnaut's avatar
      Merge mysql-5.1-bugteam into mysql-5.1 main. · e1127015
      Davi Arnaut authored
      e1127015
    • Mattias Jonsson's avatar
      manual merge of bug#37402 · 8d0d9e87
      Mattias Jonsson authored
      8d0d9e87
    • Mattias Jonsson's avatar
      Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that · 2ae9924a
      Mattias Jonsson authored
      partition is corrupt
      
      Updated result files after merge
      
      mysql-test/suite/parts/r/partition_alter1_1_2_innodb.result:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Updated result file after merge
      mysql-test/suite/parts/t/disabled.def:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Enabled two tests after fixing the bug.
      2ae9924a
    • Davi Arnaut's avatar
      a92cf7b6
  5. 11 Aug, 2008 16 commits
    • Davi Arnaut's avatar
      Bug#38486: Crash when using cursor protocol · 7d67dda7
      Davi Arnaut authored
      Post-merge fix: mysql_client_test.c is compiled by C compilers
      and some C compilers don't support mixed declarations and code
      and it's explicitly forbidden by ISO C90.
      
      tests/mysql_client_test.c:
        Don't mix declarations and code.
      7d67dda7
    • Marc Alff's avatar
      Manual merge of mysql-5.0-bugteam -> mysql-5.1-bugteam · 52fa3fdd
      Marc Alff authored
      Note: NULL merge of sql/sql_yacc.yy, the fix for bug#38296 will be provided separately for 5.1
      52fa3fdd
    • Marc Alff's avatar
      Merge mysql-5.0-bugteam -> local bugfix branch · 00f22e76
      Marc Alff authored
      00f22e76
    • Marc Alff's avatar
      Bug#37302 (missing DBUG_RETURN macro in function "find_key_block" (5.0 only)) · 1eec5ca1
      Marc Alff authored
      Fixed missing DBUG_RETURN in the function find_key_block
      1eec5ca1
    • Mattias Jonsson's avatar
      d01c1014
    • Mattias Jonsson's avatar
      Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that · 3faf4f76
      Mattias Jonsson authored
      partition is corrupt
      
      The main problem was that ALTER TABLE t ANALYZE/CHECK/OPTIMIZE/REPAIR
      PARTITION took another code path (over mysql_alter_table instead of
      mysql_admin_table) which differs in two ways:
      1) alter table opens the tables in a different way than admin tables do
         resulting in returning with error before it tried the command
      2) alter table does not start to send any diagnostic rows to the client
         which the lower admin functions continue to use -> resulting in
         assertion crash
      
      The fix:
      Remapped ALTER TABLE t ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION to use
      the same code path as ANALYZE/CHECK/OPTIMIZE/REPAIR TABLE t.
      Adding check in mysql_admin_table to setup the partition list for
      which partitions that should be used.
      
      
      Partitioned tables will still not work with
      REPAIR TABLE/PARTITION USE_FRM, since that requires moving partitions
      to tables, REPAIR TABLE t USE_FRM, and check that the data still
      fulfills the partitioning function and then move the table back to
      being a partition.
      
      NOTE: I have removed the following functions from the handler
      interface:
      analyze_partitions, check_partitions, optimize_partitions,
      repair_partitions
      Since they are not longer needed.
      THIS ALTERS THE STORAGE ENGINE API
      
      mysql-test/r/handler_innodb.result:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Added a note result row.
      mysql-test/r/innodb.result:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Added a note result row.
      mysql-test/r/innodb_mysql.result:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Added a note result row.
      mysql-test/r/partition.result:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Updated after fixing ANALYZE/CHECK/OPTIMIZE/REPAIR partitioned
        tables.
      mysql-test/r/trigger-trans.result:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Added a note result row.
      mysql-test/suite/ndb/r/ndb_partition_key.result:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Updated after fixing ANALYZE/CHECK/OPTIMIZE/REPAIR partitioned
        tables.
      mysql-test/suite/ndb/t/ndb_partition_key.test:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Updated after fixing ANALYZE/CHECK/OPTIMIZE/REPAIR partitioned
        tables.
      mysql-test/suite/parts/inc/partition_alter4.inc:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Updated after fixing ANALYZE/CHECK/OPTIMIZE/REPAIR partitioned
        tables.
      mysql-test/suite/parts/r/partition_alter4_innodb.result:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Updated after fixing ANALYZE/CHECK/OPTIMIZE/REPAIR partitioned
        tables.
      mysql-test/suite/parts/r/partition_alter4_myisam.result:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Updated after fixing ANALYZE/CHECK/OPTIMIZE/REPAIR partitioned
        tables.
      mysql-test/suite/rpl/r/rpl_failed_optimize.result:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Added a note result row.
      mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Added a note result row.
      mysql-test/t/partition.test:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Updated after fixing ANALYZE/CHECK/OPTIMIZE/REPAIR partitioned
        tables.
      sql/ha_partition.cc:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Added a function for returning admin commands result rows
        Updated handle_opt_partitions to handle admin commands result rows,
        and some error filtering (as mysql_admin_table do).
        
        Removed the functions analyze/check/optimize/repair_partitions
        since they have no longer any use.
      sql/ha_partition.h:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Removed analyze/check/optimize/repair_partitions since they
        are no longer are needed.
      sql/handler.cc:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Removed analyze/check/optimize/repair_partitions since they
        are no longer are needed.
      sql/handler.h:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Removed analyze/check/optimize/repair_partitions since they
        are no longer are needed.
      sql/mysql_priv.h:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Added set_part_state for reuse of code in mysql_admin_table.
        (Originally fond in sql/sql_partition.cc:prep_alter_part_table)
      sql/protocol.cc:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Added one assert and a debug print.
      sql/sql_partition.cc:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Refactored code for setting up partition state, set_part_state,
        now used in both prep_alter_part_table and
        sql_table.cc:mysql_admin_table.
        Removed code for handling ANALYZE/CHECK/OPTIMIZE/REPAIR partitions,
        since it is now handled by mysql_admin_table.
      sql/sql_table.cc:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Added functionality in mysql_admin_table to work with partitioned
        tables.
        Fixed a possible assertion bug for HA_ADMIN_TRY_ALTER
        (If analyze would output a row, it fails since the row was already
        started).
      sql/sql_yacc.yy:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Remapped ALTER TABLE t ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION
        to use the same code path as ANALYZE/CHECK/OPTIMIZE/REPAIR TABLE
        instead of taking the ALTER TABLE path.
        Added reset of alter_info for ANALYZE/CHECK/OPTIMIZE/REPAIR TABLE
        since it is now used by partitioned tables.
      storage/myisam/mi_check.c:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Changed warning message from "Found X parts  Should be: Y parts"
        to "Found X key parts. Should be Y", since it could be confusing
        with partitioned tables.
      3faf4f76
    • Chad MILLER's avatar
      Merge from bugteam 5.0 trunk. · ed644f3a
      Chad MILLER authored
      ed644f3a
    • Marc Alff's avatar
      Bug#38296 (low memory crash with many conditions in a query) · 5d265802
      Marc Alff authored
      This fix is for 5.0 only : back porting the 6.0 patch manually
      
      The parser code in sql/sql_yacc.yy needs to be more robust to out of
      memory conditions, so that when parsing a query fails due to OOM,
      the thread gracefully returns an error.
      
      Before this fix, a new/alloc returning NULL could:
      - cause a crash, if dereferencing the NULL pointer,
      - produce a corrupted parsed tree, containing NULL nodes,
      - alter the semantic of a query, by silently dropping token values or nodes
      
      With this fix:
      - C++ constructors are *not* executed with a NULL "this" pointer
      when operator new fails.
      This is achieved by declaring "operator new" with a "throw ()" clause,
      so that a failed new gracefully returns NULL on OOM conditions.
      
      - calls to new/alloc are tested for a NULL result,
      
      - The thread diagnostic area is set to an error status when OOM occurs.
      This ensures that a request failing in the server properly returns an
      ER_OUT_OF_RESOURCES error to the client.
      
      - OOM conditions cause the parser to stop immediately (MYSQL_YYABORT).
      This prevents causing further crashes when using a partially built parsed
      tree in further rules in the parser.
      
      No test scripts are provided, since automating OOM failures is not
      instrumented in the server.
      Tested under the debugger, to verify that an error in alloc_root cause the
      thread to returns gracefully all the way to the client application, with
      an ER_OUT_OF_RESOURCES error.
      5d265802
    • Chad MILLER's avatar
      null-merge of backported changes. · d8e44f24
      Chad MILLER authored
      d8e44f24
    • Chad MILLER's avatar
      c1cadb10
    • Mattias Jonsson's avatar
      merge into an updated 5.1-bugteam tree · 1c4b8a98
      Mattias Jonsson authored
      1c4b8a98
    • Davi Arnaut's avatar
      Post-merge fix: Remove Remove unused variable. · b65b1ca3
      Davi Arnaut authored
      client/mysql_upgrade.c:
        Remove Remove unused variable.
      b65b1ca3
    • Davi Arnaut's avatar
      Post-merge fix: Silence warning due to type mismatch. · abbb2d9a
      Davi Arnaut authored
      client/mysql_upgrade.c:
        Silence warning due to type mismatch.
      abbb2d9a
    • Kristofer Pettersson's avatar
      fc374600
    • Kristofer Pettersson's avatar
      Automerge · 55930a43
      Kristofer Pettersson authored
      55930a43
    • Kristofer Pettersson's avatar
      Bug#38486 Crash when using cursor protocol · 4bf720fc
      Kristofer Pettersson authored
                  
      Server side cursors were not initialized properly and this caused a reference to
      uninitialized memory.
      4bf720fc
  6. 07 Aug, 2008 4 commits