summaryrefslogtreecommitdiff
path: root/sql/item.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item.h')
-rw-r--r--sql/item.h35
1 files changed, 29 insertions, 6 deletions
diff --git a/sql/item.h b/sql/item.h
index 0c6465f98f6..b0d3666ead7 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -15,7 +15,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
#ifdef USE_PRAGMA_INTERFACE
@@ -6782,21 +6782,44 @@ public:
class Item_cache_real: public Item_cache
{
+protected:
double value;
public:
- Item_cache_real(THD *thd): Item_cache(thd, &type_handler_double),
- value(0) {}
-
+ Item_cache_real(THD *thd, const Type_handler *h)
+ :Item_cache(thd, h),
+ value(0)
+ {}
double val_real();
longlong val_int();
- String* val_str(String *str);
my_decimal *val_decimal(my_decimal *);
bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate)
{ return get_date_from_real(thd, ltime, fuzzydate); }
bool cache_value();
Item *convert_to_basic_const_item(THD *thd);
+};
+
+
+class Item_cache_double: public Item_cache_real
+{
+public:
+ Item_cache_double(THD *thd)
+ :Item_cache_real(thd, &type_handler_double)
+ { }
+ String* val_str(String *str);
+ Item *get_copy(THD *thd)
+ { return get_item_copy<Item_cache_double>(thd, this); }
+};
+
+
+class Item_cache_float: public Item_cache_real
+{
+public:
+ Item_cache_float(THD *thd)
+ :Item_cache_real(thd, &type_handler_float)
+ { }
+ String* val_str(String *str);
Item *get_copy(THD *thd)
- { return get_item_copy<Item_cache_real>(thd, this); }
+ { return get_item_copy<Item_cache_float>(thd, this); }
};