-
- Downloads
Fix plpgsql to enforce domain checks when returning a NULL domain value.
If a plpgsql function is declared to return a domain type, and the domain's constraints forbid a null value, it was nonetheless possible to return NULL, because we didn't bother to check the constraints for a null result. I'd noticed this while fooling with domains-over-composite, but had not gotten around to fixing it immediately. Add a regression test script exercising this and various other domain cases, largely borrowed from the plpython_types test. Although this is clearly a bug fix, I'm not sure whether anyone would thank us for changing the behavior in stable branches, so I'm inclined not to back-patch.
Showing
- src/pl/plpgsql/src/Makefile 1 addition, 1 deletionsrc/pl/plpgsql/src/Makefile
- src/pl/plpgsql/src/expected/plpgsql_domain.out 397 additions, 0 deletionssrc/pl/plpgsql/src/expected/plpgsql_domain.out
- src/pl/plpgsql/src/pl_comp.c 4 additions, 0 deletionssrc/pl/plpgsql/src/pl_comp.c
- src/pl/plpgsql/src/pl_exec.c 16 additions, 0 deletionssrc/pl/plpgsql/src/pl_exec.c
- src/pl/plpgsql/src/plpgsql.h 1 addition, 0 deletionssrc/pl/plpgsql/src/plpgsql.h
- src/pl/plpgsql/src/sql/plpgsql_domain.sql 279 additions, 0 deletionssrc/pl/plpgsql/src/sql/plpgsql_domain.sql
Loading
Please register or sign in to comment