~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Monty Taylor
  • Date: 2009-03-08 23:45:12 UTC
  • mto: (923.2.1 mordred)
  • mto: This revision was merged to the branch mainline in revision 921.
  • Revision ID: mordred@inaugust.com-20090308234512-tqkygxtu1iaig23s
Removed C99 isnan() usage, which allows us to remove the util/math.{cc,h} workarounds. Yay for standards!

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
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#include <config.h>
21
 
 
 
20
#include <drizzled/server_includes.h>
 
21
#include CSTDINT_H
22
22
#include <drizzled/function/time/dayname.h>
23
23
#include <drizzled/session.h>
24
 
#include <drizzled/typelib.h>
25
 
 
26
 
namespace drizzled
27
 
{
28
24
 
29
25
String* Item_func_dayname::val_str(String* str)
30
26
{
31
27
  assert(fixed == 1);
32
28
  uint32_t weekday=(uint) val_int();            // Always Item_func_daynr()
33
29
  const char *day_name;
 
30
  Session *session= current_session;
34
31
 
35
32
  if (null_value)
36
33
    return (String*) 0;
37
34
 
38
 
  day_name= getSession().variables.lc_time_names->day_names->type_names[weekday];
 
35
  day_name= session->variables.lc_time_names->day_names->type_names[weekday];
39
36
  str->set(day_name, strlen(day_name), system_charset_info);
40
37
  return str;
41
38
}
42
39
 
43
 
} /* namespace drizzled */