summaryrefslogtreecommitdiff
path: root/sql/item.h
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2015-09-21 12:21:46 +0400
committerAlexander Barkov <bar@mariadb.org>2015-09-21 12:21:46 +0400
commit1956340247eaa14138e2af0b0e2db29cc6bd14e8 (patch)
tree3f6ee5c3f69fc343bfcd8412fa7f1c8568429806 /sql/item.h
parentf727fb45d4aa6cb3b483366f7b6ab7bbb2a5923c (diff)
downloadmariadb-git-1956340247eaa14138e2af0b0e2db29cc6bd14e8.tar.gz
Removing global function agg_item_charsets_for_string_result().
Moving agg_arg_charsets_for_string_result() and agg_arg_charsets_for_string_result_with_comparison() inside "protected" section in Item_func_or_sum.
Diffstat (limited to 'sql/item.h')
-rw-r--r--sql/item.h43
1 files changed, 33 insertions, 10 deletions
diff --git a/sql/item.h b/sql/item.h
index 45f19b860be..9142b3ef447 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -2162,16 +2162,6 @@ bool agg_item_set_converter(DTCollation &coll, const char *fname,
bool agg_item_charsets(DTCollation &c, const char *name,
Item **items, uint nitems, uint flags, int item_sep);
inline bool
-agg_item_charsets_for_string_result(DTCollation &c, const char *name,
- Item **items, uint nitems,
- int item_sep= 1)
-{
- uint flags= MY_COLL_ALLOW_SUPERSET_CONV |
- MY_COLL_ALLOW_COERCIBLE_CONV |
- MY_COLL_ALLOW_NUMERIC_CONV;
- return agg_item_charsets(c, name, items, nitems, flags, item_sep);
-}
-inline bool
agg_item_charsets_for_comparison(DTCollation &c, const char *name,
Item **items, uint nitems,
int item_sep= 1)
@@ -3626,6 +3616,39 @@ public:
*/
class Item_func_or_sum: public Item_result_field, public Item_args
{
+protected:
+ /*
+ Aggregate arguments for string result, e.g: CONCAT(a,b)
+ - convert to @@character_set_connection if all arguments are numbers
+ - allow DERIVATION_NONE
+ */
+ bool agg_arg_charsets_for_string_result(DTCollation &c,
+ Item **items, uint nitems,
+ int item_sep= 1)
+ {
+ uint flags= MY_COLL_ALLOW_SUPERSET_CONV |
+ MY_COLL_ALLOW_COERCIBLE_CONV |
+ MY_COLL_ALLOW_NUMERIC_CONV;
+ return agg_item_charsets(c, func_name(), items, nitems, flags, item_sep);
+ }
+ /*
+ Aggregate arguments for string result, when some comparison
+ is involved internally, e.g: REPLACE(a,b,c)
+ - convert to @@character_set_connection if all arguments are numbers
+ - disallow DERIVATION_NONE
+ */
+ bool agg_arg_charsets_for_string_result_with_comparison(DTCollation &c,
+ Item **items,
+ uint nitems,
+ int item_sep= 1)
+ {
+ uint flags= MY_COLL_ALLOW_SUPERSET_CONV |
+ MY_COLL_ALLOW_COERCIBLE_CONV |
+ MY_COLL_ALLOW_NUMERIC_CONV |
+ MY_COLL_DISALLOW_NONE;
+ return agg_item_charsets(c, func_name(), items, nitems, flags, item_sep);
+ }
+
public:
Item_func_or_sum(THD *thd): Item_result_field(thd), Item_args() {}
Item_func_or_sum(THD *thd, Item *a): Item_result_field(thd), Item_args(a) { }