~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/locate.cc

  • Committer: lbieber
  • Date: 2010-10-05 22:23:12 UTC
  • mfrom: (1813.1.4 build)
  • Revision ID: lbieber@orisndriz08-20101005222312-weuq0ardk3gcryau
Merge Travis - 621861 - convert structs to classes
Merge Billy - 621331 - Replace use of stringstream with boost::lexical_cast
Merge Travis - 621861 = To change C structs to C++ classes in Drizzle
Merge Andrew - fix bug 653300 - Syntax error on inport of a SQL file produced by drizzledump

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
19
19
 
20
20
#include "config.h"
21
21
 
22
 
#include <drizzled/charset_info.h>
23
22
#include <drizzled/function/locate.h>
24
 
#include <drizzled/lex_string.h>
25
23
 
26
24
namespace drizzled
27
25
{
52
50
  {
53
51
    start0= start= args[2]->val_int() - 1;
54
52
 
55
 
    if ((start < 0) || (start > static_cast<int64_t>(a->length())))
 
53
    if ((start < 0) || (start > a->length()))
56
54
      return 0;
57
55
 
58
56
    /* start is now sufficiently valid to pass to charpos function */