Skip to content
  • Mauritz Sundell's avatar
    f1db2703
    Bug#17400320 ALGORITHM= IS NOT SUPPORTED FOR ALTER TABLE WITH <PARTITION_OPTIONS> · f1db2703
    Mauritz Sundell authored
    MySQL Cluster no longer support the keywords ONLINE and OFFLINE used
    with ALTER TABLE statements.
    
    Instead ALGORITHM=INPLACE and ALGORITHM=COPY should be used.  But
    for some partitioning commands it was not possible to specify
    ALGORITHM without syntax error.
    
    The commands that one can not specify ALGORITHM for is the ones
    that can not be combined with other commands within an ALTER TABLE
    statement.  Such as:
    
    ALTER TABLE table DISCARD TABLESPACE
    ALTER TABLE table IMPORT TABLESPACE
    ALTER TABLE table ADD PARTITION ...
    ALTER TABLE table DROP PARTITION ...
    ALTER TABLE table REBUILD PARTITION ...
    ALTER TABLE table OPTIMIZE PARTITION ...
    ALTER TABLE table ANALYZE PARTITION ...
    ALTER TABLE table CHECK PARTITION ...
    ALTER TABLE table REPAIR PARTITION ...
    ALTER TABLE table COALESCE PARTITION ...
    ALTER TABLE table TRUNCATE PARTITION ...
    ALTER TABLE table REORGANIZE PARTITION ...
    ALTER TABLE table EXCHANGE PARTITION ...
    ALTER TABLE table DISCARD PARTITION ...
    ALTER TABLE table IMPORT PARTITION ...
    
    Solution:
    
    The commands ALGORITHM=?, LOCK=?, and, WITH/WITHOUT VALIDATION, are
    identified as commands modifying the whole ALTER TABLE with no
    independent effect if stated by themselves.
    
    Support for these modifying commands are added so that they also
    can be stated *before* any of the above commands.
    
    Examples,
    ALTER TABLE t ALGORITHM=INPLACE, REORGANIZE PARTITION;
    ALTER TABLE t LOCK=SHARED, ALGORITHM=INPLACE, OPTIMIZE PARTITION p;
    
    Note that one can still not add these modyfing commands after these
    "standalone" commands.
    
    Note that this patch only allows ALGORITHM, LOCK, VALIDATION, to
    be parsed in combination with the above commands.
    
    No changes are made to any storage engine to support different
    uses of these modifying commands.
    
    (cherry picked from commit 45cbda17b42576dd4bbea4df2fe8d4859679da04)
    f1db2703
    Bug#17400320 ALGORITHM= IS NOT SUPPORTED FOR ALTER TABLE WITH <PARTITION_OPTIONS>
    Mauritz Sundell authored
    MySQL Cluster no longer support the keywords ONLINE and OFFLINE used
    with ALTER TABLE statements.
    
    Instead ALGORITHM=INPLACE and ALGORITHM=COPY should be used.  But
    for some partitioning commands it was not possible to specify
    ALGORITHM without syntax error.
    
    The commands that one can not specify ALGORITHM for is the ones
    that can not be combined with other commands within an ALTER TABLE
    statement.  Such as:
    
    ALTER TABLE table DISCARD TABLESPACE
    ALTER TABLE table IMPORT TABLESPACE
    ALTER TABLE table ADD PARTITION ...
    ALTER TABLE table DROP PARTITION ...
    ALTER TABLE table REBUILD PARTITION ...
    ALTER TABLE table OPTIMIZE PARTITION ...
    ALTER TABLE table ANALYZE PARTITION ...
    ALTER TABLE table CHECK PARTITION ...
    ALTER TABLE table REPAIR PARTITION ...
    ALTER TABLE table COALESCE PARTITION ...
    ALTER TABLE table TRUNCATE PARTITION ...
    ALTER TABLE table REORGANIZE PARTITION ...
    ALTER TABLE table EXCHANGE PARTITION ...
    ALTER TABLE table DISCARD PARTITION ...
    ALTER TABLE table IMPORT PARTITION ...
    
    Solution:
    
    The commands ALGORITHM=?, LOCK=?, and, WITH/WITHOUT VALIDATION, are
    identified as commands modifying the whole ALTER TABLE with no
    independent effect if stated by themselves.
    
    Support for these modifying commands are added so that they also
    can be stated *before* any of the above commands.
    
    Examples,
    ALTER TABLE t ALGORITHM=INPLACE, REORGANIZE PARTITION;
    ALTER TABLE t LOCK=SHARED, ALGORITHM=INPLACE, OPTIMIZE PARTITION p;
    
    Note that one can still not add these modyfing commands after these
    "standalone" commands.
    
    Note that this patch only allows ALGORITHM, LOCK, VALIDATION, to
    be parsed in combination with the above commands.
    
    No changes are made to any storage engine to support different
    uses of these modifying commands.
    
    (cherry picked from commit 45cbda17b42576dd4bbea4df2fe8d4859679da04)
Loading