Commit b320e6a
Fix incorrect column number in funcTupleDesc initialization.
In process_sample_rows(), when initializing funcTupleDesc for table columns,
the column number should start from NUM_SAMPLE_FIXED_COLS + 1 (5) instead of 4.
The first 4 columns (1-4) are reserved for fixed columns:
- Column 1: totalrows (FLOAT8OID)
- Column 2: totaldeadrows (FLOAT8OID)
- Column 3: oversized_cols_length (FLOAT8ARRAYOID)
- Column 4: NDV array (FLOAT8ARRAYOID)
Table columns should start from column 5, so the correct formula is:
(AttrNumber) NUM_SAMPLE_FIXED_COLS + 1 + index
This bug is harmless because funcTupleDesc's column type information is not
actually used in subsequent processing - only the column count (natts) is used.
The actual type information is obtained dynamically via lookup_rowtype_tupdesc().
However, it's still worth fixing for code correctness and maintainability.1 parent f1d6691 commit b320e6a
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2758 | 2758 | | |
2759 | 2759 | | |
2760 | 2760 | | |
2761 | | - | |
| 2761 | + | |
2762 | 2762 | | |
2763 | 2763 | | |
2764 | 2764 | | |
| |||
0 commit comments