* saveCdbStatMsg - attach qExec statistics message to PGresult */
| 1749 | * saveCdbStatMsg - attach qExec statistics message to PGresult |
| 1750 | */ |
| 1751 | void |
| 1752 | saveCdbStatMsg(PGresult *result, char *data, int len) |
| 1753 | { |
| 1754 | pgCdbStatCell *cell; |
| 1755 | |
| 1756 | /* Allocate list element. */ |
| 1757 | cell = pqResultAlloc(result, sizeof(*cell), true); |
| 1758 | if (!cell) |
| 1759 | return; |
| 1760 | |
| 1761 | /* Allocate an aligned buffer from the PGresult's memory pool. */ |
| 1762 | cell->data = (char *)pqResultAlloc(result, len, true); |
| 1763 | if (!cell->data) |
| 1764 | return; |
| 1765 | |
| 1766 | /* Copy the message data. */ |
| 1767 | cell->len = len; |
| 1768 | memcpy(cell->data, data, len); |
| 1769 | |
| 1770 | /* Add to head of list. */ |
| 1771 | cell->next = result->cdbstats; |
| 1772 | result->cdbstats = cell; |
| 1773 | return; |
| 1774 | } /* saveCdbStatMsg */ |
| 1775 | |
| 1776 | |
| 1777 | /* |
no test coverage detected