~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Lee Bieber
  • Date: 2011-03-29 22:31:41 UTC
  • mfrom: (2257.1.3 build)
  • Revision ID: kalebral@gmail.com-20110329223141-yxc22h3l2he58sk0
Merge Andrew - 743842: Build failure using GCC 4.6
Merge Stewart - 738022: CachedDirectory silently fails to add entries if stat() fails
Merge Olaf - Common fwd: add copyright, add more declaration

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"
21
 
 
22
 
#include "drizzled/temporal.h"
23
 
#include "drizzled/error.h"
24
 
#include "drizzled/session.h"
25
 
#include "drizzled/function/time/month.h"
26
 
 
27
 
namespace drizzled
28
 
{
 
20
#include <config.h>
 
21
 
 
22
#include <drizzled/temporal.h>
 
23
#include <drizzled/error.h>
 
24
#include <drizzled/session.h>
 
25
#include <drizzled/function/time/month.h>
 
26
#include <drizzled/typelib.h>
 
27
#include <drizzled/system_variables.h>
 
28
 
 
29
namespace drizzled {
29
30
 
30
31
int64_t Item_func_month::val_int()
31
32
{
116
117
  }
117
118
  const char *month_name;
118
119
  uint32_t   month= (uint) val_int();
119
 
  Session *session= current_session;
120
120
 
121
121
  if (null_value || !month)
122
122
  {
124
124
    return (String*) 0;
125
125
  }
126
126
  null_value=0;
127
 
  month_name= session->variables.lc_time_names->month_names->type_names[month-1];
 
127
  month_name= getSession().variables.lc_time_names->month_names->type_names[month-1];
128
128
  str->set(month_name, strlen(month_name), system_charset_info);
129
129
  return str;
130
130
}