~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

This will now require someone to do a --plugin-add in order to have csv,
archive, or blackhole running.

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, Inc.
 
4
 *  Copyright (C) 2008 Sun Microsystems
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
38
38
String *Item_func_makedate::val_str(String *str)
39
39
{
40
40
  assert(fixed == 1);
41
 
  type::Time l_time;
 
41
  DRIZZLE_TIME l_time;
42
42
  long daynr=  (long) args[1]->val_int();
43
43
  long year= (long) args[0]->val_int();
44
44
  long days;
56
56
  {
57
57
    null_value=0;
58
58
    get_date_from_daynr(days,&l_time.year,&l_time.month,&l_time.day);
59
 
    if (str->alloc(type::Time::MAX_STRING_LENGTH))
 
59
    if (str->alloc(MAX_DATE_STRING_REP_LENGTH))
60
60
      goto err;
61
 
 
62
 
    l_time.convert(*str, type::DRIZZLE_TIMESTAMP_DATE);
63
 
 
 
61
    make_date(&l_time, str);
64
62
    return str;
65
63
  }
66
64
 
83
81
int64_t Item_func_makedate::val_int()
84
82
{
85
83
  assert(fixed == 1);
86
 
  type::Time l_time;
 
84
  DRIZZLE_TIME l_time;
87
85
  long daynr=  (long) args[1]->val_int();
88
86
  long year= (long) args[0]->val_int();
89
87
  long days;