summaryrefslogtreecommitdiff
path: root/sql/item_timefunc.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item_timefunc.h')
-rw-r--r--sql/item_timefunc.h32
1 files changed, 14 insertions, 18 deletions
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h
index d867433ef91..4478c3df266 100644
--- a/sql/item_timefunc.h
+++ b/sql/item_timefunc.h
@@ -242,8 +242,7 @@ public:
}
Field *tmp_table_field(TABLE *t_arg)
{
- if (!t_arg) return result_field;
- return new Field_date(maybe_null, name, t_arg);
+ return (!t_arg) ? result_field : new Field_date(maybe_null, name, t_arg);
}
unsigned int size_of() { return sizeof(*this);}
};
@@ -261,9 +260,9 @@ public:
}
Field *tmp_table_field(TABLE *t_arg)
{
- if (!t_arg) return result_field;
- return new Field_datetime(maybe_null, name, t_arg);
- }
+ return (!t_arg) ? result_field : new Field_datetime(maybe_null, name,
+ t_arg);
+ }
unsigned int size_of() { return sizeof(*this);}
};
@@ -289,8 +288,7 @@ public:
}
Field *tmp_table_field(TABLE *t_arg)
{
- if (!t_arg) return result_field;
- return new Field_time(maybe_null, name, t_arg);
+ return (!t_arg) ? result_field : new Field_time(maybe_null, name, t_arg);
}
unsigned int size_of() { return sizeof(*this);}
};
@@ -386,11 +384,11 @@ public:
}
Field *tmp_table_field(TABLE *t_arg)
{
- if (!t_arg) return result_field;
- return new Field_time(maybe_null, name, t_arg);
- }
+ return (!t_arg) ? result_field : new Field_time(maybe_null, name, t_arg);
+ }
};
+
enum interval_type { INTERVAL_YEAR, INTERVAL_MONTH, INTERVAL_DAY,
INTERVAL_HOUR, INTERVAL_MINUTE, INTERVAL_SECOND,
INTERVAL_YEAR_MONTH, INTERVAL_DAY_HOUR,
@@ -452,8 +450,7 @@ public:
}
Field *tmp_table_field(TABLE *t_arg)
{
- if (!t_arg) return result_field;
- return new Field_date(maybe_null, name, t_arg);
+ return (!t_arg) ? result_field : new Field_date(maybe_null, name, t_arg);
}
};
@@ -468,9 +465,8 @@ public:
}
Field *tmp_table_field(TABLE *t_arg)
{
- if (!t_arg) return result_field;
- return new Field_time(maybe_null, name, t_arg);
- }
+ return (!t_arg) ? result_field : new Field_time(maybe_null, name, t_arg);
+ }
};
class Item_datetime_typecast :public Item_typecast
@@ -484,7 +480,7 @@ public:
}
Field *tmp_table_field(TABLE *t_arg)
{
- if (!t_arg) return result_field;
- return new Field_datetime(maybe_null, name, t_arg);
- }
+ return (!t_arg) ? result_field : new Field_datetime(maybe_null, name,
+ t_arg);
+ }
};