~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: lbieber
  • Date: 2010-10-02 19:48:35 UTC
  • mfrom: (1730.6.19 drizzle-make-lcov)
  • Revision ID: lbieber@orisndriz08-20101002194835-q5zd9qc4lvx1xnfo
Merge Hartmut - clean up lex, now require flex to build, also "make lcov" improvements

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
34
34
  if (! get_temporal(temporal))
35
35
    return (String *) NULL; /* get_temporal throws error. */
36
36
 
37
 
  if (str->alloc(type::Time::MAX_STRING_LENGTH))
 
37
  if (str->alloc(MAX_DATE_STRING_REP_LENGTH))
38
38
  {
39
39
    null_value= true;
40
40
    return (String *) NULL;
41
41
  }
42
42
 
43
43
  /* Convert the Date to a string and return it */
44
 
  size_t new_length;
45
 
  new_length= temporal.to_string(str->c_ptr(), type::Time::MAX_STRING_LENGTH);
46
 
  assert(new_length < type::Time::MAX_STRING_LENGTH);
 
44
  int new_length;
 
45
  new_length= temporal.to_string(str->c_ptr(), MAX_DATE_STRING_REP_LENGTH);
 
46
  assert(new_length < MAX_DATE_STRING_REP_LENGTH);
47
47
  str->length(new_length);
48
48
  return str;
49
49
}