~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

Reverted my change to interval_list

Show diffs side-by-side

added added

removed removed

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