~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/datetime.cc

  • Committer: Monty Taylor
  • Date: 2011-02-13 17:26:39 UTC
  • mfrom: (2157.2.2 give-in-to-pkg-config)
  • mto: This revision was merged to the branch mainline in revision 2166.
  • Revision ID: mordred@inaugust.com-20110213172639-nhy7i72sfhoq13ms
Merged in pkg-config fixes.

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
 
#include <drizzled/field/datetime.h>
24
 
#include <drizzled/error.h>
25
 
#include <drizzled/table.h>
26
 
#include <drizzled/temporal.h>
27
 
#include <drizzled/session.h>
 
23
#include "drizzled/field/datetime.h"
 
24
#include "drizzled/error.h"
 
25
#include "drizzled/table.h"
 
26
#include "drizzled/temporal.h"
 
27
#include "drizzled/session.h"
28
28
 
29
29
#include <math.h>
30
30
 
43
43
 
44
44
int Field_datetime::store(const char *from,
45
45
                          uint32_t len,
46
 
                          const charset_info_st * const )
 
46
                          const CHARSET_INFO * const )
47
47
{
48
48
  ASSERT_COLUMN_MARKED_FOR_WRITE;
49
49
  /* 
158
158
  return 0;
159
159
}
160
160
 
161
 
double Field_datetime::val_real(void) const
 
161
double Field_datetime::val_real(void)
162
162
{
163
163
  return (double) Field_datetime::val_int();
164
164
}
165
165
 
166
 
int64_t Field_datetime::val_int(void) const
 
166
int64_t Field_datetime::val_int(void)
167
167
{
168
168
  int64_t j;
169
169
 
179
179
}
180
180
 
181
181
 
182
 
String *Field_datetime::val_str(String *val_buffer, String *) const
 
182
String *Field_datetime::val_str(String *val_buffer,
 
183
                                String *)
183
184
{
184
185
  val_buffer->alloc(DateTime::MAX_STRING_LENGTH);
185
186
  val_buffer->length(DateTime::MAX_STRING_LENGTH);
216
217
  return val_buffer;
217
218
}
218
219
 
219
 
bool Field_datetime::get_date(type::Time &ltime, uint32_t fuzzydate) const
 
220
bool Field_datetime::get_date(type::Time &ltime, uint32_t fuzzydate)
220
221
{
221
222
  int64_t tmp=Field_datetime::val_int();
222
223
  uint32_t part1,part2;
236
237
  return (!(fuzzydate & TIME_FUZZY_DATE) && (!ltime.month || !ltime.day)) ? 1 : 0;
237
238
}
238
239
 
239
 
bool Field_datetime::get_time(type::Time &ltime) const
 
240
bool Field_datetime::get_time(type::Time &ltime)
240
241
{
241
242
  return Field_datetime::get_date(ltime,0);
242
243
}