~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to server/time.cc

MergedĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
 
64
64
int calc_weekday(long daynr,bool sunday_first_day_of_week)
65
65
{
66
 
  DBUG_ENTER("calc_weekday");
67
 
  DBUG_RETURN ((int) ((daynr + 5L + (sunday_first_day_of_week ? 1L : 0L)) % 7));
 
66
  return ((int) ((daynr + 5L + (sunday_first_day_of_week ? 1L : 0L)) % 7));
68
67
}
69
68
 
70
69
/*
144
143
{
145
144
  uint year,temp,leap_day,day_of_year,days_in_year;
146
145
  uchar *month_pos;
147
 
  DBUG_ENTER("get_date_from_daynr");
148
146
 
149
147
  if (daynr <= 365L || daynr >= 3652500)
150
148
  {                                             /* Fix if wrong daynr */
178
176
    *ret_year=year;
179
177
    *ret_day=day_of_year+leap_day;
180
178
  }
181
 
  DBUG_VOID_RETURN;
 
179
  return;
182
180
}
183
181
 
184
182
        /* Functions to handle periods */
557
555
      return 0;
558
556
    break;
559
557
  default:
560
 
    DBUG_ASSERT(1);
 
558
    assert(1);
561
559
    break;
562
560
  }
563
561
  return 1;                                     // Error
668
666
  case MYSQL_TIMESTAMP_TIME:
669
667
    return format->time_format;
670
668
  default:
671
 
    DBUG_ASSERT(0);                             // Impossible
 
669
    assert(0);                          // Impossible
672
670
    return 0;
673
671
  }
674
672
}