~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/time/now.h

  • Committer: Brian Aker
  • Date: 2011-02-14 05:47:07 UTC
  • mto: This revision was merged to the branch mainline in revision 2167.
  • Revision ID: brian@tangent.org-20110214054707-61nsqgg1g4w1zhx1
Merge in all changes for current_session, etc.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems
 
4
 *  Copyright (C) 2008 Sun Microsystems, Inc.
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
33
33
{
34
34
protected:
35
35
  int64_t value;
36
 
  char buff[20*2+32];   // +32 to make my_snprintf_{8bit|ucs2} happy
 
36
  char buff[type::Time::MAX_STRING_LENGTH];
37
37
  uint32_t buff_length;
38
 
  DRIZZLE_TIME ltime;
 
38
  type::Time ltime;
39
39
  DateTime cached_temporal;
 
40
 
40
41
public:
41
42
  Item_func_now() :Item_date_func() {}
42
43
  Item_func_now(Item *a) :Item_date_func(a) {}
55
56
   * @param Reference to a DateTime to populate
56
57
   */
57
58
  bool get_temporal(DateTime &temporal);
58
 
  bool get_date(DRIZZLE_TIME *res, uint32_t fuzzy_date);
59
 
  virtual void store_now_in_TIME(DRIZZLE_TIME *now_time)=0;
 
59
  bool get_date(type::Time &res, uint32_t fuzzy_date);
 
60
  virtual void store_now_in_TIME(type::Time &now_time)=0;
60
61
};
61
62
 
62
63
class Item_func_now_local :public Item_func_now
65
66
  Item_func_now_local() :Item_func_now() {}
66
67
  Item_func_now_local(Item *a) :Item_func_now(a) {}
67
68
  const char *func_name() const { return "now"; }
68
 
  virtual void store_now_in_TIME(DRIZZLE_TIME *now_time);
 
69
  virtual void store_now_in_TIME(type::Time &now_time);
69
70
  virtual enum Functype functype() const { return NOW_FUNC; }
70
71
};
71
72
 
76
77
  Item_func_now_utc() :Item_func_now() {}
77
78
  Item_func_now_utc(Item *a) :Item_func_now(a) {}
78
79
  const char *func_name() const { return "utc_timestamp"; }
79
 
  virtual void store_now_in_TIME(DRIZZLE_TIME *now_time);
 
80
  virtual void store_now_in_TIME(type::Time &now_time);
80
81
};
81
82
 
82
83
} /* namespace drizzled */