summaryrefslogtreecommitdiff
path: root/sql/item_xmlfunc.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2015-03-12 13:40:52 +0400
committerAlexander Barkov <bar@mariadb.org>2015-03-12 13:40:52 +0400
commitba3573cae8f0d269452cc6213f1a8243e455830e (patch)
treee70ce47a61392beb911a2856b34f84634fb534ac /sql/item_xmlfunc.cc
parenta71e2d23bd08ca041a953df44f2235a8ef20bfcc (diff)
downloadmariadb-git-ba3573cae8f0d269452cc6213f1a8243e455830e.tar.gz
Clean-up:
- Renaming Item::is_bool_func() to is_bool_type(), to avoid assumption that the item is an Item_func derivant. - Deriving Item_func_spatial_rel from Item_bool_func rather than Item_int_func
Diffstat (limited to 'sql/item_xmlfunc.cc')
-rw-r--r--sql/item_xmlfunc.cc12
1 files changed, 5 insertions, 7 deletions
diff --git a/sql/item_xmlfunc.cc b/sql/item_xmlfunc.cc
index f8bf7cbf93a..24441cd80e8 100644
--- a/sql/item_xmlfunc.cc
+++ b/sql/item_xmlfunc.cc
@@ -392,7 +392,7 @@ class Item_bool :public Item_int
public:
Item_bool(int32 i): Item_int(i) {}
const char *func_name() const { return "xpath_bool"; }
- bool is_bool_func() { return 1; }
+ bool is_bool_type() { return true; }
};
@@ -402,15 +402,14 @@ public:
* a node-set is true if and only if it is non-empty
* a string is true if and only if its length is non-zero
*/
-class Item_xpath_cast_bool :public Item_int_func
+class Item_xpath_cast_bool :public Item_bool_func
{
String *pxml;
String tmp_value;
public:
Item_xpath_cast_bool(Item *a, String *pxml_arg)
- :Item_int_func(a), pxml(pxml_arg) {}
+ :Item_bool_func(a), pxml(pxml_arg) {}
const char *func_name() const { return "xpath_cast_bool"; }
- bool is_bool_func() { return 1; }
longlong val_int()
{
if (args[0]->type() == XPATH_NODESET)
@@ -568,7 +567,6 @@ public:
:Item_bool_func(nodeset,cmpfunc), pxml(p) {}
enum Type type() const { return XPATH_NODESET_CMP; };
const char *func_name() const { return "xpath_nodeset_to_const_comparator"; }
- bool is_bool_func() { return 1; }
bool check_vcol_func_processor(uchar *int_arg)
{
return trace_unsupported_by_check_vcol_func_processor(func_name());
@@ -823,7 +821,7 @@ String *Item_nodeset_func_elementbyindex::val_nodeset(String *nodeset)
flt->pos,
size);
int index= (int) (args[1]->val_int()) - 1;
- if (index >= 0 && (flt->pos == (uint) index || args[1]->is_bool_func()))
+ if (index >= 0 && (flt->pos == (uint) index || args[1]->is_bool_type()))
((XPathFilter*)nodeset)->append_element(flt->num, pos++);
}
return nodeset;
@@ -1732,7 +1730,7 @@ my_xpath_parse_AxisSpecifier_NodeTest_opt_Predicate_list(MY_XPATH *xpath)
xpath->item= nodeset2bool(xpath, xpath->item);
- if (xpath->item->is_bool_func())
+ if (xpath->item->is_bool_type())
{
xpath->context= new Item_nodeset_func_predicate(prev_context,
xpath->item,