~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/datetime.cc

mergeĀ lp:~linuxjedi/drizzle/trunk-remove-drizzleadmin

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 * const )
 
46
                          const charset_info_st * 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)
 
161
double Field_datetime::val_real(void) const
162
162
{
163
163
  return (double) Field_datetime::val_int();
164
164
}
165
165
 
166
 
int64_t Field_datetime::val_int(void)
 
166
int64_t Field_datetime::val_int(void) const
167
167
{
168
168
  int64_t j;
169
169
 
179
179
}
180
180
 
181
181
 
182
 
String *Field_datetime::val_str(String *val_buffer,
183
 
                                String *)
 
182
String *Field_datetime::val_str(String *val_buffer, String *) const
184
183
{
185
184
  val_buffer->alloc(DateTime::MAX_STRING_LENGTH);
186
185
  val_buffer->length(DateTime::MAX_STRING_LENGTH);
217
216
  return val_buffer;
218
217
}
219
218
 
220
 
bool Field_datetime::get_date(type::Time &ltime, uint32_t fuzzydate)
 
219
bool Field_datetime::get_date(type::Time &ltime, uint32_t fuzzydate) const
221
220
{
222
221
  int64_t tmp=Field_datetime::val_int();
223
222
  uint32_t part1,part2;
237
236
  return (!(fuzzydate & TIME_FUZZY_DATE) && (!ltime.month || !ltime.day)) ? 1 : 0;
238
237
}
239
238
 
240
 
bool Field_datetime::get_time(type::Time &ltime)
 
239
bool Field_datetime::get_time(type::Time &ltime) const
241
240
{
242
241
  return Field_datetime::get_date(ltime,0);
243
242
}