~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/find_in_set.cc

  • Committer: Mark Atwood
  • Date: 2011-08-12 04:08:33 UTC
  • mfrom: (2385.2.17 refactor5)
  • Revision ID: me@mark.atwood.name-20110812040833-u6j85nc6ahuc0dtz
mergeĀ lp:~olafvdspek/drizzle/refactor5

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
  }
62
62
  null_value=0;
63
63
 
64
 
  int diff;
65
 
  if ((diff=buffer->length() - find->length()) >= 0)
 
64
  if (buffer->length() >= find->length())  
66
65
  {
67
66
    my_wc_t wc;
68
67
    const charset_info_st * const cs= cmp_collation.collation;
75
74
    while (1)
76
75
    {
77
76
      int symbol_len;
78
 
      if ((symbol_len= cs->cset->mb_wc(cs, &wc, (unsigned char*) str_end,
79
 
                                       (unsigned char*) real_end)) > 0)
 
77
      if ((symbol_len= cs->cset->mb_wc(cs, &wc, (unsigned char*) str_end, (unsigned char*) real_end)) > 0)
80
78
      {
81
79
        const char *substr_end= str_end + symbol_len;
82
80
        bool is_last_item= (substr_end == real_end);
100
98
               wc == (my_wc_t) separator)
101
99
        return (int64_t) ++position;
102
100
      else
103
 
        return 0L;
 
101
        return 0;
104
102
    }
105
103
  }
106
104
  return 0;