~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/time/period_diff.cc

  • Committer: Jay Pipes
  • Date: 2009-02-28 17:49:35 UTC
  • mto: (910.2.6 mordred-noatomics)
  • mto: This revision was merged to the branch mainline in revision 908.
  • Revision ID: jpipes@serialcoder-20090228174935-yfgsw7m0n9gx8pka
Merging in old r903 temporal changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#include <drizzled/server_includes.h>
 
20
#include "drizzled/server_includes.h"
21
21
#include CSTDINT_H
22
 
#include <drizzled/function/time/period_diff.h>
 
22
#include "drizzled/function/time/period_diff.h"
 
23
#include "drizzled/calendar.h"
23
24
 
24
25
int64_t Item_func_period_diff::val_int()
25
26
{
29
30
 
30
31
  if ((null_value=args[0]->null_value || args[1]->null_value))
31
32
    return 0; /* purecov: inspected */
32
 
  return (int64_t) ((long) convert_period_to_month(period1)-
33
 
                     (long) convert_period_to_month(period2));
 
33
  return (int64_t) (year_month_to_months(period1) -year_month_to_months(period2));
34
34
}
35
 
 
36