BUG#18198: Many strange partition functions were allowed, now only strictly...

BUG#18198: Many strange partition functions were allowed, now only strictly allowed functions are ok
parent d1b37d9c
...@@ -554,3 +554,26 @@ PARTITION BY RANGE (a) (PARTITION p1 VALUES LESS THAN(5)); ...@@ -554,3 +554,26 @@ PARTITION BY RANGE (a) (PARTITION p1 VALUES LESS THAN(5));
insert into t1 values (10); insert into t1 values (10);
ERROR HY000: Table has no partition for value 10 ERROR HY000: Table has no partition for value 10
drop table t1; drop table t1;
create table t1 (v varchar(12))
partition by range (ascii(v))
(partition p0 values less than (10));
drop table t1;
create table t1 (a int)
partition by hash (rand(a));
ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')' at line 2
create table t1 (a int)
partition by hash(CURTIME() + a);
ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')' at line 2
create table t1 (a int)
partition by hash (NOW()+a);
ERROR 42000: Constant/Random expression in (sub)partitioning function is not allowed near ')' at line 2
create table t1 (a int)
partition by hash (extract(hour from convert_tz(a, '+00:00', '+00:00')));
ERROR HY000: This partition function is not allowed
create table t1 (a int)
partition by range (a + (select count(*) from t1))
(partition p1 values less than (1));
ERROR HY000: This partition function is not allowed
create table t1 (a char(10))
partition by hash (extractvalue(a,'a'));
ERROR HY000: The PARTITION function returns the wrong type
...@@ -747,3 +747,31 @@ CREATE TABLE t1(a int) ...@@ -747,3 +747,31 @@ CREATE TABLE t1(a int)
--error ER_NO_PARTITION_FOR_GIVEN_VALUE --error ER_NO_PARTITION_FOR_GIVEN_VALUE
insert into t1 values (10); insert into t1 values (10);
drop table t1; drop table t1;
#
# Bug 18198 Partitions: Verify that erroneus partition functions doesn't work
#
create table t1 (v varchar(12))
partition by range (ascii(v))
(partition p0 values less than (10));
drop table t1;
-- error 1064
create table t1 (a int)
partition by hash (rand(a));
-- error 1064
create table t1 (a int)
partition by hash(CURTIME() + a);
-- error 1064
create table t1 (a int)
partition by hash (NOW()+a);
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
create table t1 (a int)
partition by hash (extract(hour from convert_tz(a, '+00:00', '+00:00')));
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
create table t1 (a int)
partition by range (a + (select count(*) from t1))
(partition p1 values less than (1));
-- error ER_PARTITION_FUNC_NOT_ALLOWED_ERROR
create table t1 (a char(10))
partition by hash (extractvalue(a,'a'));
...@@ -745,6 +745,13 @@ public: ...@@ -745,6 +745,13 @@ public:
virtual bool change_context_processor(byte *context) { return 0; } virtual bool change_context_processor(byte *context) { return 0; }
virtual bool reset_query_id_processor(byte *query_id) { return 0; } virtual bool reset_query_id_processor(byte *query_id) { return 0; }
/* /*
Check if a partition function is allowed
SYNOPSIS
check_partition_func_processor()
bool_arg Return argument
RETURN VALUE
0
DESCRIPTION
check_partition_func_processor is used to check if a partition function check_partition_func_processor is used to check if a partition function
uses an allowed function. The default is that an item is not allowed uses an allowed function. The default is that an item is not allowed
in a partition function. However all mathematical functions, string in a partition function. However all mathematical functions, string
...@@ -1031,7 +1038,7 @@ public: ...@@ -1031,7 +1038,7 @@ public:
Item::maybe_null= TRUE; Item::maybe_null= TRUE;
} }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0; } bool check_partition_func_processor(byte *bool_arg) { return 0; }
bool fix_fields(THD *, Item **); bool fix_fields(THD *, Item **);
enum Type type() const; enum Type type() const;
...@@ -1078,7 +1085,7 @@ public: ...@@ -1078,7 +1085,7 @@ public:
Item_num() {} /* Remove gcc warning */ Item_num() {} /* Remove gcc warning */
virtual Item_num *neg()= 0; virtual Item_num *neg()= 0;
Item *safe_charset_converter(CHARSET_INFO *tocs); Item *safe_charset_converter(CHARSET_INFO *tocs);
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
#define NO_CACHED_FIELD_INDEX ((uint)(-1)) #define NO_CACHED_FIELD_INDEX ((uint)(-1))
...@@ -1264,7 +1271,7 @@ public: ...@@ -1264,7 +1271,7 @@ public:
bool is_null() { return 1; } bool is_null() { return 1; }
void print(String *str) { str->append(STRING_WITH_LEN("NULL")); } void print(String *str) { str->append(STRING_WITH_LEN("NULL")); }
Item *safe_charset_converter(CHARSET_INFO *tocs); Item *safe_charset_converter(CHARSET_INFO *tocs);
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
class Item_null_result :public Item_null class Item_null_result :public Item_null
...@@ -1277,7 +1284,7 @@ public: ...@@ -1277,7 +1284,7 @@ public:
{ {
save_in_field(result_field, no_conversions); save_in_field(result_field, no_conversions);
} }
virtual bool check_partition_func_processor(byte *bool_arg) bool check_partition_func_processor(byte *bool_arg)
{ *(bool *)bool_arg= FALSE; return 0; } { *(bool *)bool_arg= FALSE; return 0; }
}; };
...@@ -1462,7 +1469,7 @@ public: ...@@ -1462,7 +1469,7 @@ public:
{} {}
Item *safe_charset_converter(CHARSET_INFO *tocs); Item *safe_charset_converter(CHARSET_INFO *tocs);
void print(String *str) { str->append(func_name); } void print(String *str) { str->append(func_name); }
virtual bool check_partition_func_processor(byte *bool_arg) bool check_partition_func_processor(byte *bool_arg)
{ *(bool *)bool_arg= FALSE; return 0; } { *(bool *)bool_arg= FALSE; return 0; }
}; };
...@@ -1582,7 +1589,7 @@ public: ...@@ -1582,7 +1589,7 @@ public:
{} {}
void print(String *str) { str->append(func_name); } void print(String *str) { str->append(func_name); }
Item *safe_charset_converter(CHARSET_INFO *tocs); Item *safe_charset_converter(CHARSET_INFO *tocs);
virtual bool check_partition_func_processor(byte *bool_arg) bool check_partition_func_processor(byte *bool_arg)
{ *(bool *)bool_arg= FALSE; return 0; } { *(bool *)bool_arg= FALSE; return 0; }
}; };
...@@ -1661,7 +1668,7 @@ public: ...@@ -1661,7 +1668,7 @@ public:
void print(String *str); void print(String *str);
// to prevent drop fixed flag (no need parent cleanup call) // to prevent drop fixed flag (no need parent cleanup call)
void cleanup() {} void cleanup() {}
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -1676,7 +1683,7 @@ public: ...@@ -1676,7 +1683,7 @@ public:
{} {}
Item *safe_charset_converter(CHARSET_INFO *tocs); Item *safe_charset_converter(CHARSET_INFO *tocs);
void print(String *str) { str->append(func_name); } void print(String *str) { str->append(func_name); }
virtual bool check_partition_func_processor(byte *bool_arg) bool check_partition_func_processor(byte *bool_arg)
{ *(bool *)bool_arg= FALSE; return 0; } { *(bool *)bool_arg= FALSE; return 0; }
}; };
...@@ -1690,7 +1697,7 @@ public: ...@@ -1690,7 +1697,7 @@ public:
&my_charset_bin) &my_charset_bin)
{ max_length=19;} { max_length=19;}
enum_field_types field_type() const { return MYSQL_TYPE_DATETIME; } enum_field_types field_type() const { return MYSQL_TYPE_DATETIME; }
virtual bool check_partition_func_processor(byte *bool_arg) bool check_partition_func_processor(byte *bool_arg)
{ *(bool *)bool_arg= FALSE; return 0; } { *(bool *)bool_arg= FALSE; return 0; }
}; };
...@@ -1714,7 +1721,7 @@ public: ...@@ -1714,7 +1721,7 @@ public:
unsigned_flag=1; unsigned_flag=1;
} }
enum_field_types field_type() const { return int_field_type; } enum_field_types field_type() const { return int_field_type; }
virtual bool check_partition_func_processor(byte *bool_arg) bool check_partition_func_processor(byte *bool_arg)
{ *(bool *)bool_arg= FALSE; return 0; } { *(bool *)bool_arg= FALSE; return 0; }
}; };
...@@ -1739,7 +1746,7 @@ public: ...@@ -1739,7 +1746,7 @@ public:
void cleanup() {} void cleanup() {}
bool eq(const Item *item, bool binary_cmp) const; bool eq(const Item *item, bool binary_cmp) const;
virtual Item *safe_charset_converter(CHARSET_INFO *tocs); virtual Item *safe_charset_converter(CHARSET_INFO *tocs);
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -1977,7 +1984,7 @@ public: ...@@ -1977,7 +1984,7 @@ public:
} }
Item *new_item(); Item *new_item();
virtual Item *real_item() { return ref; } virtual Item *real_item() { return ref; }
virtual bool check_partition_func_processor(byte *bool_arg) bool check_partition_func_processor(byte *bool_arg)
{ *(bool *)bool_arg= FALSE; return 0; } { *(bool *)bool_arg= FALSE; return 0; }
}; };
......
...@@ -239,7 +239,7 @@ public: ...@@ -239,7 +239,7 @@ public:
} }
Item *neg_transformer(THD *thd); Item *neg_transformer(THD *thd);
virtual Item *negated_item(); virtual Item *negated_item();
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
class Item_func_not :public Item_bool_func class Item_func_not :public Item_bool_func
...@@ -250,7 +250,7 @@ public: ...@@ -250,7 +250,7 @@ public:
enum Functype functype() const { return NOT_FUNC; } enum Functype functype() const { return NOT_FUNC; }
const char *func_name() const { return "not"; } const char *func_name() const { return "not"; }
Item *neg_transformer(THD *thd); Item *neg_transformer(THD *thd);
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
class Item_maxmin_subselect; class Item_maxmin_subselect;
...@@ -465,7 +465,7 @@ public: ...@@ -465,7 +465,7 @@ public:
bool is_bool_func() { return 1; } bool is_bool_func() { return 1; }
CHARSET_INFO *compare_collation() { return cmp_collation.collation; } CHARSET_INFO *compare_collation() { return cmp_collation.collation; }
uint decimal_precision() const { return 1; } uint decimal_precision() const { return 1; }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -477,7 +477,7 @@ public: ...@@ -477,7 +477,7 @@ public:
optimize_type select_optimize() const { return OPTIMIZE_NONE; } optimize_type select_optimize() const { return OPTIMIZE_NONE; }
const char *func_name() const { return "strcmp"; } const char *func_name() const { return "strcmp"; }
void print(String *str) { Item_func::print(str); } void print(String *str) { Item_func::print(str); }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -540,7 +540,7 @@ public: ...@@ -540,7 +540,7 @@ public:
const char *func_name() const { return "ifnull"; } const char *func_name() const { return "ifnull"; }
Field *tmp_table_field(TABLE *table); Field *tmp_table_field(TABLE *table);
uint decimal_precision() const; uint decimal_precision() const;
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -581,7 +581,7 @@ public: ...@@ -581,7 +581,7 @@ public:
void print(String *str) { Item_func::print(str); } void print(String *str) { Item_func::print(str); }
table_map not_null_tables() const { return 0; } table_map not_null_tables() const { return 0; }
bool is_null(); bool is_null();
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -624,7 +624,7 @@ public: ...@@ -624,7 +624,7 @@ public:
void print(String *str); void print(String *str);
Item *find_item(String *str); Item *find_item(String *str);
CHARSET_INFO *compare_collation() { return cmp_collation.collation; } CHARSET_INFO *compare_collation() { return cmp_collation.collation; }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -904,7 +904,7 @@ class Item_func_in :public Item_func_opt_neg ...@@ -904,7 +904,7 @@ class Item_func_in :public Item_func_opt_neg
bool nulls_in_row(); bool nulls_in_row();
bool is_bool_func() { return 1; } bool is_bool_func() { return 1; }
CHARSET_INFO *compare_collation() { return cmp_collation.collation; } CHARSET_INFO *compare_collation() { return cmp_collation.collation; }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
/* Functions used by where clause */ /* Functions used by where clause */
...@@ -946,7 +946,7 @@ public: ...@@ -946,7 +946,7 @@ public:
optimize_type select_optimize() const { return OPTIMIZE_NULL; } optimize_type select_optimize() const { return OPTIMIZE_NULL; }
Item *neg_transformer(THD *thd); Item *neg_transformer(THD *thd);
CHARSET_INFO *compare_collation() { return args[0]->collation.collation; } CHARSET_INFO *compare_collation() { return args[0]->collation.collation; }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
/* Functions used by HAVING for rewriting IN subquery */ /* Functions used by HAVING for rewriting IN subquery */
...@@ -968,7 +968,7 @@ public: ...@@ -968,7 +968,7 @@ public:
*/ */
table_map used_tables() const table_map used_tables() const
{ return used_tables_cache | RAND_TABLE_BIT; } { return used_tables_cache | RAND_TABLE_BIT; }
virtual bool check_partition_func_processor(byte *bool_arg) bool check_partition_func_processor(byte *bool_arg)
{ *(bool *)bool_arg= FALSE; return 0; } { *(bool *)bool_arg= FALSE; return 0; }
}; };
...@@ -992,7 +992,7 @@ public: ...@@ -992,7 +992,7 @@ public:
void print(String *str); void print(String *str);
CHARSET_INFO *compare_collation() { return args[0]->collation.collation; } CHARSET_INFO *compare_collation() { return args[0]->collation.collation; }
void top_level_item() { abort_on_null=1; } void top_level_item() { abort_on_null=1; }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -1031,7 +1031,7 @@ public: ...@@ -1031,7 +1031,7 @@ public:
const char *func_name() const { return "like"; } const char *func_name() const { return "like"; }
bool fix_fields(THD *thd, Item **ref); bool fix_fields(THD *thd, Item **ref);
void cleanup(); void cleanup();
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
#ifdef USE_REGEX #ifdef USE_REGEX
...@@ -1054,7 +1054,7 @@ public: ...@@ -1054,7 +1054,7 @@ public:
const char *func_name() const { return "regexp"; } const char *func_name() const { return "regexp"; }
void print(String *str) { print_op(str); } void print(String *str) { print_op(str); }
CHARSET_INFO *compare_collation() { return cmp_collation.collation; } CHARSET_INFO *compare_collation() { return cmp_collation.collation; }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
#else #else
...@@ -1111,7 +1111,7 @@ public: ...@@ -1111,7 +1111,7 @@ public:
Item *transform(Item_transformer transformer, byte *arg); Item *transform(Item_transformer transformer, byte *arg);
void traverse_cond(Cond_traverser, void *arg, traverse_order order); void traverse_cond(Cond_traverser, void *arg, traverse_order order);
void neg_arguments(THD *thd); void neg_arguments(THD *thd);
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
......
This diff is collapsed.
...@@ -46,7 +46,7 @@ public: ...@@ -46,7 +46,7 @@ public:
String *val_str(String *); String *val_str(String *);
void fix_length_and_dec(); void fix_length_and_dec();
const char *func_name() const { return "md5"; } const char *func_name() const { return "md5"; }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -57,7 +57,7 @@ public: ...@@ -57,7 +57,7 @@ public:
String *val_str(String *); String *val_str(String *);
void fix_length_and_dec(); void fix_length_and_dec();
const char *func_name() const { return "sha"; } const char *func_name() const { return "sha"; }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
class Item_func_aes_encrypt :public Item_str_func class Item_func_aes_encrypt :public Item_str_func
...@@ -88,7 +88,7 @@ public: ...@@ -88,7 +88,7 @@ public:
String *val_str(String *); String *val_str(String *);
void fix_length_and_dec(); void fix_length_and_dec();
const char *func_name() const { return "concat"; } const char *func_name() const { return "concat"; }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
class Item_func_concat_ws :public Item_str_func class Item_func_concat_ws :public Item_str_func
...@@ -109,7 +109,7 @@ public: ...@@ -109,7 +109,7 @@ public:
String *val_str(String *); String *val_str(String *);
void fix_length_and_dec(); void fix_length_and_dec();
const char *func_name() const { return "reverse"; } const char *func_name() const { return "reverse"; }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -147,7 +147,7 @@ protected: ...@@ -147,7 +147,7 @@ protected:
public: public:
Item_str_conv(Item *item) :Item_str_func(item) {} Item_str_conv(Item *item) :Item_str_func(item) {}
String *val_str(String *); String *val_str(String *);
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -211,7 +211,7 @@ public: ...@@ -211,7 +211,7 @@ public:
String *val_str(String *); String *val_str(String *);
void fix_length_and_dec(); void fix_length_and_dec();
const char *func_name() const { return "substr"; } const char *func_name() const { return "substr"; }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -223,7 +223,7 @@ public: ...@@ -223,7 +223,7 @@ public:
String *val_str(String *); String *val_str(String *);
void fix_length_and_dec(); void fix_length_and_dec();
const char *func_name() const { return "substring_index"; } const char *func_name() const { return "substring_index"; }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -238,7 +238,7 @@ public: ...@@ -238,7 +238,7 @@ public:
String *val_str(String *); String *val_str(String *);
void fix_length_and_dec(); void fix_length_and_dec();
const char *func_name() const { return "trim"; } const char *func_name() const { return "trim"; }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -418,7 +418,7 @@ public: ...@@ -418,7 +418,7 @@ public:
String *val_str(String *); String *val_str(String *);
void fix_length_and_dec(); void fix_length_and_dec();
const char *func_name() const { return "soundex"; } const char *func_name() const { return "soundex"; }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -526,7 +526,7 @@ public: ...@@ -526,7 +526,7 @@ public:
String *val_str(String *); String *val_str(String *);
void fix_length_and_dec(); void fix_length_and_dec();
const char *func_name() const { return "rpad"; } const char *func_name() const { return "rpad"; }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -539,7 +539,7 @@ public: ...@@ -539,7 +539,7 @@ public:
String *val_str(String *); String *val_str(String *);
void fix_length_and_dec(); void fix_length_and_dec();
const char *func_name() const { return "lpad"; } const char *func_name() const { return "lpad"; }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -554,7 +554,7 @@ public: ...@@ -554,7 +554,7 @@ public:
collation.set(default_charset()); collation.set(default_charset());
decimals=0; max_length=64; decimals=0; max_length=64;
} }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -571,7 +571,7 @@ public: ...@@ -571,7 +571,7 @@ public:
decimals=0; decimals=0;
max_length=args[0]->max_length*2*collation.collation->mbmaxlen; max_length=args[0]->max_length*2*collation.collation->mbmaxlen;
} }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
class Item_func_unhex :public Item_str_func class Item_func_unhex :public Item_str_func
...@@ -587,7 +587,7 @@ public: ...@@ -587,7 +587,7 @@ public:
decimals=0; decimals=0;
max_length=(1+args[0]->max_length)/2; max_length=(1+args[0]->max_length)/2;
} }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -611,7 +611,7 @@ public: ...@@ -611,7 +611,7 @@ public:
} }
void print(String *str); void print(String *str);
const char *func_name() const { return "cast_as_binary"; } const char *func_name() const { return "cast_as_binary"; }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -651,7 +651,7 @@ public: ...@@ -651,7 +651,7 @@ public:
String* val_str(String* str); String* val_str(String* str);
const char *func_name() const { return "inet_ntoa"; } const char *func_name() const { return "inet_ntoa"; }
void fix_length_and_dec() { decimals = 0; max_length=3*8+7; } void fix_length_and_dec() { decimals = 0; max_length=3*8+7; }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
class Item_func_quote :public Item_str_func class Item_func_quote :public Item_str_func
...@@ -666,7 +666,7 @@ public: ...@@ -666,7 +666,7 @@ public:
collation.set(args[0]->collation); collation.set(args[0]->collation);
max_length= args[0]->max_length * 2 + 2; max_length= args[0]->max_length * 2 + 2;
} }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
class Item_func_conv_charset :public Item_str_func class Item_func_conv_charset :public Item_str_func
...@@ -709,7 +709,7 @@ public: ...@@ -709,7 +709,7 @@ public:
void fix_length_and_dec(); void fix_length_and_dec();
const char *func_name() const { return "convert"; } const char *func_name() const { return "convert"; }
void print(String *str); void print(String *str);
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
class Item_func_set_collation :public Item_str_func class Item_func_set_collation :public Item_str_func
...@@ -742,7 +742,7 @@ public: ...@@ -742,7 +742,7 @@ public:
maybe_null= 0; maybe_null= 0;
}; };
table_map not_null_tables() const { return 0; } table_map not_null_tables() const { return 0; }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
class Item_func_collation :public Item_str_func class Item_func_collation :public Item_str_func
...@@ -758,7 +758,7 @@ public: ...@@ -758,7 +758,7 @@ public:
maybe_null= 0; maybe_null= 0;
}; };
table_map not_null_tables() const { return 0; } table_map not_null_tables() const { return 0; }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
class Item_func_crc32 :public Item_int_func class Item_func_crc32 :public Item_int_func
...@@ -769,7 +769,7 @@ public: ...@@ -769,7 +769,7 @@ public:
const char *func_name() const { return "crc32"; } const char *func_name() const { return "crc32"; }
void fix_length_and_dec() { max_length=10; } void fix_length_and_dec() { max_length=10; }
longlong val_int(); longlong val_int();
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
class Item_func_uncompressed_length : public Item_int_func class Item_func_uncompressed_length : public Item_int_func
...@@ -780,7 +780,7 @@ public: ...@@ -780,7 +780,7 @@ public:
const char *func_name() const{return "uncompressed_length";} const char *func_name() const{return "uncompressed_length";}
void fix_length_and_dec() { max_length=10; } void fix_length_and_dec() { max_length=10; }
longlong val_int(); longlong val_int();
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
#ifdef HAVE_COMPRESS #ifdef HAVE_COMPRESS
...@@ -797,7 +797,7 @@ public: ...@@ -797,7 +797,7 @@ public:
void fix_length_and_dec(){max_length= (args[0]->max_length*120)/100+12;} void fix_length_and_dec(){max_length= (args[0]->max_length*120)/100+12;}
const char *func_name() const{return "compress";} const char *func_name() const{return "compress";}
String *val_str(String *) ZLIB_DEPENDED_FUNCTION String *val_str(String *) ZLIB_DEPENDED_FUNCTION
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
class Item_func_uncompress: public Item_str_func class Item_func_uncompress: public Item_str_func
...@@ -808,7 +808,7 @@ public: ...@@ -808,7 +808,7 @@ public:
void fix_length_and_dec(){max_length= MAX_BLOB_WIDTH;} void fix_length_and_dec(){max_length= MAX_BLOB_WIDTH;}
const char *func_name() const{return "uncompress";} const char *func_name() const{return "uncompress";}
String *val_str(String *) ZLIB_DEPENDED_FUNCTION String *val_str(String *) ZLIB_DEPENDED_FUNCTION
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
#define UUID_LENGTH (8+1+4+1+4+1+4+1+12) #define UUID_LENGTH (8+1+4+1+4+1+4+1+12)
......
...@@ -39,7 +39,7 @@ public: ...@@ -39,7 +39,7 @@ public:
{ {
max_length=6*MY_CHARSET_BIN_MB_MAXLEN; max_length=6*MY_CHARSET_BIN_MB_MAXLEN;
} }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -54,7 +54,7 @@ public: ...@@ -54,7 +54,7 @@ public:
decimals=0; decimals=0;
max_length=6*MY_CHARSET_BIN_MB_MAXLEN; max_length=6*MY_CHARSET_BIN_MB_MAXLEN;
} }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -71,7 +71,7 @@ public: ...@@ -71,7 +71,7 @@ public:
maybe_null=1; maybe_null=1;
} }
enum_monotonicity_info get_monotonicity_info() const; enum_monotonicity_info get_monotonicity_info() const;
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -87,7 +87,7 @@ public: ...@@ -87,7 +87,7 @@ public:
max_length=2*MY_CHARSET_BIN_MB_MAXLEN; max_length=2*MY_CHARSET_BIN_MB_MAXLEN;
maybe_null=1; maybe_null=1;
} }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -112,7 +112,7 @@ public: ...@@ -112,7 +112,7 @@ public:
max_length=2*MY_CHARSET_BIN_MB_MAXLEN; max_length=2*MY_CHARSET_BIN_MB_MAXLEN;
maybe_null=1; maybe_null=1;
} }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -145,7 +145,7 @@ public: ...@@ -145,7 +145,7 @@ public:
max_length=3*MY_CHARSET_BIN_MB_MAXLEN; max_length=3*MY_CHARSET_BIN_MB_MAXLEN;
maybe_null=1; maybe_null=1;
} }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -161,7 +161,7 @@ public: ...@@ -161,7 +161,7 @@ public:
max_length=2*MY_CHARSET_BIN_MB_MAXLEN; max_length=2*MY_CHARSET_BIN_MB_MAXLEN;
maybe_null=1; maybe_null=1;
} }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -177,7 +177,7 @@ public: ...@@ -177,7 +177,7 @@ public:
max_length=2*MY_CHARSET_BIN_MB_MAXLEN; max_length=2*MY_CHARSET_BIN_MB_MAXLEN;
maybe_null=1; maybe_null=1;
} }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -193,7 +193,7 @@ public: ...@@ -193,7 +193,7 @@ public:
max_length=1*MY_CHARSET_BIN_MB_MAXLEN; max_length=1*MY_CHARSET_BIN_MB_MAXLEN;
maybe_null=1; maybe_null=1;
} }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -209,7 +209,7 @@ public: ...@@ -209,7 +209,7 @@ public:
max_length=2*MY_CHARSET_BIN_MB_MAXLEN; max_length=2*MY_CHARSET_BIN_MB_MAXLEN;
maybe_null=1; maybe_null=1;
} }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -225,7 +225,7 @@ public: ...@@ -225,7 +225,7 @@ public:
max_length=2*MY_CHARSET_BIN_MB_MAXLEN; max_length=2*MY_CHARSET_BIN_MB_MAXLEN;
maybe_null=1; maybe_null=1;
} }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
class Item_func_yearweek :public Item_int_func class Item_func_yearweek :public Item_int_func
...@@ -240,7 +240,7 @@ public: ...@@ -240,7 +240,7 @@ public:
max_length=6*MY_CHARSET_BIN_MB_MAXLEN; max_length=6*MY_CHARSET_BIN_MB_MAXLEN;
maybe_null=1; maybe_null=1;
} }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -257,7 +257,7 @@ public: ...@@ -257,7 +257,7 @@ public:
max_length=4*MY_CHARSET_BIN_MB_MAXLEN; max_length=4*MY_CHARSET_BIN_MB_MAXLEN;
maybe_null=1; maybe_null=1;
} }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -287,7 +287,7 @@ public: ...@@ -287,7 +287,7 @@ public:
max_length=1*MY_CHARSET_BIN_MB_MAXLEN; max_length=1*MY_CHARSET_BIN_MB_MAXLEN;
maybe_null=1; maybe_null=1;
} }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
class Item_func_dayname :public Item_func_weekday class Item_func_dayname :public Item_func_weekday
...@@ -320,7 +320,7 @@ public: ...@@ -320,7 +320,7 @@ public:
decimals=0; decimals=0;
max_length=10*MY_CHARSET_BIN_MB_MAXLEN; max_length=10*MY_CHARSET_BIN_MB_MAXLEN;
} }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -335,7 +335,7 @@ public: ...@@ -335,7 +335,7 @@ public:
decimals=0; decimals=0;
max_length=10*MY_CHARSET_BIN_MB_MAXLEN; max_length=10*MY_CHARSET_BIN_MB_MAXLEN;
} }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -542,7 +542,7 @@ public: ...@@ -542,7 +542,7 @@ public:
Item_func_from_days(Item *a) :Item_date(a) {} Item_func_from_days(Item *a) :Item_date(a) {}
const char *func_name() const { return "from_days"; } const char *func_name() const { return "from_days"; }
bool get_date(TIME *res, uint fuzzy_date); bool get_date(TIME *res, uint fuzzy_date);
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -560,7 +560,7 @@ public: ...@@ -560,7 +560,7 @@ public:
void fix_length_and_dec(); void fix_length_and_dec();
uint format_length(const String *format); uint format_length(const String *format);
bool eq(const Item *item, bool binary_cmp) const; bool eq(const Item *item, bool binary_cmp) const;
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -579,7 +579,7 @@ class Item_func_from_unixtime :public Item_date_func ...@@ -579,7 +579,7 @@ class Item_func_from_unixtime :public Item_date_func
const char *func_name() const { return "from_unixtime"; } const char *func_name() const { return "from_unixtime"; }
void fix_length_and_dec(); void fix_length_and_dec();
bool get_date(TIME *res, uint fuzzy_date); bool get_date(TIME *res, uint fuzzy_date);
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -646,7 +646,7 @@ public: ...@@ -646,7 +646,7 @@ public:
{ {
return tmp_table_field_from_field_type(table, 0); return tmp_table_field_from_field_type(table, 0);
} }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -669,7 +669,7 @@ public: ...@@ -669,7 +669,7 @@ public:
bool get_date(TIME *res, uint fuzzy_date); bool get_date(TIME *res, uint fuzzy_date);
bool eq(const Item *item, bool binary_cmp) const; bool eq(const Item *item, bool binary_cmp) const;
void print(String *str); void print(String *str);
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -687,7 +687,7 @@ class Item_extract :public Item_int_func ...@@ -687,7 +687,7 @@ class Item_extract :public Item_int_func
void fix_length_and_dec(); void fix_length_and_dec();
bool eq(const Item *item, bool binary_cmp) const; bool eq(const Item *item, bool binary_cmp) const;
void print(String *str); void print(String *str);
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -724,7 +724,7 @@ public: ...@@ -724,7 +724,7 @@ public:
max_length=args[0]->max_length; max_length=args[0]->max_length;
maybe_null= 1; maybe_null= 1;
} }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -744,7 +744,7 @@ public: ...@@ -744,7 +744,7 @@ public:
String *val_str(String *a); String *val_str(String *a);
void fix_length_and_dec(); void fix_length_and_dec();
void print(String *str); void print(String *str);
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -816,7 +816,7 @@ public: ...@@ -816,7 +816,7 @@ public:
{ {
return tmp_table_field_from_field_type(table, 0); return tmp_table_field_from_field_type(table, 0);
} }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -839,7 +839,7 @@ public: ...@@ -839,7 +839,7 @@ public:
} }
void print(String *str); void print(String *str);
const char *func_name() const { return "add_time"; } const char *func_name() const { return "add_time"; }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
class Item_func_timediff :public Item_str_func class Item_func_timediff :public Item_str_func
...@@ -879,7 +879,7 @@ public: ...@@ -879,7 +879,7 @@ public:
{ {
return tmp_table_field_from_field_type(table, 0); return tmp_table_field_from_field_type(table, 0);
} }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
class Item_func_microsecond :public Item_int_func class Item_func_microsecond :public Item_int_func
...@@ -893,7 +893,7 @@ public: ...@@ -893,7 +893,7 @@ public:
decimals=0; decimals=0;
maybe_null=1; maybe_null=1;
} }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -911,7 +911,7 @@ public: ...@@ -911,7 +911,7 @@ public:
maybe_null=1; maybe_null=1;
} }
void print(String *str); void print(String *str);
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
...@@ -958,7 +958,7 @@ public: ...@@ -958,7 +958,7 @@ public:
{ {
return tmp_table_field_from_field_type(table, 1); return tmp_table_field_from_field_type(table, 1);
} }
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
......
...@@ -42,7 +42,7 @@ public: ...@@ -42,7 +42,7 @@ public:
Item_func_xml_extractvalue(Item *a,Item *b) :Item_xml_str_func(a,b) {} Item_func_xml_extractvalue(Item *a,Item *b) :Item_xml_str_func(a,b) {}
const char *func_name() const { return "extractvalue"; } const char *func_name() const { return "extractvalue"; }
String *val_str(String *); String *val_str(String *);
virtual bool check_partition_func_processor(byte *bool_arg) { return 0;} bool check_partition_func_processor(byte *bool_arg) { return 0;}
}; };
......
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