Commit 142af8c2 authored by mikael/pappa@dator5.(none)'s avatar mikael/pappa@dator5.(none)

Merge dator5.(none):/home/pappa/bug15890

into  dator5.(none):/home/pappa/bug21388
parents 9ba77eb8 e80f98b8
drop table if exists t1; drop table if exists t1;
create table t1 (a int) create table t1 (a int)
partition by key(a)
partitions 0.2+e1;
ERROR 42000: Only normal integers allowed as number here near '0.2+e1' at line 3
create table t1 (a int)
partition by key(a)
partitions -1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1' at line 3
create table t1 (a int)
partition by key(a)
partitions 1.5;
ERROR 42000: Only normal integers allowed as number here near '1.5' at line 3
create table t1 (a int)
partition by key(a)
partitions 1e+300;
ERROR 42000: Only normal integers allowed as number here near '1e+300' at line 3
create table t1 (a int)
partition by list (a) partition by list (a)
(partition p0 values in (1)); (partition p0 values in (1));
create procedure pz() create procedure pz()
......
...@@ -9,6 +9,25 @@ ...@@ -9,6 +9,25 @@
drop table if exists t1; drop table if exists t1;
--enable_warnings --enable_warnings
#
# Bug 15890: Strange number of partitions accepted
#
-- error 1064
create table t1 (a int)
partition by key(a)
partitions 0.2+e1;
-- error 1064
create table t1 (a int)
partition by key(a)
partitions -1;
-- error 1064
create table t1 (a int)
partition by key(a)
partitions 1.5;
-- error 1064
create table t1 (a int)
partition by key(a)
partitions 1e+300;
# #
# Bug 19309 Partitions: Crash if double procedural alter # Bug 19309 Partitions: Crash if double procedural alter
# #
......
...@@ -5954,3 +5954,5 @@ ER_BAD_LOG_ENGINE ...@@ -5954,3 +5954,5 @@ ER_BAD_LOG_ENGINE
eng "One can use only CSV and MyISAM engines for the log tables" eng "One can use only CSV and MyISAM engines for the log tables"
ER_CANT_DROP_LOG_TABLE ER_CANT_DROP_LOG_TABLE
eng "Cannot drop log table if log is enabled" eng "Cannot drop log table if log is enabled"
ER_ONLY_INTEGERS_ALLOWED
eng "Only normal integers allowed as number here"
...@@ -752,10 +752,10 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); ...@@ -752,10 +752,10 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
ev_alter_on_schedule_completion opt_ev_rename_to opt_ev_sql_stmt ev_alter_on_schedule_completion opt_ev_rename_to opt_ev_sql_stmt
%type <ulong_num> %type <ulong_num>
ulong_num merge_insert_types ulong_num real_ulong_num merge_insert_types
%type <ulonglong_number> %type <ulonglong_number>
ulonglong_num size_number ulonglong_num real_ulonglong_num size_number
%type <p_elem_value> %type <p_elem_value>
part_bit_expr part_bit_expr
...@@ -3097,7 +3097,7 @@ opt_ts_redo_buffer_size: ...@@ -3097,7 +3097,7 @@ opt_ts_redo_buffer_size:
}; };
opt_ts_nodegroup: opt_ts_nodegroup:
NODEGROUP_SYM opt_equal ulong_num NODEGROUP_SYM opt_equal real_ulong_num
{ {
LEX *lex= Lex; LEX *lex= Lex;
if (lex->alter_tablespace_info->nodegroup_id != UNDEF_NODEGROUP) if (lex->alter_tablespace_info->nodegroup_id != UNDEF_NODEGROUP)
...@@ -3156,7 +3156,7 @@ ts_wait: ...@@ -3156,7 +3156,7 @@ ts_wait:
}; };
size_number: size_number:
ulong_num { $$= $1;} real_ulong_num { $$= $1;}
| IDENT | IDENT
{ {
ulonglong number, test_number; ulonglong number, test_number;
...@@ -3395,7 +3395,7 @@ sub_part_func: ...@@ -3395,7 +3395,7 @@ sub_part_func:
opt_no_parts: opt_no_parts:
/* empty */ {} /* empty */ {}
| PARTITIONS_SYM ulong_num | PARTITIONS_SYM real_ulong_num
{ {
uint no_parts= $2; uint no_parts= $2;
LEX *lex= Lex; LEX *lex= Lex;
...@@ -3459,7 +3459,7 @@ part_func_expr: ...@@ -3459,7 +3459,7 @@ part_func_expr:
opt_no_subparts: opt_no_subparts:
/* empty */ {} /* empty */ {}
| SUBPARTITIONS_SYM ulong_num | SUBPARTITIONS_SYM real_ulong_num
{ {
uint no_parts= $2; uint no_parts= $2;
LEX *lex= Lex; LEX *lex= Lex;
...@@ -3799,11 +3799,11 @@ opt_part_option: ...@@ -3799,11 +3799,11 @@ opt_part_option:
lex->part_info->curr_part_elem->engine_type= $4; lex->part_info->curr_part_elem->engine_type= $4;
lex->part_info->default_engine_type= $4; lex->part_info->default_engine_type= $4;
} }
| NODEGROUP_SYM opt_equal ulong_num | NODEGROUP_SYM opt_equal real_ulong_num
{ Lex->part_info->curr_part_elem->nodegroup_id= $3; } { Lex->part_info->curr_part_elem->nodegroup_id= $3; }
| MAX_ROWS opt_equal ulonglong_num | MAX_ROWS opt_equal real_ulonglong_num
{ Lex->part_info->curr_part_elem->part_max_rows= $3; } { Lex->part_info->curr_part_elem->part_max_rows= $3; }
| MIN_ROWS opt_equal ulonglong_num | MIN_ROWS opt_equal real_ulonglong_num
{ Lex->part_info->curr_part_elem->part_min_rows= $3; } { Lex->part_info->curr_part_elem->part_min_rows= $3; }
| DATA_SYM DIRECTORY_SYM opt_equal TEXT_STRING_sys | DATA_SYM DIRECTORY_SYM opt_equal TEXT_STRING_sys
{ Lex->part_info->curr_part_elem->data_file_name= $4.str; } { Lex->part_info->curr_part_elem->data_file_name= $4.str; }
...@@ -4933,7 +4933,7 @@ alter_commands: ...@@ -4933,7 +4933,7 @@ alter_commands:
lex->check_opt.init(); lex->check_opt.init();
} }
opt_mi_repair_type opt_mi_repair_type
| COALESCE PARTITION_SYM opt_no_write_to_binlog ulong_num | COALESCE PARTITION_SYM opt_no_write_to_binlog real_ulong_num
{ {
LEX *lex= Lex; LEX *lex= Lex;
lex->alter_info.flags|= ALTER_COALESCE_PARTITION; lex->alter_info.flags|= ALTER_COALESCE_PARTITION;
...@@ -4981,7 +4981,7 @@ add_part_extra: ...@@ -4981,7 +4981,7 @@ add_part_extra:
LEX *lex= Lex; LEX *lex= Lex;
lex->part_info->no_parts= lex->part_info->partitions.elements; lex->part_info->no_parts= lex->part_info->partitions.elements;
} }
| PARTITIONS_SYM ulong_num | PARTITIONS_SYM real_ulong_num
{ {
LEX *lex= Lex; LEX *lex= Lex;
lex->part_info->no_parts= $2; lex->part_info->no_parts= $2;
...@@ -7516,7 +7516,15 @@ ulong_num: ...@@ -7516,7 +7516,15 @@ ulong_num:
| ULONGLONG_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); } | ULONGLONG_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
| DECIMAL_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); } | DECIMAL_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
| FLOAT_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); } | FLOAT_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
; ;
real_ulong_num:
NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
| HEX_NUM { $$= (ulong) strtol($1.str, (char**) 0, 16); }
| LONG_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
| ULONGLONG_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
| dec_num_error { YYABORT; }
;
ulonglong_num: ulonglong_num:
NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); } NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); }
...@@ -7526,6 +7534,23 @@ ulonglong_num: ...@@ -7526,6 +7534,23 @@ ulonglong_num:
| FLOAT_NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); } | FLOAT_NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); }
; ;
real_ulonglong_num:
NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); }
| ULONGLONG_NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); }
| LONG_NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); }
| dec_num_error { YYABORT; }
;
dec_num_error:
dec_num
{ yyerror(ER(ER_ONLY_INTEGERS_ALLOWED)); }
;
dec_num:
DECIMAL_NUM
| FLOAT_NUM
;
procedure_clause: procedure_clause:
/* empty */ /* empty */
| PROCEDURE ident /* Procedure name */ | PROCEDURE ident /* Procedure name */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment