Commit f386291
committed
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 9c8351f commit f386291
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2753 | 2753 | | |
2754 | 2754 | | |
2755 | 2755 | | |
2756 | | - | |
| 2756 | + | |
2757 | 2757 | | |
2758 | 2758 | | |
2759 | 2759 | | |
| |||
0 commit comments