summaryrefslogtreecommitdiff
path: root/sql/item_timefunc.h
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-11-27 19:50:10 +0100
committerSergei Golubchik <serg@mariadb.org>2016-12-12 20:44:41 +0100
commit180065ebb0db78ea5c955b54c9f7997dbcba3121 (patch)
tree849adc822b510535367bdffa1153809091fb64df /sql/item_timefunc.h
parent1db438c83386e0e58487056d6ea25a0f5e97f4d9 (diff)
downloadmariadb-git-180065ebb0db78ea5c955b54c9f7997dbcba3121.tar.gz
Item::print(): remove redundant parentheses
by introducing new Item::precedence() method and using it to decide whether parentheses are required
Diffstat (limited to 'sql/item_timefunc.h')
-rw-r--r--sql/item_timefunc.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h
index 949401e19fd..d8f69e2098d 100644
--- a/sql/item_timefunc.h
+++ b/sql/item_timefunc.h
@@ -918,6 +918,7 @@ public:
bool get_date(MYSQL_TIME *res, ulonglong fuzzy_date);
bool eq(const Item *item, bool binary_cmp) const;
void print(String *str, enum_query_type query_type);
+ enum precedence precedence() const { return ADDINTERVAL_PRECEDENCE; }
bool need_parentheses_in_default() { return true; }
Item *get_copy(THD *thd, MEM_ROOT *mem_root)
{ return get_item_copy<Item_date_add_interval>(thd, mem_root, this); }