MCPcopy Create free account
hub / github.com/MariaDB/server / append_for_single_quote

Method append_for_single_quote

sql/sql_string.cc:1146–1168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1144*/
1145#define APPEND(...) if (append(__VA_ARGS__)) return 1;
1146bool String::append_for_single_quote(const char *st, size_t len)
1147{
1148 const char *end= st+len;
1149 int chlen;
1150 for (; st < end; st++)
1151 {
1152 char ch2= (char) (uchar) escaped_wc_for_single_quote((uchar) *st);
1153 if (ch2)
1154 {
1155 if (append('\\') || append(ch2))
1156 return true;
1157 continue;
1158 }
1159 if ((chlen= charset()->charlen(st, end)) > 0)
1160 {
1161 APPEND(st, chlen);
1162 st+= chlen-1;
1163 }
1164 else
1165 APPEND(*st);
1166 }
1167 return 0;
1168}
1169
1170
1171bool String::append_for_single_quote_using_mb_wc(const char *src,

Callers 6

print_pathFunction · 0.45
printMethod · 0.45
collect_stringFunction · 0.45
add_keyword_stringFunction · 0.45
printMethod · 0.45

Calls 2

appendFunction · 0.85
charlenMethod · 0.80

Tested by

no test coverage detected