forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitbc8393c
committed
Further adjust SPITupleTable to provide a public row-count field.
Now that commitfec0778 drew a clear line between public and privatefields in SPITupleTable, it seems pretty silly that the count of validtuples isn't on the public side of that line. The reason why not wasthat there wasn't such a count. For reasons lost in the mists of time,spi.c preferred to keep a count of remaining free entries in the array.But that seems pretty pointless: it's unlike the way we handle similarcode everywhere else, and it involves extra subtractions that surelyoutweigh having to do a comparison rather than test-for-zero to checkfor array-full.Hence, rearrange so that this code does the expansible array logicthe same as everywhere else, with a count of valid entries alongsidethe allocated array length. And document the count as public.I looked for core-code callers where it would make sense to startrelying on tuptable->numvals rather than the separate SPI_processedvariable. Right now there don't seem to be places where it'd bea win to do so without more code restructuring than I care toundertake today. In principle, though, having SPITupleTables befully self-contained should be helpful down the line.Discussion:https://postgr.es/m/16852.1563395722@sss.pgh.pa.us1 parent7d24f6a commitbc8393c
3 files changed
+25
-21
lines changedLines changed: 12 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
323 | 323 |
| |
324 | 324 |
| |
325 | 325 |
| |
| 326 | + | |
326 | 327 |
| |
327 | 328 |
| |
| 329 | + | |
328 | 330 |
| |
329 |
| - | |
330 |
| - | |
331 | 331 |
| |
332 | 332 |
| |
333 | 333 |
| |
334 | 334 |
| |
335 |
| - | |
336 |
| - | |
337 |
| - | |
338 |
| - | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
339 | 343 |
| |
340 | 344 |
| |
341 | 345 |
| |
| |||
4631 | 4635 |
| |
4632 | 4636 |
| |
4633 | 4637 |
| |
4634 |
| - | |
4635 | 4638 |
| |
| 4639 | + | |
4636 | 4640 |
| |
4637 | 4641 |
| |
4638 | 4642 |
| |
4639 |
| - | |
| 4643 | + | |
4640 | 4644 |
| |
4641 | 4645 |
| |
4642 | 4646 |
| |
|
Lines changed: 11 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1872 | 1872 |
| |
1873 | 1873 |
| |
1874 | 1874 |
| |
1875 |
| - | |
| 1875 | + | |
1876 | 1876 |
| |
| 1877 | + | |
1877 | 1878 |
| |
1878 | 1879 |
| |
1879 | 1880 |
| |
| |||
1899 | 1900 |
| |
1900 | 1901 |
| |
1901 | 1902 |
| |
1902 |
| - | |
| 1903 | + | |
1903 | 1904 |
| |
1904 | 1905 |
| |
1905 |
| - | |
1906 |
| - | |
| 1906 | + | |
| 1907 | + | |
1907 | 1908 |
| |
1908 |
| - | |
| 1909 | + | |
| 1910 | + | |
1909 | 1911 |
| |
1910 | 1912 |
| |
1911 |
| - | |
1912 |
| - | |
1913 |
| - | |
| 1913 | + | |
| 1914 | + | |
1914 | 1915 |
| |
1915 | 1916 |
| |
1916 | 1917 |
| |
| |||
2324 | 2325 |
| |
2325 | 2326 |
| |
2326 | 2327 |
| |
2327 |
| - | |
2328 |
| - | |
| 2328 | + | |
2329 | 2329 |
| |
2330 | 2330 |
| |
2331 | 2331 |
| |
| |||
2694 | 2694 |
| |
2695 | 2695 |
| |
2696 | 2696 |
| |
2697 |
| - | |
| 2697 | + | |
2698 | 2698 |
| |
2699 | 2699 |
| |
2700 | 2700 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
24 | 24 |
| |
25 | 25 |
| |
26 | 26 |
| |
| 27 | + | |
27 | 28 |
| |
28 | 29 |
| |
| 30 | + | |
29 | 31 |
| |
30 |
| - | |
31 |
| - | |
32 | 32 |
| |
33 | 33 |
| |
34 | 34 |
| |
|
0 commit comments
Comments
(0)