forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit5836d32
committed
Fix minor violations of FunctionCallInvoke usage protocol.
Working on commit1c45507 led me to check through FunctionCallInvokecall sites to see if every one was being honest about (a) making surethat fcinfo.isnull is initially false, and (b) checking its state afterthe call. Sure enough, I found some violations.The main one is that finalize_partialaggregate re-used serialfn_fcinfowithout resetting isnull, even though it clearly intends to cater forserialfns that return NULL. There would only be an issue with anon-strict serialfn, since it's unlikely that a serialfn would returnNULL for non-null input. We have no non-strict serialfns in core, andthere may be none in the wild either, which would account for the lackof complaints. Still, it's clearly wrong, so back-patch that fix to9.6 where finalize_partialaggregate was introduced.Also, arrayfuncs.c and rowtypes.c contained various callers that werenot bothering to check for result nulls. While what's being called isa comparison or hash function that probably *shouldn't* return null,that's a lousy excuse for not having any check at all. There areexisting places that just Assert(!fcinfo->isnull) in comparablesituations, so I added that to the places that were calling btreecomparison or hash support functions. In the places callingboolean-returning equality functions, it's quite cheap to have themtreat isnull as FALSE, so make those places do that. Also remove some"locfcinfo->isnull = false" assignments that are unnecessary given theassumption that no previous call returned null. These changes seem likemostly neatnik-ism or debugging support, so I didn't back-patch.1 parentafccd76 commit5836d32
File tree
4 files changed
+29
-12
lines changed- src
- backend
- executor
- utils/adt
- include
4 files changed
+29
-12
lines changedLines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1172 | 1172 |
| |
1173 | 1173 |
| |
1174 | 1174 |
| |
| 1175 | + | |
1175 | 1176 |
| |
1176 | 1177 |
| |
1177 | 1178 |
| |
|
Lines changed: 19 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3668 | 3668 |
| |
3669 | 3669 |
| |
3670 | 3670 |
| |
3671 |
| - | |
| 3671 | + | |
3672 | 3672 |
| |
3673 | 3673 |
| |
3674 | 3674 |
| |
3675 | 3675 |
| |
3676 | 3676 |
| |
3677 | 3677 |
| |
3678 | 3678 |
| |
3679 |
| - | |
| 3679 | + | |
3680 | 3680 |
| |
3681 | 3681 |
| |
3682 | 3682 |
| |
| |||
3841 | 3841 |
| |
3842 | 3842 |
| |
3843 | 3843 |
| |
3844 |
| - | |
3845 | 3844 |
| |
3846 | 3845 |
| |
| 3846 | + | |
| 3847 | + | |
| 3848 | + | |
3847 | 3849 |
| |
3848 | 3850 |
| |
3849 | 3851 |
| |
| |||
3983 | 3985 |
| |
3984 | 3986 |
| |
3985 | 3987 |
| |
3986 |
| - | |
3987 | 3988 |
| |
| 3989 | + | |
| 3990 | + | |
3988 | 3991 |
| |
3989 | 3992 |
| |
3990 | 3993 |
| |
| |||
4074 | 4077 |
| |
4075 | 4078 |
| |
4076 | 4079 |
| |
| 4080 | + | |
| 4081 | + | |
4077 | 4082 |
| |
4078 | 4083 |
| |
4079 | 4084 |
| |
| |||
4207 | 4212 |
| |
4208 | 4213 |
| |
4209 | 4214 |
| |
4210 |
| - | |
| 4215 | + | |
4211 | 4216 |
| |
4212 | 4217 |
| |
4213 | 4218 |
| |
4214 | 4219 |
| |
4215 | 4220 |
| |
4216 | 4221 |
| |
4217 | 4222 |
| |
4218 |
| - | |
| 4223 | + | |
4219 | 4224 |
| |
4220 | 4225 |
| |
4221 | 4226 |
| |
| |||
6202 | 6207 |
| |
6203 | 6208 |
| |
6204 | 6209 |
| |
6205 |
| - | |
| 6210 | + | |
6206 | 6211 |
| |
6207 | 6212 |
| |
6208 | 6213 |
| |
6209 | 6214 |
| |
6210 | 6215 |
| |
6211 | 6216 |
| |
6212 | 6217 |
| |
6213 |
| - | |
| 6218 | + | |
6214 | 6219 |
| |
6215 | 6220 |
| |
6216 | 6221 |
| |
| |||
6517 | 6522 |
| |
6518 | 6523 |
| |
6519 | 6524 |
| |
6520 |
| - | |
6521 | 6525 |
| |
6522 | 6526 |
| |
6523 | 6527 |
| |
| 6528 | + | |
| 6529 | + | |
| 6530 | + | |
6524 | 6531 |
| |
6525 | 6532 |
| |
6526 | 6533 |
| |
| |||
6577 | 6584 |
| |
6578 | 6585 |
| |
6579 | 6586 |
| |
| 6587 | + | |
| 6588 | + | |
| 6589 | + | |
6580 | 6590 |
| |
6581 | 6591 |
| |
6582 | 6592 |
| |
|
Lines changed: 4 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
966 | 966 |
| |
967 | 967 |
| |
968 | 968 |
| |
969 |
| - | |
970 | 969 |
| |
971 | 970 |
| |
| 971 | + | |
| 972 | + | |
| 973 | + | |
972 | 974 |
| |
973 | 975 |
| |
974 | 976 |
| |
| |||
1200 | 1202 |
| |
1201 | 1203 |
| |
1202 | 1204 |
| |
1203 |
| - | |
1204 | 1205 |
| |
1205 |
| - | |
| 1206 | + | |
1206 | 1207 |
| |
1207 | 1208 |
| |
1208 | 1209 |
| |
|
Lines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
163 | 163 |
| |
164 | 164 |
| |
165 | 165 |
| |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
166 | 171 |
| |
167 | 172 |
| |
168 | 173 |
| |
|
0 commit comments
Comments
(0)