~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/date.cc

  • Committer: Lee Bieber
  • Date: 2011-02-11 20:30:05 UTC
  • mfrom: (2157.1.3 build)
  • Revision ID: kalebral@gmail.com-20110211203005-757o1y2yf78dxzqr
Merge Stewart - 716848: drizzleimport displays wrong program_name
Merge Stewart - update README file
Merge Andrew and Joe - Exposes the InnoDB SYS_REPLICATION_LOG to data_dictionary so that it is fast and fixes many issues we have been having

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#include <config.h>
 
21
#include "config.h"
22
22
#include <boost/lexical_cast.hpp>
23
23
 
24
 
#include <drizzled/field/date.h>
25
 
#include <drizzled/error.h>
26
 
#include <drizzled/table.h>
27
 
#include <drizzled/temporal.h>
28
 
#include <drizzled/session.h>
29
 
#include <drizzled/time_functions.h>
30
 
#include <drizzled/current_session.h>
 
24
#include "drizzled/field/date.h"
 
25
#include "drizzled/error.h"
 
26
#include "drizzled/table.h"
 
27
#include "drizzled/temporal.h"
 
28
#include "drizzled/session.h"
 
29
#include "drizzled/time_functions.h"
31
30
 
32
31
#include <math.h>
33
32
 
173
172
  return error;
174
173
}
175
174
 
176
 
double Field_date::val_real(void) const
 
175
double Field_date::val_real(void)
177
176
{
178
177
  return (double) Field_date::val_int();
179
178
}
180
179
 
181
 
int64_t Field_date::val_int(void) const
 
180
int64_t Field_date::val_int(void)
182
181
{
183
182
  uint32_t j;
184
183
 
189
188
  return (int64_t) j;
190
189
}
191
190
 
192
 
String *Field_date::val_str(String *val_buffer, String *) const
 
191
String *Field_date::val_str(String *val_buffer, String *)
193
192
{
194
193
  val_buffer->alloc(field_length);
195
194
  val_buffer->length(field_length);
217
216
  return val_buffer;
218
217
}
219
218
 
220
 
bool Field_date::get_date(type::Time &ltime, uint32_t fuzzydate) const
 
219
bool Field_date::get_date(type::Time &ltime, uint32_t fuzzydate)
221
220
{
222
221
  uint32_t tmp=(uint32_t) uint4korr(ptr);
223
222
  ltime.day=            (int) (tmp%100);
230
229
          1 : 0);
231
230
}
232
231
 
233
 
bool Field_date::get_time(type::Time &ltime) const
 
232
bool Field_date::get_time(type::Time &ltime)
234
233
{
235
234
  return Field_date::get_date(ltime ,0);
236
235
}