~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Monty Taylor
  • Date: 2010-07-09 14:06:50 UTC
  • Revision ID: mordred@inaugust.com-20100709140650-ojeih829v3wbdkyv
Added include guard for generator.h to make cpplint happy.

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
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#include <config.h>
 
20
#include "config.h"
21
21
 
22
 
#include <drizzled/function/time/to_days.h>
23
 
#include <drizzled/error.h>
24
 
#include <drizzled/temporal.h>
 
22
#include "drizzled/function/time/to_days.h"
 
23
#include "drizzled/error.h"
 
24
#include "drizzled/temporal.h"
25
25
 
26
26
namespace drizzled
27
27
{
82
82
          return false;
83
83
        }
84
84
 
85
 
        if (res != &tmp)
86
 
        {
87
 
          tmp.copy(*res);
88
 
        }
89
 
 
90
 
        if (! temporal.from_string(tmp.c_ptr(), tmp.length()))
 
85
        if (! temporal.from_string(res->c_ptr(), res->length()))
91
86
        {
92
87
          /* 
93
88
          * Could not interpret the function argument as a temporal value, 
94
89
          * so throw an error and return 0
95
90
          */
96
 
          my_error(ER_INVALID_DATETIME_VALUE, MYF(0), tmp.c_ptr());
 
91
          my_error(ER_INVALID_DATETIME_VALUE, MYF(0), res->c_ptr());
97
92
          return 0;
98
93
        }
99
94
      }
125
120
          return false;
126
121
        }
127
122
 
128
 
        if (res != &tmp)
129
 
        {
130
 
          tmp.copy(*res);
131
 
        }
132
 
 
133
 
        my_error(ER_INVALID_DATETIME_VALUE, MYF(0), tmp.c_ptr());
 
123
        my_error(ER_INVALID_DATETIME_VALUE, MYF(0), res->c_ptr());
134
124
        return 0;
135
125
      }
136
126
  }
184
174
          return 0;
185
175
        }
186
176
 
187
 
        if (res != &tmp)
188
 
        {
189
 
          tmp.copy(*res);
190
 
        }
191
 
 
192
 
        if (! temporal.from_string(tmp.c_ptr(), tmp.length()))
 
177
        if (! temporal.from_string(res->c_ptr(), res->length()))
193
178
        {
194
179
          /* 
195
180
          * Could not interpret the function argument as a temporal value, 
196
181
          * so throw an error and return 0
197
182
          */
198
 
          my_error(ER_INVALID_DATETIME_VALUE, MYF(0), tmp.c_ptr());
 
183
          my_error(ER_INVALID_DATETIME_VALUE, MYF(0), res->c_ptr());
199
184
          return 0;
200
185
        }
201
186
      }
227
212
          return 0;
228
213
        }
229
214
 
230
 
        if (res != &tmp)
231
 
        {
232
 
          tmp.copy(*res);
233
 
        }
234
 
 
235
 
        my_error(ER_INVALID_DATETIME_VALUE, MYF(0), tmp.c_ptr());
 
215
        my_error(ER_INVALID_DATETIME_VALUE, MYF(0), res->c_ptr());
236
216
        return 0;
237
217
      }
238
218
  }