summaryrefslogtreecommitdiff
path: root/sql/sql_yacc.yy
diff options
context:
space:
mode:
authorunknown <mikael/pappa@dator5.(none)>2006-07-12 11:33:22 -0400
committerunknown <mikael/pappa@dator5.(none)>2006-07-12 11:33:22 -0400
commit840840bda05703cdfbefd26245cf24f990d5fbca (patch)
treec3d9a5a489a6a7dc750b00cf189b565d4a6f3597 /sql/sql_yacc.yy
parent16c54768ba01d9138043ffa8b426b5d3bd14931b (diff)
parent57e881430ef79f9eeb02cd08b5c544cb85be1d66 (diff)
downloadmariadb-git-840840bda05703cdfbefd26245cf24f990d5fbca.tar.gz
Merge mronstrom@bk-internal.mysql.com:/home/bk/bugs/bug18198
into dator5.(none):/home/pappa/bug18198 mysql-test/r/partition.result: Auto merged mysql-test/t/partition.test: Auto merged sql/item_cmpfunc.h: Auto merged sql/item_strfunc.h: Auto merged sql/sql_partition.cc: Auto merged sql/sql_yacc.yy: Auto merged sql/partition_info.cc: manual merge sql/partition_info.h: manual merge sql/sql_table.cc: manual merge
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r--sql/sql_yacc.yy11
1 files changed, 9 insertions, 2 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 0632e2298cd..e12985faca8 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -3619,6 +3619,7 @@ part_bit_expr:
{
Item *part_expr= $1;
bool not_corr_func;
+ bool part_expression_ok= TRUE;
LEX *lex= Lex;
THD *thd= YYTHD;
longlong item_value;
@@ -3636,13 +3637,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;