forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit87f81a5
committed
Fix hypothetical bug in ExprState building for hashing
adf97c1 gave ExprStates the ability to hash expressions and return asingle hash value. That commit supports seeding the hash value with aninitial value to have that blended into the final hash value.Here we fix a hypothetical bug where if there are zero expressions tohash, the initial value is stored in the wrong location. The existingcode stored the initial value in an intermediate location expecting thatwhen the expressions were hashed that those steps would store the finalhash value in the ExprState.resvalue field. However, that wouldn't happenwhen there are zero expressions to hash. The correct thing to do insteadis to have a special case for zero expressions and when we hit that case,store the initial value directly in the ExprState.resvalue. The reasonthat this is a hypothetical bug is that no code currently callsExecBuildHash32Expr passing a non-zero initial value.Discussion:https://postgr.es/m/CAApHDvpMAL_zxbMRr1LOex3O7Y7R7ZN2i8iUFLQhqQiJMAg3qw@mail.gmail.com1 parent7bdaa4b commit87f81a5
1 file changed
+14
-9
lines changedLines changed: 14 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4004 | 4004 |
| |
4005 | 4005 |
| |
4006 | 4006 |
| |
| 4007 | + | |
4007 | 4008 |
| |
4008 |
| - | |
| 4009 | + | |
4009 | 4010 |
| |
4010 | 4011 |
| |
4011 | 4012 |
| |
4012 | 4013 |
| |
4013 | 4014 |
| |
4014 | 4015 |
| |
4015 | 4016 |
| |
4016 |
| - | |
4017 |
| - | |
4018 |
| - | |
| 4017 | + | |
| 4018 | + | |
| 4019 | + | |
4019 | 4020 |
| |
4020 |
| - | |
| 4021 | + | |
4021 | 4022 |
| |
4022 | 4023 |
| |
4023 | 4024 |
| |
| |||
4032 | 4033 |
| |
4033 | 4034 |
| |
4034 | 4035 |
| |
4035 |
| - | |
| 4036 | + | |
| 4037 | + | |
| 4038 | + | |
| 4039 | + | |
| 4040 | + | |
4036 | 4041 |
| |
4037 | 4042 |
| |
4038 |
| - | |
4039 |
| - | |
| 4043 | + | |
| 4044 | + | |
4040 | 4045 |
| |
4041 | 4046 |
| |
4042 | 4047 |
| |
| |||
4074 | 4079 |
| |
4075 | 4080 |
| |
4076 | 4081 |
| |
4077 |
| - | |
| 4082 | + | |
4078 | 4083 |
| |
4079 | 4084 |
| |
4080 | 4085 |
| |
|
0 commit comments
Comments
(0)