| 1144 | */ |
| 1145 | #define APPEND(...) if (append(__VA_ARGS__)) return 1; |
| 1146 | bool 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 | |
| 1171 | bool String::append_for_single_quote_using_mb_wc(const char *src, |
no test coverage detected