* Add data to the WAL record that's being constructed. * * The data is appended to the "main chunk", available at replay with * XLogRecGetData(). */
| 336 | * XLogRecGetData(). |
| 337 | */ |
| 338 | void |
| 339 | XLogRegisterData(char *data, int len) |
| 340 | { |
| 341 | XLogRecData *rdata; |
| 342 | |
| 343 | Assert(begininsert_called); |
| 344 | |
| 345 | if (num_rdatas >= max_rdatas) |
| 346 | elog(ERROR, "too much WAL data"); |
| 347 | rdata = &rdatas[num_rdatas++]; |
| 348 | |
| 349 | rdata->data = data; |
| 350 | rdata->len = len; |
| 351 | |
| 352 | /* |
| 353 | * we use the mainrdata_last pointer to track the end of the chain, so no |
| 354 | * need to clear 'next' here. |
| 355 | */ |
| 356 | |
| 357 | mainrdata_last->next = rdata; |
| 358 | mainrdata_last = rdata; |
| 359 | |
| 360 | mainrdata_len += len; |
| 361 | } |
| 362 | |
| 363 | /* |
| 364 | * Add buffer-specific data to the WAL record that's being constructed. |
no outgoing calls
no test coverage detected