~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/locate.cc

  • Committer: Patrick Galbraith
  • Date: 2009-10-08 22:42:05 UTC
  • mto: (1166.5.3 memcached_functions)
  • mto: This revision was merged to the branch mainline in revision 1189.
  • Revision ID: patg@patrick-galbraiths-macbook-pro.local-20091008224205-gq1pehjsivvx0qo9
Starting over with a fresh tree, moved in memcached functions.

Memcached Functions for Drizzle. 

All tests pass.

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
 
 
 
20
#include <drizzled/server_includes.h>
 
21
#include CSTDINT_H
22
22
#include <drizzled/function/locate.h>
23
23
 
24
 
namespace drizzled
25
 
{
26
 
 
27
24
void Item_func_locate::fix_length_and_dec()
28
25
{
29
26
  max_length= MY_INT32_NUM_DECIMAL_DIGITS;
50
47
  {
51
48
    start0= start= args[2]->val_int() - 1;
52
49
 
53
 
    if ((start < 0) || (start > static_cast<int64_t>(a->length())))
 
50
    if ((start < 0) || (start > a->length()))
54
51
      return 0;
55
52
 
56
53
    /* start is now sufficiently valid to pass to charpos function */
86
83
  str->append(')');
87
84
}
88
85
 
89
 
} /* namespace drizzled */