~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/temporal_interval.cc

  • Committer: Monty Taylor
  • Date: 2009-08-17 18:46:08 UTC
  • mto: (1182.1.1 staging)
  • mto: This revision was merged to the branch mainline in revision 1183.
  • Revision ID: mordred@inaugust.com-20090817184608-0b2emowpjr9m6le7
"Fixed" the deadlock test. I'd still like someone to look at what's going on here.

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
 
#include "drizzled/internal/m_string.h"
22
 
#include "drizzled/error.h"
23
 
#include "drizzled/session.h"
24
 
#include "config.h"
25
 
#include "drizzled/function/time/date.h"
26
 
#include "drizzled/temporal_interval.h"
27
 
#include "drizzled/time_functions.h"
28
 
 
29
 
namespace drizzled
30
 
{
31
 
 
32
 
bool TemporalInterval::initFromItem(Item *args,
33
 
                                    interval_type int_type,
34
 
                                    String *str_value)
 
20
#include <drizzled/global.h>
 
21
#include <drizzled/error.h>
 
22
#include <drizzled/session.h>
 
23
#include <drizzled/server_includes.h>
 
24
#include <drizzled/function/time/date.h>
 
25
#include <drizzled/temporal_interval.h>
 
26
 
 
27
bool drizzled::TemporalInterval::initFromItem(Item *args, interval_type int_type, String *str_value)
35
28
{
36
29
  uint64_t array[MAX_STRING_ELEMENTS];
37
30
  int64_t value= 0;
179
172
    second= array[0];
180
173
    second_part= array[1];
181
174
    break;
182
 
  case INTERVAL_LAST:
 
175
  case INTERVAL_LAST: // purecov: begin deadcode
183
176
    assert(0);
184
 
    break;
 
177
    break;            // purecov: end
185
178
  }
186
179
  return false;
187
180
}
188
181
 
189
 
bool TemporalInterval::addDate(DRIZZLE_TIME *ltime, interval_type int_type)
 
182
bool drizzled::TemporalInterval::addDate(DRIZZLE_TIME *ltime, interval_type int_type)
190
183
{
191
184
  long period, sign;
192
185
 
293
286
  return 1;
294
287
}
295
288
 
296
 
bool TemporalInterval::getIntervalFromString(const char *str,
297
 
                                             uint32_t length,
298
 
                                             const CHARSET_INFO * const cs,
299
 
                                             uint32_t count, uint64_t *values,
300
 
                                             bool transform_msec)
 
289
bool drizzled::TemporalInterval::getIntervalFromString(const char *str,uint32_t length, const CHARSET_INFO * const cs,
 
290
    uint32_t count, uint64_t *values,
 
291
    bool transform_msec)
301
292
{
302
293
  const char *end= str+length;
303
294
  uint32_t x;
324
315
    {
325
316
      x++;
326
317
      /* Change values[0...x-1] -> values[0...count-1] */
327
 
      internal::bmove_upp((unsigned char*) (values+count),
328
 
                          (unsigned char*) (values+x),
329
 
                          sizeof(*values)*x);
 
318
      bmove_upp((unsigned char*) (values+count), (unsigned char*) (values+x),
 
319
          sizeof(*values)*x);
330
320
      memset(values, 0, sizeof(*values)*(count-x));
331
321
      break;
332
322
    }
333
323
  }
334
324
  return (str != end);
335
325
}
336
 
 
337
 
} /* namespace drizzled */