diff options
author | unknown <mikael/pappa@dator5.(none)> | 2006-07-31 05:42:06 -0400 |
---|---|---|
committer | unknown <mikael/pappa@dator5.(none)> | 2006-07-31 05:42:06 -0400 |
commit | 1e949e84c59af2f32d116117d4e4b9ae2f1ffdb7 (patch) | |
tree | 2dd37edb87660fedfae837ba0f39c7a32785b042 /sql/sql_yacc.yy | |
parent | b230225b459bdcbf0cf82c60e62b894453411a14 (diff) | |
parent | 76ba12d6d99f0c613824997f1d0f8f874a614c5a (diff) | |
download | mariadb-git-1e949e84c59af2f32d116117d4e4b9ae2f1ffdb7.tar.gz |
Merge dator5.(none):/home/pappa/clean-mysql-5.1
into dator5.(none):/home/pappa/bug18198
mysql-test/r/partition.result:
Auto merged
mysql-test/t/partition.test:
Auto merged
sql/item_func.h:
Auto merged
sql/item_strfunc.h:
Auto merged
sql/sql_partition.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r-- | sql/sql_yacc.yy | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index ff422c4418c..bb44cbd43ab 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -3637,6 +3637,7 @@ part_bit_expr: { Item *part_expr= $1; bool not_corr_func; + int part_expression_ok= 1; LEX *lex= Lex; THD *thd= YYTHD; longlong item_value; @@ -3654,13 +3655,19 @@ part_bit_expr: mem_alloc_error(sizeof(part_elem_value)); YYABORT; } - + part_expr->walk(&Item::check_partition_func_processor, 0, + (byte*)(&part_expression_ok)); + if (!part_expression_ok) + { + my_error(ER_PARTITION_FUNCTION_IS_NOT_ALLOWED, MYF(0)); + YYABORT; + } if (part_expr->fix_fields(YYTHD, (Item**)0) || ((context->table_list= save_list), FALSE) || (!part_expr->const_item()) || (!lex->safe_to_cache_query)) { - yyerror(ER(ER_NO_CONST_EXPR_IN_RANGE_OR_LIST_ERROR)); + my_error(ER_NO_CONST_EXPR_IN_RANGE_OR_LIST_ERROR, MYF(0)); YYABORT; } thd->where= save_where; |