| 5538 | } |
| 5539 | |
| 5540 | static void |
| 5541 | ExplainPropertyStringInfo(const char *qlabel, ExplainState *es, const char *fmt,...) |
| 5542 | { |
| 5543 | StringInfoData buf; |
| 5544 | |
| 5545 | initStringInfo(&buf); |
| 5546 | |
| 5547 | for (;;) |
| 5548 | { |
| 5549 | va_list args; |
| 5550 | int needed; |
| 5551 | |
| 5552 | /* Try to format the data. */ |
| 5553 | va_start(args, fmt); |
| 5554 | needed = appendStringInfoVA(&buf, fmt, args); |
| 5555 | va_end(args); |
| 5556 | |
| 5557 | if (needed == 0) |
| 5558 | break; |
| 5559 | |
| 5560 | /* Double the buffer size and try again. */ |
| 5561 | enlargeStringInfo(&buf, needed); |
| 5562 | } |
| 5563 | |
| 5564 | ExplainPropertyText(qlabel, buf.data, es); |
| 5565 | pfree(buf.data); |
| 5566 | } |
| 5567 | |
| 5568 | /* |
| 5569 | * Explain a string-valued property. |
no test coverage detected