~drizzle-developers/ubuntu/natty/drizzle/natty

« back to all changes in this revision

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

  • Committer: Monty Taylor
  • Date: 2010-03-03 19:27:30 UTC
  • mto: (1308.1.2 trunk)
  • mto: This revision was merged to the branch mainline in revision 1278.
  • Revision ID: mordred@inaugust.com-20100303192730-o2o3nmp0lzhuatbe
Tags: upstream-2010.03.1317
ImportĀ upstreamĀ versionĀ 2010.03.1317

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 */
19
19
 
20
20
#include "config.h"
21
 
#include CSTDINT_H
 
21
 
22
22
#include "drizzled/function/time/from_unixtime.h"
23
23
#include "drizzled/session.h"
24
24
#include "drizzled/temporal.h"
27
27
#include <sstream>
28
28
#include <string>
29
29
 
 
30
namespace drizzled
 
31
{
 
32
 
30
33
void Item_func_from_unixtime::fix_length_and_dec()
31
34
{
32
35
  session= current_session;
33
36
  collation.set(&my_charset_bin);
34
37
  decimals= DATETIME_DEC;
35
 
  max_length=drizzled::DateTime::MAX_STRING_LENGTH*MY_CHARSET_BIN_MB_MAXLEN;
 
38
  max_length=DateTime::MAX_STRING_LENGTH*MY_CHARSET_BIN_MB_MAXLEN;
36
39
  maybe_null= 1;
37
40
}
38
41
 
78
81
  if ((null_value= (args[0]->null_value || tmp > TIMESTAMP_MAX_VALUE)))
79
82
    return 1;
80
83
 
81
 
  drizzled::Timestamp temporal;
 
84
  Timestamp temporal;
82
85
  if (! temporal.from_time_t((time_t) tmp))
83
86
  {
84
87
    null_value= true;
101
104
 
102
105
  return 0;
103
106
}
 
107
 
 
108
} /* namespace drizzled */