~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_string.cc

  • Committer: Olaf van der Spek
  • Date: 2011-07-04 13:10:52 UTC
  • mto: This revision was merged to the branch mainline in revision 2367.
  • Revision ID: olafvdspek@gmail.com-20110704131052-0lxuejwmsivdu4ca
RemoveĀ unusedĀ param

Show diffs side-by-side

added added

removed removed

Lines of Context:
327
327
  append(s, strlen(s));
328
328
}
329
329
 
330
 
 
331
 
/*
332
 
  Append a string in the given charset to the string
333
 
  with character set recoding
334
 
*/
335
 
 
336
 
void String::append(const char *s,size_t arg_length, const charset_info_st * const)
337
 
{
338
 
  realloc(str_length + arg_length);
339
 
  memcpy(Ptr + str_length, s, arg_length);
340
 
  str_length+= arg_length;
341
 
}
342
 
 
343
 
 
344
 
void String::append_with_prefill(const char *s,size_t arg_length,
345
 
                 size_t full_length, char fill_char)
 
330
void String::append_with_prefill(const char *s,size_t arg_length, size_t full_length, char fill_char)
346
331
{
347
332
  int t_length= arg_length > full_length ? arg_length : full_length;
348
333
 
688
673
 
689
674
void String::append_identifier(const char *name, size_t in_length)
690
675
{
691
 
  const char *name_end;
692
 
  char quote_char;
693
 
  int q= '`';
694
 
 
695
 
  /*
696
 
    The identifier must be quoted as it includes a quote character or
697
 
   it's a keyword
698
 
  */
699
 
 
700
 
  reserve(in_length*2 + 2);
701
 
  quote_char= (char) q;
702
 
  append(&quote_char, 1, system_charset_info);
703
 
 
704
 
  for (name_end= name+in_length ; name < name_end ; name+= in_length)
 
676
  // The identifier must be quoted as it includes a quote character or it's a keyword
 
677
 
 
678
  reserve(in_length * 2 + 2);
 
679
  const char quote_char= '`';
 
680
  append(&quote_char, 1);
 
681
 
 
682
  for (const char* name_end= name+in_length ; name < name_end ; name+= in_length)
705
683
  {
706
684
    unsigned char chr= (unsigned char) *name;
707
685
    in_length= my_mbcharlen(system_charset_info, chr);
715
693
    if (!in_length)
716
694
      in_length= 1;
717
695
    if (in_length == 1 && chr == (unsigned char) quote_char)
718
 
      append(&quote_char, 1, system_charset_info);
719
 
    append(name, in_length, system_charset_info);
 
696
      append(&quote_char, 1);
 
697
    append(name, in_length);
720
698
  }
721
 
  append(&quote_char, 1, system_charset_info);
 
699
  append(&quote_char, 1);
722
700
}
723
701
 
724
702
bool check_if_only_end_space(const charset_info_st * const cs, char *str,