~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Mark Atwood
  • Date: 2011-05-04 15:58:17 UTC
  • mfrom: (2281.4.14 prune)
  • Revision ID: me@mark.atwood.name-20110504155817-c5w3ak4w6olexmt2
mergeĀ lp:~olafvdspek/drizzle/prune

Show diffs side-by-side

added added

removed removed

Lines of Context:
83
83
      }
84
84
      else if (res == &tmp_value)
85
85
      {
86
 
        if (res->append(*res2))                 // Must be a blob
87
 
          goto null;
 
86
        res->append(*res2);
88
87
      }
89
88
      else if (res2 == &tmp_value)
90
89
      {                                         // This can happend only 1 time
91
 
        if (tmp_value.replace(0,0,*res))
92
 
          goto null;
 
90
        tmp_value.replace(0,0,*res);
93
91
        res= &tmp_value;
94
92
        use_as_buff=str;                        // Put next arg here
95
93
      }
105
103
        tmp_value.length((uint32_t) (res2->ptr() - tmp_value.ptr()) +
106
104
                         res2->length());
107
105
        /* Place res2 at start of tmp_value, remove chars before res2 */
108
 
        if (tmp_value.replace(0,(uint32_t) (res2->ptr() - tmp_value.ptr()),
109
 
                              *res))
110
 
          goto null;
 
106
        tmp_value.replace(0,(uint32_t) (res2->ptr() - tmp_value.ptr()), *res);
111
107
        res= &tmp_value;
112
108
        use_as_buff=str;                        // Put next arg here
113
109
      }
138
134
          }
139
135
        }
140
136
 
141
 
        if (tmp_value.copy(*res) || tmp_value.append(*res2))
142
 
          goto null;
 
137
        tmp_value.copy(*res);
 
138
        tmp_value.append(*res2);
143
139
 
144
140
        res= &tmp_value;
145
141
        use_as_buff=str;
251
247
    }
252
248
    else if (res == &tmp_value)
253
249
    {
254
 
      if (res->append(*sep_str) || res->append(*res2))
255
 
        goto null; // Must be a blob
 
250
      res->append(*sep_str);
 
251
      res->append(*res2);
256
252
    }
257
253
    else if (res2 == &tmp_value)
258
254
    {                                           // This can happend only 1 time
259
 
      if (tmp_value.replace(0,0,*sep_str) || tmp_value.replace(0,0,*res))
260
 
        goto null;
 
255
      tmp_value.replace(0,0,*sep_str);
 
256
      tmp_value.replace(0,0,*res);
261
257
      res= &tmp_value;
262
258
      use_as_buff=str;                          // Put next arg here
263
259
    }
273
269
      tmp_value.length((uint32_t) (res2->ptr() - tmp_value.ptr()) +
274
270
                       res2->length());
275
271
      /* Place res2 at start of tmp_value, remove chars before res2 */
276
 
      if (tmp_value.replace(0,(uint32_t) (res2->ptr() - tmp_value.ptr()),
277
 
                            *res) ||
278
 
          tmp_value.replace(res->length(),0, *sep_str))
279
 
        goto null;
 
272
      tmp_value.replace(0,(uint32_t) (res2->ptr() - tmp_value.ptr()), *res);
 
273
      tmp_value.replace(res->length(),0, *sep_str);
280
274
      res= &tmp_value;
281
275
      use_as_buff=str;                  // Put next arg here
282
276
    }
307
301
        }
308
302
      }
309
303
 
310
 
      if (tmp_value.copy(*res) ||
311
 
          tmp_value.append(*sep_str) ||
312
 
          tmp_value.append(*res2))
313
 
        goto null;
 
304
      tmp_value.copy(*res);
 
305
      tmp_value.append(*sep_str);
 
306
      tmp_value.append(*res2);
314
307
      res= &tmp_value;
315
308
      use_as_buff=str;
316
309
    }