List:General Discussion« Previous MessageNext Message »
From:Dan Nelson Date:February 8 2007 6:06am
Subject:Re: about partition key type
View as plain text  
In the last episode (Feb 08), xian liu said:
> mysql> create table t1 (num int(10) not null, id char(18) not null) 
> partition by range(id) (
> partition id1 values less than('111111111111111112'),  
> partition id2 values less than('222222222222222223'),  
> partition id3 values less than('333333333333333334'),  
> partition id4 values less than('444444444444444445') 
> );
> ERROR 1064 (42000): VALUES value must be of same type as partition function near '), 
> partition id2 values less than('222222222222222223'),  partition id3 values ' at line 1
> 
> what's the meaning of this error?? does't it support partition key is
> column of char type in MySQL-5.1.14-beta version? Anyone advice ?
> thanks a lot!!

I can't see it docummentioned in the documentation, but the code looks
like it only accepts integer expressions for ranges.

sql_yacc.yy, line 3939:

          else if (part_expr->result_type() != INT_RESULT &&
                   !part_expr->null_value)
          {
            yyerror(ER(ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR));
            YYABORT;
          }

In your case, changing your id column to a BIGINT type should work.

-- 
	Dan Nelson
	dnelson@stripped
Thread
about partition key typexian liu8 Feb
  • Re: about partition key typeDan Nelson8 Feb
    • 回复: Re: about partition key typexian liu8 Feb