~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/datetime.cc

  • Committer: Monty
  • Date: 2008-10-02 16:32:09 UTC
  • Revision ID: mordred@scylla.inaugust.com-20081002163209-v5art4o6p51tl30s
Various int64 constant fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
98
98
                                          (MODE_NO_ZERO_DATE |
99
99
                                           MODE_INVALID_DATES))), &error);
100
100
 
101
 
  if (nr == -1)
 
101
  if (nr == INT64_C(-1))
102
102
  {
103
103
    nr= 0;
104
104
    error= 2;
134
134
  if (time_type == DRIZZLE_TIMESTAMP_DATE ||
135
135
      time_type == DRIZZLE_TIMESTAMP_DATETIME)
136
136
  {
137
 
    tmp=((ltime->year*10000L+ltime->month*100+ltime->day)*1000000L+
 
137
    tmp=((ltime->year*10000L+ltime->month*100+ltime->day)*INT64_C(1000000)+
138
138
         (ltime->hour*10000L+ltime->minute*100+ltime->second));
139
139
    if (check_date(ltime, tmp != 0,
140
140
                   (TIME_FUZZY_DATE |
212
212
    Avoid problem with slow int64_t arithmetic and sprintf
213
213
  */
214
214
 
215
 
  part1=(long) (tmp/1000000L);
216
 
  part2=(long) (tmp - (uint64_t) part1*1000000L);
 
215
  part1=(long) (tmp/INT64_C(1000000));
 
216
  part2=(long) (tmp - (uint64_t) part1*INT64_C(1000000));
217
217
 
218
218
  pos=(char*) val_buffer->ptr() + MAX_DATETIME_WIDTH;
219
219
  *pos--=0;
243
243
{
244
244
  int64_t tmp=Field_datetime::val_int();
245
245
  uint32_t part1,part2;
246
 
  part1=(uint32_t) (tmp/1000000L);
247
 
  part2=(uint32_t) (tmp - (uint64_t) part1*1000000L);
 
246
  part1=(uint32_t) (tmp/INT64_C(1000000));
 
247
  part2=(uint32_t) (tmp - (uint64_t) part1*INT64_C(1000000));
248
248
 
249
249
  ltime->time_type=     DRIZZLE_TIMESTAMP_DATETIME;
250
250
  ltime->neg=           0;