• Mattias Jonsson's avatar
    Bug#51830: Incorrect partition pruning on range partition · 29b39e7a
    Mattias Jonsson authored
    (regression)
    
    Problem was that partition pruning did not exclude the
    last partition if the range was beyond it
    (i.e. not using MAXVALUE)
    
    Fix was to not include the last partition if the
    partitioning function value was not within the partition
    range.
    
    mysql-test/r/partition_innodb.result:
      Bug#51830: Incorrect partition pruning on range partition
      (regression)
      
      Updated result
    mysql-test/r/partition_pruning.result:
      Bug#51830: Incorrect partition pruning on range partition
      (regression)
      
      Updated result
    mysql-test/t/partition_innodb.test:
      Bug#51830: Incorrect partition pruning on range partition
      (regression)
      
      Added test for pruning in InnoDB, since it does not show
      for MyISAM due to 'Impossible WHERE noticed after reading
      const tables'.
    mysql-test/t/partition_pruning.test:
      Bug#51830: Incorrect partition pruning on range partition
      (regression)
      
      Added test
    sql/sql_partition.cc:
      Bug#51830: Incorrect partition pruning on range partition
      (regression)
      
      Also increase the partition id if not inside the last partition
      (and no MAXVALUE is defined).
      
      Added comments and DBUG_ASSERT.
    29b39e7a
sql_partition.cc 241 KB