~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/time/unix_timestamp.cc

Merge with trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#include "config.h"
21
21
 
22
22
#include <drizzled/function/time/unix_timestamp.h>
23
 
#include <drizzled/field/timestamp.h>
 
23
#include <drizzled/field/epoch.h>
24
24
#include <drizzled/session.h>
25
25
 
26
26
#include "drizzled/temporal.h"
35
35
  assert(fixed == 1);
36
36
  if (arg_count == 0)
37
37
    return (int64_t) current_session->query_start();
 
38
 
38
39
  if (args[0]->type() == FIELD_ITEM)
39
40
  {                                             // Optimize timestamp field
40
41
    Field *field=((Item_field*) args[0])->field;
41
42
    if (field->type() == DRIZZLE_TYPE_TIMESTAMP)
42
 
      return ((Field_timestamp*) field)->get_timestamp(&null_value);
 
43
      return ((field::Epoch::pointer) field)->get_timestamp(&null_value);
43
44
  }
44
45
 
45
46
  if (get_arg0_date(&ltime, 0))