• Mattias Jonsson's avatar
    Bug#50036: Inconsistent errors when using TIMESTAMP columns/expressions · 86327002
    Mattias Jonsson authored
    It was hard to understand what the error really meant.
    
    The error checking in partitioning is done in several different
    parts during the execution of a query which can make it
    hard to return useful errors.
    
    Added a new error for bad VALUES part in the per PARTITION clause.
    Using the more verbose error that a column is not allowed in
    the partitioning function instead of just that the function is
    not allowed.
    
    mysql-test/r/partition.result:
      changed error to be more specific
    mysql-test/r/partition_error.result:
      updated result
    mysql-test/std_data/parts/t1TIMESTAMP.frm:
      .frm file of CREATE TABLE t1 (a TIMESTAMP) PARTITION BY HASH(TO_DAYS(a));
    mysql-test/t/partition.test:
      changed error to be more specific
    mysql-test/t/partition_error.test:
      Added test (also for verifying behaviour of previously
      created tables which is no longer allowed).
      
      Updated expected errors in other places
    sql/partition_info.cc:
      Added function report_part_expr_error to
      be able to return a more specific error.
      
      Renamed fix_func_partition to fix_partition_values
      since the function really fixes/checks the VALUES clause.
    sql/partition_info.h:
      removed part_result_type, since it was unused.
      renamed fix_funk_partition->fix_partition_values
      added report_part_expr_error
    sql/share/errmsg-utf8.txt:
      Added a more specific error.
    sql/sql_partition.cc:
      made use of report_part_expr_error to get a more specific error.
    sql/sql_yacc.yy:
      Changed error message to be more specific. And return an other error code.
    86327002