~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/time_functions.cc

  • Committer: Lee Bieber
  • Date: 2011-01-25 17:15:03 UTC
  • mfrom: (1994.4.55 drizzle)
  • mto: This revision was merged to the branch mainline in revision 2115.
  • Revision ID: kalebral@gmail.com-20110125171503-zyx91pfdyyw9lty5
Merge Marisa - 684803: Need to update Drizzledump documentation with migration conversions / caveats
Merge Marisa - 686641: Need to document removal of multi-table update/delete from Drizzle

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
/* Functions to handle date and time */
22
22
 
23
 
#include <config.h>
24
 
#include <drizzled/error.h>
25
 
#include <drizzled/util/test.h>
26
 
#include <drizzled/tztime.h>
27
 
#include <drizzled/session.h>
28
 
#include <drizzled/time_functions.h>
 
23
#include "config.h"
 
24
#include "drizzled/error.h"
 
25
#include "drizzled/util/test.h"
 
26
#include "drizzled/tztime.h"
 
27
#include "drizzled/session.h"
 
28
#include "drizzled/time_functions.h"
29
29
 
30
30
namespace drizzled
31
31
{
124
124
}
125
125
 
126
126
 
127
 
type::timestamp_t str_to_datetime_with_warn(Session *session,
128
 
                                            const char *str, 
 
127
type::timestamp_t str_to_datetime_with_warn(const char *str, 
129
128
                                            uint32_t length, 
130
129
                                            type::Time *l_time,
131
130
                                            uint32_t flags)
132
131
{
133
132
  type::cut_t was_cut= type::VALID;
134
133
  type::timestamp_t ts_type;
 
134
  Session *session= current_session;
135
135
 
136
136
  ts_type= l_time->store(str, length,
137
137
                         (flags | (session->variables.sql_mode &
147
147
 
148
148
 
149
149
bool
150
 
str_to_time_with_warn(Session *session, const char *str, uint32_t length, type::Time *l_time)
 
150
str_to_time_with_warn(const char *str, uint32_t length, type::Time *l_time)
151
151
{
152
152
  int warning;
153
153
  bool ret_val= l_time->store(str, length, warning, type::DRIZZLE_TIMESTAMP_TIME);
154
154
  if (ret_val || warning)
155
 
    make_truncated_value_warning(session, DRIZZLE_ERROR::WARN_LEVEL_WARN,
 
155
    make_truncated_value_warning(current_session, DRIZZLE_ERROR::WARN_LEVEL_WARN,
156
156
                                 str, length, type::DRIZZLE_TIMESTAMP_TIME, NULL);
157
157
  return ret_val;
158
158
}