diff options
author | Mattias Jonsson <mattias.jonsson@oracle.com> | 2011-01-04 14:13:20 +0100 |
---|---|---|
committer | Mattias Jonsson <mattias.jonsson@oracle.com> | 2011-01-04 14:13:20 +0100 |
commit | 16994abf9a113187576691417f7430f48e514087 (patch) | |
tree | 61f3487ebf4903ac71afb0d5811427493546f8b0 /sql/item_func.h | |
parent | ee12d72444beedc9b2bb7bbdb46b18f10099909b (diff) | |
parent | 991815352259545d80dc1049d65854b08bd799c4 (diff) | |
download | mariadb-git-16994abf9a113187576691417f7430f48e514087.tar.gz |
merge
Diffstat (limited to 'sql/item_func.h')
-rw-r--r-- | sql/item_func.h | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/sql/item_func.h b/sql/item_func.h index a280477a4b2..e9d91b56318 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -189,6 +189,7 @@ public: null_value=1; return 0.0; } + bool has_timestamp_args() { DBUG_ASSERT(fixed == TRUE); @@ -200,6 +201,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 @@ -208,7 +248,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(); } |