summaryrefslogtreecommitdiff
path: root/sql/item_func.h
diff options
context:
space:
mode:
authorMattias Jonsson <mattias.jonsson@oracle.com>2011-01-10 15:08:31 +0100
committerMattias Jonsson <mattias.jonsson@oracle.com>2011-01-10 15:08:31 +0100
commit1a46e493dd24682af39d15fc9fbeaf69c9e7e7e8 (patch)
tree23ed20d7372307636b325211cd801777b7e6e0d0 /sql/item_func.h
parent67b227c55d86276095cead86dda8810b8d72928a (diff)
parent99e95e8dabdaf5cb87529209b0602a76db9c8324 (diff)
downloadmariadb-git-1a46e493dd24682af39d15fc9fbeaf69c9e7e7e8.tar.gz
Manual merge from 5.1
Diffstat (limited to 'sql/item_func.h')
-rw-r--r--sql/item_func.h42
1 files changed, 41 insertions, 1 deletions
diff --git a/sql/item_func.h b/sql/item_func.h
index 1139442fe76..937907c9404 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -237,6 +237,7 @@ public:
{
return (error == E_DEC_OVERFLOW) ? raise_decimal_overflow() : error;
}
+
bool has_timestamp_args()
{
DBUG_ASSERT(fixed == TRUE);
@@ -248,6 +249,45 @@ public:
}
return FALSE;
}
+
+ bool has_date_args()
+ {
+ DBUG_ASSERT(fixed == TRUE);
+ for (uint i= 0; i < arg_count; i++)
+ {
+ if (args[i]->type() == Item::FIELD_ITEM &&
+ (args[i]->field_type() == MYSQL_TYPE_DATE ||
+ args[i]->field_type() == MYSQL_TYPE_DATETIME))
+ return TRUE;
+ }
+ return FALSE;
+ }
+
+ bool has_time_args()
+ {
+ DBUG_ASSERT(fixed == TRUE);
+ for (uint i= 0; i < arg_count; i++)
+ {
+ if (args[i]->type() == Item::FIELD_ITEM &&
+ (args[i]->field_type() == MYSQL_TYPE_TIME ||
+ args[i]->field_type() == MYSQL_TYPE_DATETIME))
+ return TRUE;
+ }
+ return FALSE;
+ }
+
+ bool has_datetime_args()
+ {
+ DBUG_ASSERT(fixed == TRUE);
+ for (uint i= 0; i < arg_count; i++)
+ {
+ if (args[i]->type() == Item::FIELD_ITEM &&
+ args[i]->field_type() == MYSQL_TYPE_DATETIME)
+ return TRUE;
+ }
+ return FALSE;
+ }
+
/*
We assume the result of any function that has a TIMESTAMP argument to be
timezone-dependent, since a TIMESTAMP value in both numeric and string
@@ -256,7 +296,7 @@ public:
representation of a TIMESTAMP argument verbatim, and thus does not depend on
the timezone.
*/
- virtual bool is_timezone_dependent_processor(uchar *bool_arg)
+ virtual bool check_valid_arguments_processor(uchar *bool_arg)
{
return has_timestamp_args();
}