~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/calendar.cc

  • Committer: Brian Aker
  • Date: 2011-01-12 06:45:23 UTC
  • mto: (2073.1.4 catalogs)
  • mto: This revision was merged to the branch mainline in revision 2080.
  • Revision ID: brian@tangent.org-20110112064523-rqhptaqbph22qmj1
Remove custom error.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 * Common functions for dealing with calendrical calculations
25
25
 */
26
26
 
27
 
#include <config.h>
 
27
#include "config.h"
28
28
 
29
29
#if TIME_WITH_SYS_TIME
30
30
# include <sys/time.h>
38
38
#endif
39
39
#include <cstdlib>
40
40
 
41
 
#include <drizzled/calendar.h>
 
41
#include "drizzled/calendar.h"
42
42
 
43
43
namespace drizzled
44
44
{
333
333
 * @param Minute
334
334
 * @param Second
335
335
 */
336
 
bool in_unix_epoch_range(uint32_t year,
337
 
                         uint32_t month,
338
 
                         uint32_t day,
339
 
                         uint32_t hour,
340
 
                         uint32_t minute,
341
 
                         uint32_t second)
 
336
bool in_unix_epoch_range(uint32_t year
 
337
                       , uint32_t month
 
338
                       , uint32_t day
 
339
                       , uint32_t hour
 
340
                       , uint32_t minute
 
341
                       , uint32_t second)
342
342
{
343
343
  if (month == 0 || day == 0)
344
344
    return false;
345
 
 
346
345
  if (year < UNIX_EPOCH_MAX_YEARS
347
346
      && year >= UNIX_EPOCH_MIN_YEARS)
348
347
    return true;
349
 
 
350
348
  if (year < UNIX_EPOCH_MIN_YEARS)
351
349
    return false;
352
 
 
353
350
  if (year == UNIX_EPOCH_MAX_YEARS)
354
351
  {
355
352
    if (month > 1)
356
 
    {
357
353
      return false;
358
 
    }
359
354
    if (day > 19)
360
 
    {
361
355
      return false;
362
 
    }
363
356
    else if (day < 19)
364
 
    {
365
357
      return true;
366
 
    }
367
358
    else
368
359
    {
369
360
      /* We are on the final day of UNIX Epoch */