| 476 | */ |
| 477 | |
| 478 | static const char * |
| 479 | parse_quoted_escaped_string(const char *ptr, const char *end, |
| 480 | MEM_ROOT *mem_root, LEX_STRING *str) |
| 481 | { |
| 482 | const char *eol; |
| 483 | uint result_len= 0; |
| 484 | bool escaped= 0; |
| 485 | |
| 486 | // starting ' |
| 487 | if (*(ptr++) != '\'') |
| 488 | return 0; |
| 489 | |
| 490 | // find ending ' |
| 491 | for (eol= ptr; (*eol != '\'' || escaped) && eol < end; eol++) |
| 492 | { |
| 493 | if (!(escaped= (*eol == '\\' && !escaped))) |
| 494 | result_len++; |
| 495 | } |
| 496 | |
| 497 | // process string |
| 498 | if (eol >= end || |
| 499 | !(str->str= (char*) alloc_root(mem_root, result_len + 1)) || |
| 500 | read_escaped_string(ptr, eol, str)) |
| 501 | return 0; |
| 502 | |
| 503 | return eol+1; |
| 504 | } |
| 505 | |
| 506 | |
| 507 | /** |
no test coverage detected