~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Monty Taylor
  • Date: 2010-12-24 02:13:05 UTC
  • mto: This revision was merged to the branch mainline in revision 2038.
  • Revision ID: mordred@inaugust.com-20101224021305-e3slv1cyjczqorij
Changed the bzrignore file.

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
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#ifndef DRIZZLED_FUNCTIONS_TIME_NOW_H
21
 
#define DRIZZLED_FUNCTIONS_TIME_NOW_H
22
 
 
23
 
#include <drizzled/functions/time/date.h>
 
20
#ifndef DRIZZLED_FUNCTION_TIME_NOW_H
 
21
#define DRIZZLED_FUNCTION_TIME_NOW_H
 
22
 
 
23
#include <drizzled/function/time/date.h>
 
24
 
 
25
#include "drizzled/temporal.h"
 
26
 
 
27
namespace drizzled
 
28
{
24
29
 
25
30
/* Abstract CURRENT_TIMESTAMP function. See also Item_func_curtime */
26
31
 
31
36
  char buff[20*2+32];   // +32 to make my_snprintf_{8bit|ucs2} happy
32
37
  uint32_t buff_length;
33
38
  DRIZZLE_TIME ltime;
 
39
  DateTime cached_temporal;
34
40
public:
35
41
  Item_func_now() :Item_date_func() {}
36
42
  Item_func_now(Item *a) :Item_date_func(a) {}
39
45
  int save_in_field(Field *to, bool no_conversions);
40
46
  String *val_str(String *str);
41
47
  void fix_length_and_dec();
 
48
  /**
 
49
   * For NOW() and sisters, there is no argument, and we 
 
50
   * return a cached Date value that we create during fix_length_and_dec.
 
51
   *
 
52
   * Always returns true, since a DateTime can always be constructed
 
53
   * from a time_t
 
54
   *
 
55
   * @param Reference to a DateTime to populate
 
56
   */
 
57
  bool get_temporal(DateTime &temporal);
42
58
  bool get_date(DRIZZLE_TIME *res, uint32_t fuzzy_date);
43
59
  virtual void store_now_in_TIME(DRIZZLE_TIME *now_time)=0;
44
 
  bool check_vcol_func_processor(unsigned char *int_arg __attribute__((unused)))
45
 
  { return true; }
46
60
};
47
61
 
48
62
class Item_func_now_local :public Item_func_now
65
79
  virtual void store_now_in_TIME(DRIZZLE_TIME *now_time);
66
80
};
67
81
 
68
 
 
69
 
 
70
 
 
71
 
#endif /* DRIZZLED_FUNCTIONS_TIME_NOW_H */
 
82
} /* namespace drizzled */
 
83
 
 
84
#endif /* DRIZZLED_FUNCTION_TIME_NOW_H */