~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/str/right.cc

  • Committer: Monty Taylor
  • Date: 2009-04-14 19:16:51 UTC
  • mto: (997.2.5 mordred)
  • mto: This revision was merged to the branch mainline in revision 994.
  • Revision ID: mordred@inaugust.com-20090414191651-ltbww6hpqks8k7qk
Clarified instructions in README.

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/str/right.h>
23
23
 
24
 
namespace drizzled
25
 
{
26
 
 
27
24
String *Item_func_right::val_str(String *str)
28
25
{
29
26
  assert(fixed == 1);
32
29
  int64_t length= args[1]->val_int();
33
30
 
34
31
  if ((null_value=(args[0]->null_value || args[1]->null_value)))
35
 
    return 0;
 
32
    return 0; /* purecov: inspected */
36
33
 
37
34
  /* if "unsigned_flag" is set, we have a *huge* positive number. */
38
35
  if ((length <= 0) && (!args[1]->unsigned_flag))
39
 
    return &my_empty_string;
 
36
    return &my_empty_string; /* purecov: inspected */
40
37
 
41
38
  if (res->length() <= (uint64_t) length)
42
 
    return res;
 
39
    return res; /* purecov: inspected */
43
40
 
44
41
  uint32_t start=res->numchars();
45
42
  if (start <= (uint) length)
55
52
  left_right_max_length();
56
53
}
57
54
 
58
 
} /* namespace drizzled */