~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Lee Bieber
  • Date: 2010-12-15 16:23:36 UTC
  • mfrom: (1995.1.2 build)
  • Revision ID: kalebral@gmail.com-20101215162336-juntyt4gw4vgohg4
Merge Andrew - fix bug 628912: Crash / segfault in drizzled::Item_func::arguments (this=0x35) at ./drizzled/function/func.h
Merge Andrew - 663919: next query after KILL QUERY will error

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;