~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/locate.cc

  • Committer: Mark Atwood
  • Date: 2010-06-24 03:15:21 UTC
  • mto: (1637.2.4 build)
  • mto: This revision was merged to the branch mainline in revision 1639.
  • Revision ID: me@mark.atwood.name-20100624031521-gafmppfbf5afm68w
new syslog module, with plugins for query log, error message, and SYSLOG() function

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/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 */