1. 12 Aug, 2008 4 commits
  2. 11 Aug, 2008 16 commits
    • Davi Arnaut's avatar
      Bug#38486: Crash when using cursor protocol · 1912eaac
      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.
      1912eaac
    • Marc Alff's avatar
      Manual merge of mysql-5.0-bugteam -> mysql-5.1-bugteam · 7f228cf2
      Marc Alff authored
      Note: NULL merge of sql/sql_yacc.yy, the fix for bug#38296 will be provided separately for 5.1
      7f228cf2
    • Marc Alff's avatar
      Merge mysql-5.0-bugteam -> local bugfix branch · 2f3b8603
      Marc Alff authored
      2f3b8603
    • Marc Alff's avatar
      Bug#37302 (missing DBUG_RETURN macro in function "find_key_block" (5.0 only)) · b4418b5c
      Marc Alff authored
      Fixed missing DBUG_RETURN in the function find_key_block
      b4418b5c
    • Mattias Jonsson's avatar
      1c06de1f
    • Mattias Jonsson's avatar
      Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that · f50c4207
      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.
      f50c4207
    • Chad MILLER's avatar
      Merge from bugteam 5.0 trunk. · 26ed51d0
      Chad MILLER authored
      26ed51d0
    • Marc Alff's avatar
      Bug#38296 (low memory crash with many conditions in a query) · e04dfffb
      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.
      e04dfffb
    • Chad MILLER's avatar
      null-merge of backported changes. · b0d5c8a1
      Chad MILLER authored
      b0d5c8a1
    • Chad MILLER's avatar
      b615e3d5
    • Mattias Jonsson's avatar
      merge into an updated 5.1-bugteam tree · 2ace7dc9
      Mattias Jonsson authored
      2ace7dc9
    • Davi Arnaut's avatar
      Post-merge fix: Remove Remove unused variable. · 1c108906
      Davi Arnaut authored
      client/mysql_upgrade.c:
        Remove Remove unused variable.
      1c108906
    • Davi Arnaut's avatar
      Post-merge fix: Silence warning due to type mismatch. · d622b04f
      Davi Arnaut authored
      client/mysql_upgrade.c:
        Silence warning due to type mismatch.
      d622b04f
    • Kristofer Pettersson's avatar
      2c01793a
    • Kristofer Pettersson's avatar
      Automerge · 861c06f0
      Kristofer Pettersson authored
      861c06f0
    • Kristofer Pettersson's avatar
      Bug#38486 Crash when using cursor protocol · 75a5ecbd
      Kristofer Pettersson authored
                  
      Server side cursors were not initialized properly and this caused a reference to
      uninitialized memory.
      75a5ecbd
  3. 07 Aug, 2008 4 commits
  4. 06 Aug, 2008 5 commits
  5. 04 Aug, 2008 1 commit
  6. 01 Aug, 2008 1 commit
    • Davi Arnaut's avatar
      Bug#37003: Tests sporadically crashes with embedded server · b757f485
      Davi Arnaut authored
      Post-merge fix: Alter linking order so that the thread linking
      flags appear last in the list. This needs to be done this way
      because some linkers will not search the thread archive again
      if a undefined symbol (pthread_kill in this case) appears later.
      
      client/Makefile.am:
        Link mysys before thread libs.
      b757f485
  7. 31 Jul, 2008 2 commits
  8. 30 Jul, 2008 1 commit
    • Georgi Kodinov's avatar
      Bug#37662 nested if() inside sum() is parsed in exponential time · ae4a35fd
      Georgi Kodinov authored
            
      min() and max() functions are implemented in MySQL as macros.
      This means that max(a,b) is expanded to: ((a) > (b) ? (a) : (b))
      Note how 'a' is quoted two times.
      Now imagine 'a' is a recursive function call that's several 10s of levels deep.
      And the recursive function does max() with a function arg as well to dive into
      recursion.
      This means that simple function call can take most of the clock time.
      Identified and fixed several such calls to max()/min() : including the IF() 
      sql function implementation.
      
      mysql-test/r/func_if.result:
        Bug#37662 test case
      mysql-test/t/func_if.test:
        Bug#37662 test case
      sql/item.cc:
        Bug#37662 don't call expensive functions as arguments to min/max
      sql/item_cmpfunc.cc:
        Bug#37662 don't call expensive functions as arguments to min/max
      sql/item_func.cc:
        Bug#37662 don't call expensive functions as arguments to min/max
      ae4a35fd
  9. 29 Jul, 2008 4 commits
  10. 28 Jul, 2008 1 commit
  11. 26 Jul, 2008 1 commit
    • Igor Babaev's avatar
      Fixed bug #38191. · b6e3a9e2
      Igor Babaev authored
      Calling List<Cached_item>::delete_elements for the same list twice
      caused a crash of the server in the function JOIN::cleaunup.
      Ensured that delete_elements() in JOIN::cleanup would be called only once.
      
      
      mysql-test/r/subselect.result:
        Added a test case for bug #38191.
      mysql-test/t/subselect.test:
        Added a test case for bug #38191.
      sql/sql_select.cc:
        Fixed bug #38191.
        Ensured that delete_elements() in JOIN::cleanup would be called only once.
      b6e3a9e2