~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Brian Aker
  • Date: 2009-01-24 09:43:35 UTC
  • Revision ID: brian@gir-3.local-20090124094335-6qdtvc35gl5fvivz
Adding in an example singe thread scheduler

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 "config.h"
21
 
 
22
 
#include "drizzled/function/time/period_diff.h"
23
 
#include "drizzled/calendar.h"
24
 
 
25
 
namespace drizzled
26
 
{
 
20
#include <drizzled/server_includes.h>
 
21
#include CSTDINT_H
 
22
#include <drizzled/function/time/period_diff.h>
27
23
 
28
24
int64_t Item_func_period_diff::val_int()
29
25
{
30
26
  assert(fixed == 1);
31
 
  uint32_t period1= (uint32_t)args[0]->val_int();
32
 
  uint32_t period2= (uint32_t)args[1]->val_int();
 
27
  uint32_t period1= args[0]->val_int();
 
28
  uint32_t period2= args[1]->val_int();
33
29
 
34
30
  if ((null_value=args[0]->null_value || args[1]->null_value))
35
 
    return 0;
36
 
  return (int64_t) (year_month_to_months(period1) -year_month_to_months(period2));
 
31
    return 0; /* purecov: inspected */
 
32
  return (int64_t) ((long) convert_period_to_month(period1)-
 
33
                     (long) convert_period_to_month(period2));
37
34
}
38
35
 
39
 
} /* namespace drizzled */
 
36