summaryrefslogtreecommitdiff
path: root/sql/field.h
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2014-10-15 12:59:13 +0200
committerSergei Golubchik <serg@mariadb.org>2014-10-15 12:59:13 +0200
commitf62c12b405ba7ec80b8e2490856b83c6f5899211 (patch)
tree010605c7f145da6ea6ac14b39abc4cf700d619b1 /sql/field.h
parentf947f73b2b6d2bd246b81a9038224d2a85777520 (diff)
parentf1afc003eefe0aafd3e070c7453d9e029d8445a8 (diff)
downloadmariadb-git-f62c12b405ba7ec80b8e2490856b83c6f5899211.tar.gz
Merge 10.0.14 into 10.1
Diffstat (limited to 'sql/field.h')
-rw-r--r--sql/field.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/sql/field.h b/sql/field.h
index fed6084fda2..f1679379fe8 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -183,6 +183,29 @@ inline bool is_temporal_type(enum_field_types type)
return mysql_type_to_time_type(type) != MYSQL_TIMESTAMP_ERROR;
}
+
+/**
+ Tests if field type is temporal and has time part,
+ i.e. represents TIME, DATETIME or TIMESTAMP types in SQL.
+
+ @param type Field type, as returned by field->type().
+ @retval true If field type is temporal type with time part.
+ @retval false If field type is not temporal type with time part.
+*/
+inline bool is_temporal_type_with_time(enum_field_types type)
+{
+ switch (type)
+ {
+ case MYSQL_TYPE_TIME:
+ case MYSQL_TYPE_DATETIME:
+ case MYSQL_TYPE_TIMESTAMP:
+ return true;
+ default:
+ return false;
+ }
+}
+
+
/*
Virtual_column_info is the class to contain additional
characteristics that is specific for a virtual/computed