-
- Downloads
Make SPI_fnumber() reject dropped columns.
There's basically no scenario where it's sensible for this to match dropped columns, so put a test for dropped-ness into SPI_fnumber() itself, and excise the test from the small number of callers that were paying attention to the case. (Most weren't :-(.) In passing, normalize tests at call sites: always reject attnum <= 0 if we're disallowing system columns. Previously there was a mixture of "< 0" and "<= 0" tests. This makes no practical difference since SPI_fnumber() never returns 0, but I'm feeling pedantic today. Also, in the places that are actually live user-facing code and not legacy cruft, distinguish "column not found" from "can't handle system column". Per discussion with Jim Nasby; thi supersedes his original patch that just changed the behavior at one call site. Discussion: <b2de8258-c4c0-1cb8-7b97-e8538e5c975c@BlueTreble.com>
Showing
- contrib/spi/autoinc.c 1 addition, 1 deletioncontrib/spi/autoinc.c
- contrib/spi/insert_username.c 1 addition, 1 deletioncontrib/spi/insert_username.c
- contrib/spi/moddatetime.c 2 additions, 2 deletionscontrib/spi/moddatetime.c
- contrib/spi/refint.c 3 additions, 2 deletionscontrib/spi/refint.c
- contrib/spi/timetravel.c 2 additions, 2 deletionscontrib/spi/timetravel.c
- doc/src/sgml/spi.sgml 1 addition, 1 deletiondoc/src/sgml/spi.sgml
- src/backend/executor/spi.c 2 additions, 1 deletionsrc/backend/executor/spi.c
- src/backend/utils/adt/tsvector_op.c 1 addition, 0 deletionssrc/backend/utils/adt/tsvector_op.c
- src/pl/plperl/plperl.c 6 additions, 1 deletionsrc/pl/plperl/plperl.c
- src/pl/tcl/pltcl.c 1 addition, 10 deletionssrc/pl/tcl/pltcl.c
- src/test/regress/regress.c 5 additions, 4 deletionssrc/test/regress/regress.c
Loading
Please register or sign in to comment