An error occurred fetching the project authors.
  1. 22 Dec, 2010 2 commits
    • Mattias Jonsson's avatar
      Bug#54483: valgrind errors when making warnings for · 93dc62c3
      Mattias Jonsson authored
      multiline inserts into partition
      Bug#57071: EXTRACT(WEEK from date_col) cannot be
      allowed as partitioning function
      
      Renamed function according to reviewers comments.
      
      sql/item.h:
        better name of processor function
      sql/item_func.h:
        better name of processor function
      sql/item_timefunc.h:
        better name of processor function
      sql/sql_partition.cc:
        better name of processor function
        Updated comment.
      93dc62c3
    • Mattias Jonsson's avatar
      Bug#54483: valgrind errors when making warnings for multiline inserts into partition · 969e729a
      Mattias Jonsson authored
      Bug#57071: EXTRACT(WEEK from date_col) cannot be allowed as partitioning function
      
      There were functions allowed as partitioning functions
      that implicit allowed cast. That could result in unacceptable
      behaviour.
      
      Solution was to check that the arguments of date and time functions
      have allowed types (field and date/datetime/time depending on function).
      
      mysql-test/r/partition.result:
        Updated result
      mysql-test/r/partition_error.result:
        Updated result
      mysql-test/suite/parts/inc/part_supported_sql_funcs_main.inc:
        disabled test with not allowed arguments.
      mysql-test/suite/parts/r/part_supported_sql_func_innodb.result:
        Updated result
      mysql-test/suite/parts/r/part_supported_sql_func_myisam.result:
        Updated result
      mysql-test/t/partition.test:
        Fixed typo in bug number and removed non allowed function (bad argument)
      mysql-test/t/partition_error.test:
        Added tests to verify correct type of argument.
      sql/item.h:
        Renamed processor since it is no longer only for timezone
      sql/item_func.h:
        Added help functions for checking date/time/datetime arguments.
      sql/item_timefunc.h:
        Added processors for argument correctness
      sql/sql_partition.cc:
        renamed the processor for checking arguments.
      969e729a
  2. 10 Nov, 2010 1 commit
    • Davi Arnaut's avatar
      Bug#58057: 5.1 libmysql/libmysql.c unused variable/compile failure · fdee2de3
      Davi Arnaut authored
      Bug#57995: Compiler flag change build error on OSX 10.4: my_getncpus.c
      Bug#57996: Compiler flag change build error on OSX 10.5 : bind.c
      Bug#57994: Compiler flag change build error : my_redel.c
      Bug#57993: Compiler flag change build error on FreeBsd 7.0 : regexec.c
      Bug#57992: Compiler flag change build error on FreeBsd : mf_keycache.c
      Bug#57997: Compiler flag change build error on OSX 10.6: debug_sync.cc
      
      Fix assorted compiler generated warnings.
      
      cmd-line-utils/readline/bind.c:
        Bug#57996: Compiler flag change build error on OSX 10.5 : bind.c
        
        Initialize variable to work around a false positive warning.
      include/m_string.h:
        Bug#57994: Compiler flag change build error : my_redel.c
        
        The expansion of stpcpy (in glibc) causes warnings if the
        return value of strmov is not being used. Since stpcpy is
        a GNU extension and the expansion ends up using a built-in
        provided by GCC, use the compiler provided built-in directly
        when possible.
      include/my_compiler.h:
        Define a dummy MY_GNUC_PREREQ when not compiling with GCC.
      libmysql/libmysql.c:
        Bug#58057: 5.1 libmysql/libmysql.c unused variable/compile failure
        
        Variable might not be used in some cases. So, tag it as unused.
      mysys/mf_keycache.c:
        Bug#57992: Compiler flag change build error on FreeBsd : mf_keycache.c
        
        Use UNINIT_VAR to work around a false positive warning.
      mysys/my_getncpus.c:
        Bug#57995: Compiler flag change build error on OSX 10.4: my_getncpus.c
        
        Declare variable in the same block where it is used.
      regex/regexec.c:
        Bug#57993: Compiler flag change build error on FreeBsd 7.0 : regexec.c
        
        Work around a compiler bug which causes the cast to not be enforced.
      sql/debug_sync.cc:
        Bug#57997: Compiler flag change build error on OSX 10.6: debug_sync.cc
        
        Use UNINIT_VAR to work around a false positive warning.
      sql/handler.cc:
        Use UNINIT_VAR to work around a false positive warning.
      sql/slave.cc:
        Use UNINIT_VAR to work around a false positive warning.
      sql/sql_partition.cc:
        Use UNINIT_VAR to work around a false positive warning.
      storage/myisam/ft_nlq_search.c:
        Use UNINIT_VAR to work around a false positive warning.
      storage/myisam/mi_create.c:
        Use UNINIT_VAR to work around a false positive warning.
      storage/myisammrg/myrg_open.c:
        Use UNINIT_VAR to work around a false positive warning.
      tests/mysql_client_test.c:
        Change function to take a pointer to const, no need for a cast.
      fdee2de3
  3. 20 Oct, 2010 1 commit
    • Davi Arnaut's avatar
      Bug#45288: pb2 returns a lot of compilation warnings · 031c5d92
      Davi Arnaut authored
      Fix assorted warnings that are generated in optimized builds.
      Most of it is silencing variables that are set but unused.
      
      This patch also introduces the MY_ASSERT_UNREACHABLE macro
      which helps the compiler to deduce that a certain piece of
      code is unreachable.
      
      include/my_compiler.h:
        Use GCC's __builtin_unreachable if available. It allows
        GCC to deduce the unreachability of certain code paths,
        thus avoiding warnings that, for example, accused that a
        variable could be used without being initialized (due to
        unreachable code paths).
      031c5d92
  4. 05 Oct, 2010 1 commit
    • Mattias Jonsson's avatar
      Bug#55091: Server crashes on ADD PARTITION after a failed attempt · 2d07cb7d
      Mattias Jonsson authored
      In case of failure in ALTER ... PARTITION under LOCK TABLE
      the server could crash, due to it had modified the locked
      table object, which was not reverted in case of failure,
      resulting in a bad table definition used after the failed
      command.
      
      Solved by always closing the LOCKED TABLE, even in case
      of error.
      
      Note: this is a 5.1-only fix, bug#56172 fixed it in 5.5+
      
      mysql-test/r/partition_innodb_plugin.result:
        updated result
      mysql-test/t/disabled.def:
        Only disabled valgrind instead.
      mysql-test/t/partition_innodb_plugin.test:
        Added test
      sql/sql_partition.cc:
        close_thread_tables do not close LOCKED TABLEs
        and destroys the table object (including part_info),
        so to avoid it to be reused, always close the table
        regardless of any previous failure.
      2d07cb7d
  5. 29 Jul, 2010 1 commit
    • unknown's avatar
      BUG#49124 Security issue with /*!-versioned */ SQL statements on Slave · d7ad4352
      unknown authored
      /*![:version:] Query Code */, where [:version:] is a sequence of 5 
      digits representing the mysql server version(e.g /*!50200 ... */),
      is a special comment that the query in it can be executed on those 
      servers whose versions are larger than the version appearing in the 
      comment. It leads to a security issue when slave's version is larger 
      than master's. A malicious user can improve his privileges on slaves. 
      Because slave SQL thread is running with SUPER privileges, so it can
      execute queries that he/she does not have privileges on master.
      
      This bug is fixed with the logic below: 
      - To replace '!' with ' ' in the magic comments which are not applied on
        master. So they become common comments and will not be applied on slave.
      
      - Example:
        'INSERT INTO t1 VALUES (1) /*!10000, (2)*/ /*!99999 ,(3)*/
        will be binlogged as
        'INSERT INTO t1 VALUES (1) /*!10000, (2)*/ /* 99999 ,(3)*/
      
      mysql-test/suite/rpl/t/rpl_conditional_comments.test:
        Test the patch for this bug.
      sql/mysql_priv.h:
        Rename inBuf as rawBuf and remove the const limitation.
      sql/sql_lex.cc:
        To replace '!' with ' ' in the magic comments which are not applied on
        master.
      sql/sql_lex.h:
        Remove the const limitation on parameter buff, as it can be modified in the function since
        this patch.
        Add member function yyUnput for Lex_input_stream. It set a character back the query buff.
      sql/sql_parse.cc:
        Rename inBuf as rawBuf and remove the const limitation.
      sql/sql_partition.cc:
        Remove the const limitation on parameter part_buff, as it can be modified in the function since
        this patch.
      sql/sql_partition.h:
        Remove the const limitation on parameter part_buff, as it can be modified in the function since
        this patch.
      sql/table.h:
        Remove the const limitation on variable partition_info, as it can be modified since
        this patch.
      d7ad4352
  6. 21 May, 2010 1 commit
    • Alexey Kopytov's avatar
      Bug #42064: low memory crash when importing hex strings, in · cd9c0892
      Alexey Kopytov authored
                  Item_hex_string::Item_hex_string
      
      The status of memory allocation in the Lex_input_stream (called
      from the Parser_state constructor) was not checked which led to
      a parser crash in case of the out-of-memory error.
      
      The solution is to introduce new init() member function in
      Parser_state and Lex_input_stream so that status of memory
      allocation can be returned to the caller.
      
      mysql-test/r/error_simulation.result:
        Added a test case for bug #42064.
      mysql-test/t/error_simulation.test:
        Added a test case for bug #42064.
      mysys/my_alloc.c:
        Added error injection code for the regression test.
      mysys/my_malloc.c:
        Added error injection code for the regression test.
      mysys/safemalloc.c:
        Added error injection code for the regression test.
      sql/event_data_objects.cc:
        Use the new init() member function of Parser_state and check
        its return value to handle memory allocation failures.
      sql/mysqld.cc:
        Added error injection code for the regression test.
      sql/sp.cc:
        Use the new init() member function of Parser_state and check
        its return value to handle memory allocation failures.
      sql/sql_lex.cc:
        Moved memory allocation from constructor to the separate init()
        member function.
        Added error injection code for the regression test.
      sql/sql_lex.h:
        Moved memory allocation from constructor to the separate init()
        member function.
      sql/sql_parse.cc:
        Use the new init() member function of Parser_state and check
        its return value to handle memory allocation failures.
      sql/sql_partition.cc:
        Use the new init() member function of Parser_state and check
        its return value to handle memory allocation failures.
      sql/sql_prepare.cc:
        Use the new init() member function of Parser_state and check
        its return value to handle memory allocation failures.
      sql/sql_trigger.cc:
        Use the new init() member function of Parser_state and check
        its return value to handle memory allocation failures.
      sql/sql_view.cc:
        Use the new init() member function of Parser_state and check
        its return value to handle memory allocation failures..
      sql/thr_malloc.cc:
        Added error injection code for the regression test.
      cd9c0892
  7. 24 Mar, 2010 1 commit
  8. 17 Mar, 2010 1 commit
    • Mattias Jonsson's avatar
      Bug#50561: ALTER PARTITIONS does not have adequate lock, breaks with · 5a21306e
      Mattias Jonsson authored
      concurrent I_S query
      
      There were two problem:
      1) MYSQL_LOCK_IGNORE_FLUSH also ignored name locks
      2) there was a race between abort_and_upgrade_locks and
         alter_close_tables
         (i.e. remove_table_from_cache and
          close_data_files_and_morph_locks)
      
      Which allowed the table to be opened with MYSQL_LOCK_IGNORE_FLUSH flag
      resulting in renaming a partition that was already in use,
      which could cause the table to be unusable.
      
      Solution was to not allow IGNORE_FLUSH to skip waiting for
      a named locked table.
      
      And to not release the LOCK_open mutex between the
      calls to remove_table_from_cache and
      close_data_files_and_morph_locks by merging the functions
      abort_and_upgrade_locks and alter_close_tables.
      
      mysql-test/suite/parts/r/partition_debug_sync_innodb.result:
        Bug#50561: ALTER PARTITIONS does not have adequate lock, breaks with
        concurrent I_S query
        
        Added test result
      mysql-test/suite/parts/t/partition_debug_sync_innodb-master.opt:
        Bug#50561: ALTER PARTITIONS does not have adequate lock, breaks with
        concurrent I_S query
        
        Added test option
      mysql-test/suite/parts/t/partition_debug_sync_innodb.test:
        Bug#50561: ALTER PARTITIONS does not have adequate lock, breaks with
        concurrent I_S query
        
        Added test file
      sql/authors.h:
        Bug#50561: ALTER PARTITIONS does not have adequate lock, breaks with
        concurrent I_S query
        
        Time to be acknowledged :)
      sql/ha_partition.cc:
        Bug#50561: ALTER PARTITIONS does not have adequate lock, breaks with
        concurrent I_S query
        
        Added DEBUG_SYNC for deterministic testing
      sql/mysql_priv.h:
        Bug#50561: ALTER PARTITIONS does not have adequate lock, breaks with
        concurrent I_S query
        
        Renamed function since merging alter_close_tables into
        abort_and_upgrade_lock.
      sql/sql_base.cc:
        Bug#50561: ALTER PARTITIONS does not have adequate lock, breaks with
        concurrent I_S query
        
        Changed MYSQL_LOCK_IGNORE_FLUSH to not ignore name locks
        (open_placeholder).
        
        Merged alter_close_tables into abort_and_upgrade_locks
        (and added _and_close_table to the name)
        to not release LOCK_open between remove_table_from_cache
        and close_data_files_and_morph_locks.
        
        Added DEBUG_SYNC for deterministic testing.
      sql/sql_partition.cc:
        Bug#50561: ALTER PARTITIONS does not have adequate lock, breaks with
        concurrent I_S query
        
        Removed alter_close_tables, (merged it into
        abort_and_upgrad_lock) so that LOCK_open never is released
        between remove_table_from_cache and
        close_data_files_and_morph_locks.
      sql/sql_show.cc:
        Bug#50561: ALTER PARTITIONS does not have adequate lock, breaks with
        concurrent I_S query
        
        Added DEBUG_SYNC for deterministic testing
      5a21306e
  9. 10 Mar, 2010 1 commit
    • Mattias Jonsson's avatar
      Bug#51830: Incorrect partition pruning on range partition · 61136c1d
      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.
      61136c1d
  10. 04 Mar, 2010 1 commit
    • Mattias Jonsson's avatar
      Bug#50104: Partitioned table with just 1 partion works with fk · 270de0e0
      Mattias Jonsson authored
      There was no check for foreign keys when altering partitioned
      tables.
      
      Added check for FK when altering partitioned tables.
      
      mysql-test/r/partition_innodb.result:
        Bug#50104: Partitioned table with just 1 partion works with fk
        
        Updated test result
      mysql-test/t/partition_innodb.test:
        Bug#50104: Partitioned table with just 1 partion works with fk
        
        Added test for adding FK on partitioned tables (both 1 and 2
        partitions)
      sql/sql_partition.cc:
        Bug#50104: Partitioned table with just 1 partion works with fk
        
        Disabled adding foreign key when altering a partitioned table.
      270de0e0
  11. 24 Jan, 2010 1 commit
  12. 18 Jan, 2010 1 commit
    • Mattias Jonsson's avatar
      Bug#47343: InnoDB fails to clean-up after lock wait timeout on · b489ba04
      Mattias Jonsson authored
                 REORGANIZE PARTITION
      
      There were several problems which lead to this this,
      all related to bad error handling.
      
      1) There was several bugs preventing the ddl-log to be used for
         cleaning up created files on error.
      
      2) The error handling after the copy partition rows did not close
         and unlock the tables, resulting in deletion of partitions
         which were in use, which lead InnoDB to put the partition to
         drop in a background queue.
      
      sql/ha_partition.cc:
        Bug#47343: InnoDB fails to clean-up after lock wait timeout on
                   REORGANIZE PARTITION
        
        Better error handling, if partition has been created/opened/locked
        then make sure it is unlocked and closed before returning error.
        The delete of the newly created partition is handled by the ddl-log.
      sql/sql_parse.cc:
        Bug#47343: InnoDB fails to clean-up after lock wait timeout on
                   REORGANIZE PARTITION
        
        Fix a bug found when experimenting, thd could really be NULL here,
        as mentioned in the function header.
      sql/sql_partition.cc:
        Bug#47343: InnoDB fails to clean-up after lock wait timeout on
                   REORGANIZE PARTITION
        
        Used the correct .frm shadow name to put into the ddl-log.
        Really use the ddl-log to handle errors.
      sql/sql_table.cc:
        Bug#47343: InnoDB fails to clean-up after lock wait timeout on
                   REORGANIZE PARTITION
        
        Fixes of the ddl-log when used as error recovery (no crash).
        When executing an entry from memory (not read from disk)
        the name_len was not set correctly.
      b489ba04
  13. 22 Dec, 2009 1 commit
    • Mattias Jonsson's avatar
      Bug#49742: Partition Pruning not working correctly for RANGE · 53f1c4ff
      Mattias Jonsson authored
      Problem was when calculating the range of partitions for
      pruning.
      
      Solution was to get the calculation correct. I also simplified
      it a bit for easier understanding.
      
      mysql-test/r/partition_pruning.result:
        Bug#49742: Partition Pruning not working correctly for RANGE
        
        Added results.
      mysql-test/t/partition_pruning.test:
        Bug#49742: Partition Pruning not working correctly for RANGE
        
        Added tests to prevent regressions.
      sql/sql_partition.cc:
        Bug#49742: Partition Pruning not working correctly for RANGE
        
        Simplified calculation for partition id for ranges.
        Easier to get right and understand.
        
        Added comments.
      53f1c4ff
  14. 13 Dec, 2009 1 commit
    • Alexey Kopytov's avatar
      Bug #42849: innodb crash with varying time_zone on partitioned · 85ae5897
      Alexey Kopytov authored
                  timestamp primary key 
       
      Since TIMESTAMP values are adjusted by the current time zone  
      settings in both numeric and string contexts, using any 
      expressions involving TIMESTAMP values as a  
      (sub)partitioning function leads to undeterministic behavior of  
      partitioned tables. The effect may vary depending on a storage  
      engine, it can be either incorrect data being retrieved or  
      stored, or an assertion failure. The root cause of this is the  
      fact that the calculated partition ID may differ from a  
      previously calculated ID for the same data due to timezone  
      adjustments of the partitioning expression value. 
       
      Fixed by disabling any expressions involving TIMESTAMP values  
      to be used in partitioning functions with the follwing two 
      exceptions: 
       
      1. Creating or altering into a partitioned table that violates 
      the above rule is not allowed, but opening existing such tables 
      results in a warning rather than an error so that such tables 
      could be fixed. 
       
      2. UNIX_TIMESTAMP() is the only way to get a 
      timezone-independent value from a TIMESTAMP column, because it 
      returns the internal representation (a time_t value) of a 
      TIMESTAMP argument verbatim. So UNIX_TIMESTAMP(timestamp_column)
      is allowed and should be used to fix existing tables if one 
      wants to use TIMESTAMP columns with partitioning.
      
      mysql-test/r/partition_bug18198.result:
        Corrected the error.
      mysql-test/r/partition_error.result:
        Corrected error texts.
        Added test cases for bug #42849.
      mysql-test/t/partition_bug18198.test:
        Corrected error code.
      mysql-test/t/partition_error.test:
        Corrected error codes.
        Added test cases for bug #42849.
      sql/item.h:
        Added is_timezone_dependent_processor() to Item.
      sql/item_func.h:
        Added has_timestamp_args() and the implementation of
        is_timezone_dependent_processor() for Item_func.
      sql/item_timefunc.h:
        Added is_timezone_dependent_processor() to 
        Item_func_unix_timestamp.
      sql/share/errmsg.txt:
        Renamed ER_CONST_EXPR_IN_PARTITION_FUNC_ERROR to
        ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR to better reflect the
        meaning. Adjusted the error message.
      sql/sql_partition.cc:
        Modified fix_fields_part_func() to walk through partitioning
        expression tree with is_timezone_dependent_processor() and issue
        a warning/error if it depends on the timezone settings.
        
        Changed fix_fields_part_func() to a static function since it is
        not used anywhere except sql_partition.cc
      sql/sql_partition.h:
        Removed the unneeded declaration of fix_fields_part_func()
        since it is now a static function.
      sql/sql_yacc.yy:
        ER_CONST_EXPR_IN_PARTITION_FUNC_ERROR ->
        ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR.
      85ae5897
  15. 17 Nov, 2009 1 commit
    • Mattias Jonsson's avatar
      backport of bug#45904 from mysql-pe to 5.1 · 2cd5f29f
      Mattias Jonsson authored
      sql/sql_partition.cc:
        Bug#45904 Used list_of_part_fields instead of list_of_subpart_fields to discover if KEY subpartitioning => caused failure when charset=utf8 even for subpartitioning by key, would also allow for subpartitioning by hash with utf8 erroneously
      2cd5f29f
  16. 09 Nov, 2009 1 commit
    • Mattias Jonsson's avatar
      Bug#48276: can't add column if subpartition exists · 8ce403c8
      Mattias Jonsson authored
      Bug when setting up default partitioning,
      used an uninitialized variabe.
      
      mysql-test/r/partition.result:
        Bug#48276: can't add column if subpartition exists
        
        Added result
      mysql-test/t/partition.test:
        Bug#48276: can't add column if subpartition exists
        
        Added test
      sql/sql_partition.cc:
        Bug#48276: can't add column if subpartition exists
        
        even if is_create_table_ind was set, one tried to set no_subparts
        with the unitialized no_parts local variable.
        
        Fixed by rearrange the code to be to only execute
        the statements when is_create_table_ind was not set.
      8ce403c8
  17. 03 Nov, 2009 1 commit
    • Mattias Jonsson's avatar
      Bug#46923: select count(*) from partitioned table fails with · c75026dd
      Mattias Jonsson authored
      ONLY_FULL_GROUP_BY
      
      Problem was that during checking and preparation of the
      partitioining function as a side effect in fix_fields
      the full_group_by_flag was changed.
      
      Solution was to set it back to its original value after
      calling fix_fields.
      
      Updated patch, to also exclude allow_sum_func from being
      affected of fix_fields, as requested by reviewer.
      
      mysql-test/r/partition.result:
        Bug#46923: select count(*) from partitioned table fails with
        ONLY_FULL_GROUP_BY
        
        Updated result file
      mysql-test/t/partition.test:
        Bug#46923: select count(*) from partitioned table fails with
        ONLY_FULL_GROUP_BY
        
        Extended test case to cover this bug
      sql/sql_partition.cc:
        Bug#46923: select count(*) from partitioned table fails with
        ONLY_FULL_GROUP_BY
        
        Resetting full_group_by_flag and allow_sum_func
        back to their original values,
        not conflicting with the sql_mode 'ONLY_FULL_GROUP_BY'
      c75026dd
  18. 16 Oct, 2009 1 commit
    • Georgi Kodinov's avatar
      Bug #40877: multi statement execution fails in 5.1.30 · 9c6668d6
      Georgi Kodinov authored
            
      Implemented the server infrastructure for the fix:
      
      1. Added a function LEX_STRING *thd_query_string(THD) to return
      a LEX_STRING structure instead of char *.
      This is the function that must be called in innodb instead of 
      thd_query()
      
      2. Did some encapsulation in THD : aggregated thd_query and 
      thd_query_length into a LEX_STRING and made accessor and mutator 
      methods for easy code updating. 
      
      3. Updated the server code to use the new methods where applicable.
      9c6668d6
  19. 23 Sep, 2009 1 commit
  20. 02 Sep, 2009 1 commit
  21. 26 Aug, 2009 1 commit
    • Mattias Jonsson's avatar
      Bug#20577: Partitions: use of to_days() function leads to selection failures · 591141d9
      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).
      
      mysql-test/include/partition_date_range.inc:
        Bug#20577: Partitions: use of to_days() function leads to selection failures
        
        Added include file to decrease test code duplication
      mysql-test/r/partition_pruning.result:
        Bug#20577: Partitions: use of to_days() function leads to selection failures
        
        Added test results
      mysql-test/r/partition_range.result:
        Bug#20577: Partitions: use of to_days() function leads to selection failures
        
        Updated test result.
        This fix adds the partition containing NULL values to
        the list of partitions to be scanned.
      mysql-test/t/partition_pruning.test:
        Bug#20577: Partitions: use of to_days() function leads to selection failures
        
        Added test case
      sql/item.h:
        Bug#20577: Partitions: use of to_days() function leads to selection failures
        
        Added MONOTONIC_*INCREASE_NOT_NULL values to be used by TO_DAYS.
      sql/item_timefunc.cc:
        Bug#20577: Partitions: use of to_days() function leads to selection failures
        
        Calculate the number of days as return value even for invalid dates.
        This is so that pruning can be used even for invalid dates.
      sql/opt_range.cc:
        Bug#20577: Partitions: use of to_days() function leads to selection failures
        
        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).
      sql/partition_info.h:
        Bug#20577: Partitions: use of to_days() function leads to selection failures
        
        Resetting ret_null_part when a single partition is to be used, this
        to avoid adding the NULL partition.
      sql/sql_partition.cc:
        Bug#20577: Partitions: use of to_days() function leads to selection failures
        
        Always include the NULL partition if RANGE or LIST.
        Use the returned value for the function for pruning, even if
        it is marked as NULL, so that even '2000-00-00' can be
        used for pruning, even if TO_DAYS('2000-00-00') is NULL.
        
        Changed == to >= in get_next_partition_id_list to avoid
        crash if part_iter->part_nums is not correctly setup.
      591141d9
  22. 06 Aug, 2009 1 commit
    • Mattias Jonsson's avatar
      Bug#46478: timestamp field incorrectly defaulted · 060590dc
      Mattias Jonsson authored
      when partition is reoganized.
      
      Problem was that table->timestamp_field_type was not changed
      before copying rows between partitions.
      
      fixed by setting it to TIMESTAMP_NO_AUTO_SET as the first thing
      in fast_alter_partition_table, so that all if-branches is covered.
      060590dc
  23. 31 Jul, 2009 1 commit
    • Tatiana A. Nurnberg's avatar
      Bug#40281, partitioning the general log table crashes the server · bba587cd
      Tatiana A. Nurnberg authored
      We disallow the partitioning of a log table. You could however
      partition a table first, and then point logging to it. This is
      not only against the docs, it also crashes the server.
      
      We catch this case now.
      
      mysql-test/r/partition.result:
        results for 40281
      mysql-test/t/partition.test:
        test for 40281: show that trying to log to partitioned table fails rather
        to crash the server
      sql/ha_partition.cc:
        Signal that we no longer support logging to partitioned tables,
        as per the docs.
      sql/sql_partition.cc:
        Some commands like "USE ..." have no select, yet we may try
        to parse partition info after their execution if user set a
        partitioned table as log target. This shouldn't lead to a
        NULL-deref/crash.
      bba587cd
  24. 08 Jul, 2009 1 commit
  25. 02 Jul, 2009 1 commit
    • Georgi Kodinov's avatar
      Bug #45807: crash accessing partitioned table and sql_mode · b46f5097
      Georgi Kodinov authored
      contains ONLY_FULL_GROUP_BY
      
      The partitioning code needs to issue a Item::fix_fields()
      on the partitioning expression in order to prepare 
      it for being evaluated.
      It does this by creating a special table and a table list 
      for the scope of the partitioning expression.
      But when checking ONLY_FULL_GROUP_BY the 
      Item_field::fix_fields() was relying that there always be
      cached_table set and was trying to use it to get the 
      select_lex of the SELECT the field's table is in.
      But the cached_table was not set by the partitioning code
      that creates the artificial TABLE_LIST used to resolve the
      partitioning expression and this resulted in a crash.
       
      Fixed by rectifying the following errors :
      1. Item_field::fix_fields() : the code that check for 
      ONLY_FULL_GROUP_BY relies on having tables with 
      cacheable_table set. This is mostly true, the only 
      two exceptions being the partitioning context table
      and the trigger context table.
      Fixed by taking the current parsing context if no pointer
      to the TABLE_LIST instance is present in the cached_table.
      
      2. fix_fields_part_func() : 
      
      2a. The code that adds the table being created to the 
      scope for the partitioning expression is mostly a copy 
      of the add_table_to_list and friends with one exception :
      it was not marking the table as cacheable (something that
      normal add_table_to_list is doing). This caused the 
      problem in the check for ONLY_FULL_GROUP_BY in 
      Item_field::fix_fields() to appear.
      Fixed by setting the correct members to make the table
      cacheable.
      The ideal structural fix for this is to use a unified 
      interface for adding a table to a table list 
      (add_table_to_list?) : noted in a TODO comment
      
      2b. The Item::fix_fields() was called with a NULL destination
      pointer. This causes uninitalized memory reads in the 
      overloaded ::fix_fields() function (namely 
      Item_field::fix_fields()) as it expects a non-zero pointer 
      there. Fixed by passing the source pointer similarly to how 
      it's done in JOIN::prepare().
      
      mysql-test/r/partition.result:
        Bug #45807: test case
      mysql-test/t/partition.test:
        Bug #45807: test case
      sql/item.cc:
        Bug #45807: fix the ONLY_FULL_GROUP_BY check code to 
        handle correctly non-cacheable tables.
      sql/sql_partition.cc:
        Bug #45807: fix the Item::fix_fields() context
        initializatio for the partitioning expression in 
        CREATE TABLE.
      b46f5097
  26. 19 Jun, 2009 1 commit
    • Sergey Glukhov's avatar
      Bug#44834 strxnmov is expected to behave as you'd expect · 524191be
      Sergey Glukhov authored
      The problem: described in the bug report.
      The fix:
      --increase buffers where it's necessary
        (buffers which are used in stxnmov)
      --decrease buffer lengths which are used
      
      
      client/mysql.cc:
        --increase buffers where it's necessary
          (buffers which are used in stxnmov)
        --decrease buffer lengths which are used
          as argument for strxnmov function
      sql/ha_ndbcluster.cc:
        --increase buffers where it's necessary
          (buffers which are used in stxnmov)
        --decrease buffer lengths which are used
          as argument for strxnmov function
      sql/ha_ndbcluster_binlog.cc:
        --increase buffers where it's necessary
          (buffers which are used in stxnmov)
        --decrease buffer lengths which are used
          as argument for strxnmov function
      sql/handler.cc:
        --increase buffers where it's necessary
          (buffers which are used in stxnmov)
        --decrease buffer lengths which are used
          as argument for strxnmov function
      sql/log.cc:
        --increase buffers where it's necessary
          (buffers which are used in stxnmov)
        --decrease buffer lengths which are used
          as argument for strxnmov function
      sql/mysqld.cc:
        removed unnecessary line
      sql/parse_file.cc:
        --increase buffers where it's necessary
          (buffers which are used in stxnmov)
        --decrease buffer lengths which are used
          as argument for strxnmov function
      sql/sql_acl.cc:
        --increase buffers where it's necessary
          (buffers which are used in stxnmov)
        --decrease buffer lengths which are used
          as argument for strxnmov function
      sql/sql_base.cc:
        --increase buffers where it's necessary
          (buffers which are used in stxnmov)
        --decrease buffer lengths which are used
          as argument for strxnmov function
      sql/sql_db.cc:
        --increase buffers where it's necessary
          (buffers which are used in stxnmov)
        --decrease buffer lengths which are used
          as argument for strxnmov function
      sql/sql_delete.cc:
        --increase buffers where it's necessary
          (buffers which are used in stxnmov)
        --decrease buffer lengths which are used
          as argument for strxnmov function
      sql/sql_partition.cc:
        --increase buffers where it's necessary
          (buffers which are used in stxnmov)
        --decrease buffer lengths which are used
          as argument for strxnmov function
      sql/sql_rename.cc:
        --increase buffers where it's necessary
          (buffers which are used in stxnmov)
        --decrease buffer lengths which are used
          as argument for strxnmov function
      sql/sql_show.cc:
        --increase buffers where it's necessary
          (buffers which are used in stxnmov)
        --decrease buffer lengths which are used
          as argument for strxnmov function
      sql/sql_table.cc:
        --increase buffers where it's necessary
          (buffers which are used in stxnmov)
        --decrease buffer lengths which are used
          as argument for strxnmov function
      sql/sql_view.cc:
        --increase buffers where it's necessary
          (buffers which are used in stxnmov)
        --decrease buffer lengths which are used
          as argument for strxnmov function
      524191be
  27. 01 Apr, 2009 1 commit
    • Ramil Kalimullin's avatar
      Fix for bug#42944: partition not pruned correctly · 9384b951
      Ramil Kalimullin authored
      Problem: we don't prune a LESS THAN partition if MAXVALUE is given and
      given value is equal to a LESS THAN value.
      
      Fix: prune partitions in such cases.
      
      
      mysql-test/r/partition.result:
        Fix for bug#42944: partition not pruned correctly
          - test result.
      mysql-test/t/partition.test:
        Fix for bug#42944: partition not pruned correctly
          - test case.
      sql/sql_partition.cc:
        Fix for bug#42944: partition not pruned correctly
          - prune partition if given value is equal to a LESS THAN value
            and it's not a "PARTITION ... LESS THAN MAXVALUE" one.
      9384b951
  28. 09 Jan, 2009 1 commit
  29. 28 Dec, 2008 1 commit
    • Mattias Jonsson's avatar
      Bug#40972: some sql execution lead the whole databse crashing · e1577230
      Mattias Jonsson authored
      Problem was an errornous date that lead to end partition
      was before the start, leading to a crash.
      
      Solution was to check greater or equal instead of only
      equal between start and end partition.
      
      NOTE: partitioning pruning handles incorrect dates
      differently than index lookup, which can give different
      results in a partitioned table versus a non partitioned
      table for queries having 'bad' dates in the where clause.
      
      mysql-test/r/partition_pruning.result:
        Bug#40972: some sql execution lead the whole databse crashing
        
        Updated result file
      mysql-test/t/partition_pruning.test:
        Bug#40972: some sql execution lead the whole databse crashing
        
        Added test.
      sql/sql_partition.cc:
        Bug#40972: some sql execution lead the whole databse crashing
        
        There can be cases where the start/cur partition is greater
        than the end partition, so it must not continue, since that
        can lead to a crash.
      e1577230
  30. 02 Dec, 2008 1 commit
    • Mattias Jonsson's avatar
      Bug#40389: REORGANIZE PARTITION crashes when only using one partition · 7207e5fc
      Mattias Jonsson authored
      The non documented command 'ALTER PARTITION t REORGANIZE PARTITION'
      (without any partitions!) which only make sense for nativly
      partitioned engines, such as NDB, crashes the server if there was
      no change of number of partitions.
      
      The problem was wrong usage of fast_end_partition function,
      which led to usage of a non initialized variable.
      
      mysql-test/r/partition_mgm.result:
        Bug#40389: REORGANIZE PARTITION crashes when only using one partition
        
        Updated test result.
      mysql-test/t/partition_mgm.test:
        Bug#40389: REORGANIZE PARTITION crashes when only using one partition
        
        Added new test case.
      sql/partition_info.cc:
        Bug#40389: REORGANIZE PARTITION crashes when only using one partition
        
        Added DBUG_ASSERT to easier catch similar problems.
      sql/sql_partition.cc:
        Bug#40389: REORGANIZE PARTITION crashes when only using one partition
        
        fast_end_partitions is called later in mysql_alter_table if
        variable fast_alter_partition is set.
      7207e5fc
  31. 12 Nov, 2008 1 commit
    • Mattias Jonsson's avatar
      Bug#38784: Mysql server crash if table is altered with partition changes. · d9b7163a
      Mattias Jonsson authored
      Occurred with EXTRA_DEBUG on windows.
      
      Problem was insufficient length of a local variable that stored path names.
      
      Solution was to use the correct length.
      
      CMakeLists.txt:
        Bug#38784: Mysql server crash if table is altered with partition changes.
        
        Added support for EXTRA_DEBUG
      sql/sql_partition.cc:
        Bug#38784: Mysql server crash if table is altered with partition changes.
        
        Changed from FN_LEN to FN_REFLEN since the variable was use for paths,
        not filenames without path.
      win/configure.js:
        Bug#38784: Mysql server crash if table is altered with partition changes.
        
        Added support for EXTRA_DEBUG
      d9b7163a
  32. 10 Nov, 2008 1 commit
  33. 04 Nov, 2008 1 commit
    • Mattias Jonsson's avatar
      Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output · 904c87f2
      Mattias Jonsson authored
      The partitioning clause is only a very long single line, which is very
      hard to interpret for a human. This patch breaks the partitioning
      syntax into one line for the partitioning type, and one line per
      partition/subpartition.
      
      mysql-test/r/information_schema_part.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/r/partition.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/r/partition_archive.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/r/partition_datatype.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/r/partition_innodb.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/r/partition_mgm.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/r/partition_mgm_err.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/r/partition_not_windows.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/r/partition_range.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/r/partition_symlink.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/ndb/r/ndb_partition_key.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/ndb/r/ndb_partition_range.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/ndb_team/r/ndb_dd_backuprestore.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/inc/partition_directory.inc:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Changed partitioning clause format for verifying the new output format.
      mysql-test/suite/parts/r/ndb_dd_backuprestore.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/part_supported_sql_func_innodb.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/part_supported_sql_func_myisam.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/part_supported_sql_func_ndb.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_alter1_1_2_innodb.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_alter1_1_2_myisam.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_alter1_1_innodb.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_alter1_1_myisam.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_alter1_2_innodb.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_alter1_2_myisam.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_alter2_1_innodb.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_alter2_1_myisam.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_alter2_2_innodb.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_alter2_2_myisam.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_alter3_innodb.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_alter3_myisam.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_alter4_innodb.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_alter4_myisam.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_auto_increment_archive.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_auto_increment_blackhole.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_auto_increment_innodb.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_auto_increment_memory.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_auto_increment_myisam.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_auto_increment_ndb.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_basic_innodb.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_basic_myisam.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_basic_symlink_innodb.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_basic_symlink_myisam.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_bit_innodb.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_bit_myisam.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_bit_ndb.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_char_innodb.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_char_myisam.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_datetime_innodb.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_datetime_myisam.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_decimal_innodb.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_decimal_myisam.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_engine_innodb.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_engine_myisam.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_engine_ndb.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_float_innodb.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_float_myisam.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_int_innodb.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_int_myisam.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_int_ndb.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_mgm_lc0_archive.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_mgm_lc0_innodb.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_mgm_lc0_memory.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_mgm_lc0_myisam.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_mgm_lc0_ndb.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_mgm_lc1_archive.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_mgm_lc1_innodb.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_mgm_lc1_memory.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_mgm_lc1_myisam.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_mgm_lc1_ndb.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_mgm_lc2_archive.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_mgm_lc2_innodb.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_mgm_lc2_memory.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_mgm_lc2_myisam.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_mgm_lc2_ndb.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_special_innodb.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_special_myisam.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_syntax_innodb.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/partition_syntax_myisam.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/parts/r/rpl_partition.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/rpl/r/rpl_extraCol_innodb.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/rpl/r/rpl_extraCol_myisam.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/rpl/r/rpl_innodb_bug28430.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/rpl/r/rpl_row_basic_8partition.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/rpl_ndb/r/rpl_ndb_2innodb.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/rpl_ndb/r/rpl_ndb_2myisam.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_partitions.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Updated test result due to the new partitioning clause output format.
      mysql-test/t/partition.test:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Added small tests for for the new partitioning clause output format.
      mysql-test/t/partition_mgm.test:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Added small tests for for the new partitioning clause output format.
      sql/sql_partition.cc:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Changed formatting of the partitioning clause from single line into
        multiple indented lines
      sql/sql_show.cc:
        Bug#14326: No formatting of partitioning clause in SHOW CREATE TABLE output
        
        Changed formatting of the partitioning clause from single line into
        multiple indented lines
      904c87f2
  34. 10 Oct, 2008 1 commit
    • Mattias Jonsson's avatar
      Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work · 5063431c
      Mattias Jonsson authored
      on non-partitioned table
      
      Problem was that partitioning specific commands was accepted
      for non partitioned tables and treated like
      ANALYZE/CHECK/OPTIMIZE/REPAIR TABLE, after bug-20129 was fixed,
      which changed the code path from mysql_alter_table to
      mysql_admin_table.
      
      Solution was to check if the table was partitioned before
      trying to execute the admin command
      
      mysql-test/r/partition_mgm_err.result:
        Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
        on non-partitioned table
        
        Updated test result
      mysql-test/t/partition_mgm_err.test:
        Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
        on non-partitioned table
        
        Updated test case
      sql/ha_partition.cc:
        Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
        on non-partitioned table
        
        Simplified the code by using ALTER_ADMIN_PARTITION for all
        commands that go through mysql_admin_tables and is set
        for partitioning specific commands that.
      sql/ha_partition.h:
        Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
        on non-partitioned table
        
        Simplified the code by using ALTER_ADMIN_PARTITION for all
        commands that go through mysql_admin_tables and is set
        for partitioning specific commands that.
      sql/sql_lex.h:
        Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
        on non-partitioned table
        
        Simplified the code by using ALTER_ADMIN_PARTITION for all
        commands that go through mysql_admin_tables and is set
        for partitioning specific commands that.
        
        Removed ALTER_ANALYZE/CHECK/OPTIMIZE/REPAIR_PARTITION and
        added ALTER_ADMIN_PARTITION instead.
      sql/sql_partition.cc:
        Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
        on non-partitioned table
        
        Simplified the code by using ALTER_ADMIN_PARTITION for all
        commands that go through mysql_admin_tables and is set
        for partitioning specific commands that.
        
        Removed ALTER_ANALYZE/CHECK/OPTIMIZE/REPAIR_PARTITION and
        added ALTER_ADMIN_PARTITION instead.
      sql/sql_table.cc:
        Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
        on non-partitioned table
        
        Give error and return if trying partitioning admin command
        on non partitioned table.
        
        Simplified the code by using ALTER_ADMIN_PARTITION for all
        commands that go through mysql_admin_tables and is set
        for partitioning specific commands that.
        
        Removed ALTER_ANALYZE/CHECK/OPTIMIZE/REPAIR_PARTITION and
        added ALTER_ADMIN_PARTITION instead.
      sql/sql_yacc.yy:
        Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
        on non-partitioned table
        
        Simplified the code by using ALTER_ADMIN_PARTITION for all
        commands that go through mysql_admin_tables and is set
        for partitioning specific commands that.
        
        Removed ALTER_ANALYZE/CHECK/OPTIMIZE/REPAIR_PARTITION and
        added ALTER_ADMIN_PARTITION instead.
      5063431c
  35. 06 Oct, 2008 3 commits
    • Alexey Botchkov's avatar
      keep compiler happy · 7eb35a81
      Alexey Botchkov authored
      7eb35a81
    • Alexey Botchkov's avatar
    • Alexey Botchkov's avatar
      Bug#38083 Error-causing row inserted into partitioned table despite error · afcc4e58
      Alexey Botchkov authored
            
          problems are located in the sql_partition.cc where functions calculation
          partition_id don't expect error returned from item->val_int().
          Fixed by adding checks to these functions.
          Note  - it tries to fix more problems than just the reported bug.
            
      per-file comments:
      modified:
        mysql-test/r/partition.result
          Bug#38083 Error-causing row inserted into partitioned table despite error
              test result
        mysql-test/t/partition.test
          Bug#38083 Error-causing row inserted into partitioned table despite error
              test case
        sql/opt_range.cc
          Bug#38083 Error-causing row inserted into partitioned table despite error
              get_part_id() call fixed
        sql/partition_info.h
          Bug#38083 Error-causing row inserted into partitioned table despite error
              get_subpart_id_func interface changed. 
        sql/sql_partition.cc
          Bug#38083 Error-causing row inserted into partitioned table despite error
              various functions calculationg partition_id and subpart_id didn't expect
                  an error returned from item->val_int().  Error checks added.
      afcc4e58
  36. 04 Oct, 2008 1 commit
    • Mattias Jonsson's avatar
      Bug#37453: Dropping/creating index on partitioned table with · 4e7eba56
      Mattias Jonsson authored
      InnoDB Plugin locks table
      
      The fast/on-line add/drop index handler calls was not implemented
      whithin the partitioning.
      
      This implements it in the partitioning handler.
      
      Since this is only used by the not included InnoDB plugin, there
      is no test case. (Have tested it manually with the plugin, and
      it does not allow unique indexes not including partitioning
      function, or removal of pk, which in innodb generates a new pk,
      which is not in the partitioning function.)
      
      NOTE: This introduces a new handler method, and because of that
      changes the storage engine api. (One cannot use a handlerton to
      see the capabilities of a table's handler if it is partitioned.
      So I added a wrapper function in the handler that defaults to
      the handlerton function, which the partitioning handler overrides.
      
      sql/ha_partition.cc:
        Bug#37453: Dropping/creating index on partitioned table with
        InnoDB Plugin locks table
        
        Added support for fast/on-line add/drop index.
        Implemented alter_table_flags as bit-or of the partitioned
        hton and the first partitions alter_table_flags.
        
        It is only to forward the calls for the other functions:
        check_if_incompatible_data
        add_index
        prepare_drop_index
        final_drop_index
        
        to all parts handler
      sql/ha_partition.h:
        Bug#37453: Dropping/creating index on partitioned table with
        InnoDB Plugin locks table
        
        Added support for fast/on-line add/drop index.
      sql/handler.h:
        Bug#37453: Dropping/creating index on partitioned table with
        InnoDB Plugin locks table
        
        Added the function on handler level, defaulting to use
        the handlerton function, but a handler can override it.
        Needed for partitioned tables.
        
        NOTE: Change of storage engine api.
      sql/sql_partition.cc:
        Bug#37453: Dropping/creating index on partitioned table with
        InnoDB Plugin locks table
        
        Using the new handler function, instead of the handlerton
        function. This works better with the partitioning handler.
      sql/sql_table.cc:
        Bug#37453: Dropping/creating index on partitioned table with
        InnoDB Plugin locks table
        
        Using the new handler function, instead of the handlerton
        function. This works better with the partitioning handler.
        Also using new process info for 'manage keys' (kind of fix
        for bug-37550).
      4e7eba56
  37. 11 Aug, 2008 1 commit
    • 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