~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/temporal_interval.cc

  • Committer: Patrick Galbraith
  • Date: 2010-10-03 13:40:30 UTC
  • mto: (1812.1.3 build)
  • mto: This revision was merged to the branch mainline in revision 1813.
  • Revision ID: patg@patg-desktop-20101003134030-j13wf1e79za77jtf
Added license to start_mc.sh.in to clear up ambiguity

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2008 Sun Microsystems
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
186
186
  return false;
187
187
}
188
188
 
189
 
bool TemporalInterval::addDate(type::Time *ltime, interval_type int_type)
 
189
bool TemporalInterval::addDate(DRIZZLE_TIME *ltime, interval_type int_type)
190
190
{
191
191
  long period, sign;
192
192
 
211
211
  case INTERVAL_DAY_MINUTE:
212
212
  case INTERVAL_DAY_HOUR:
213
213
    int64_t sec, days, daynr, microseconds, extra_sec;
214
 
    ltime->time_type= type::DRIZZLE_TIMESTAMP_DATETIME; // Return full date
 
214
    ltime->time_type= DRIZZLE_TIMESTAMP_DATETIME; // Return full date
215
215
    microseconds= ltime->second_part + sign*second_part;
216
216
    extra_sec= microseconds/1000000L;
217
217
    microseconds= microseconds%1000000L;
241
241
    /* Day number from year 0 to 9999-12-31 */
242
242
    if ((uint64_t) daynr > MAX_DAY_NUMBER)
243
243
      goto invalid_date;
244
 
    get_date_from_daynr((long) daynr, &ltime->year, &ltime->month, &ltime->day);
 
244
    get_date_from_daynr((long) daynr, &ltime->year, &ltime->month,
 
245
        &ltime->day);
245
246
    break;
246
247
  case INTERVAL_DAY:
247
248
  case INTERVAL_WEEK: