forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit86bfbea
committed
Make int64_div_fast_to_numeric() more robust.
The prior coding of int64_div_fast_to_numeric() had a number of bugsthat would cause it to fail under different circumstances, such aswith log10val2 <= 0, or log10val2 a multiple of 4, or in the "slow"numeric path with log10val2 >= 10.None of those could be triggered by any of our current code, whichonly uses log10val2 = 3 or 6. However, they made it a hazard for anyfuture code that might use it. Also, since this is exported bynumeric.c, users writing their own C code might choose to use it.Therefore fix, and back-patch to v14, where it was introduced.Dean Rasheed, reviewed by Tom Lane.Discussion:https://postgr.es/m/CAEZATCW8gXgW0tgPxPgHDPhVX71%2BSWFRkhnXy%2BTfGDsKLepu2g%40mail.gmail.com1 parent89d28f9 commit86bfbea
1 file changed
+54
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4089 | 4089 | | |
4090 | 4090 | | |
4091 | 4091 | | |
4092 | | - | |
| 4092 | + | |
4093 | 4093 | | |
4094 | 4094 | | |
4095 | 4095 | | |
4096 | 4096 | | |
4097 | 4097 | | |
4098 | 4098 | | |
4099 | 4099 | | |
4100 | | - | |
| 4100 | + | |
4101 | 4101 | | |
4102 | 4102 | | |
4103 | 4103 | | |
| 4104 | + | |
| 4105 | + | |
| 4106 | + | |
| 4107 | + | |
| 4108 | + | |
4104 | 4109 | | |
4105 | 4110 | | |
4106 | | - | |
| 4111 | + | |
4107 | 4112 | | |
| 4113 | + | |
| 4114 | + | |
| 4115 | + | |
| 4116 | + | |
| 4117 | + | |
4108 | 4118 | | |
4109 | 4119 | | |
4110 | | - | |
4111 | | - | |
| 4120 | + | |
| 4121 | + | |
| 4122 | + | |
4112 | 4123 | | |
4113 | 4124 | | |
4114 | 4125 | | |
4115 | | - | |
| 4126 | + | |
| 4127 | + | |
| 4128 | + | |
| 4129 | + | |
| 4130 | + | |
| 4131 | + | |
| 4132 | + | |
| 4133 | + | |
| 4134 | + | |
| 4135 | + | |
| 4136 | + | |
4116 | 4137 | | |
4117 | 4138 | | |
4118 | | - | |
| 4139 | + | |
| 4140 | + | |
4119 | 4141 | | |
4120 | | - | |
4121 | | - | |
4122 | | - | |
4123 | | - | |
4124 | | - | |
4125 | | - | |
4126 | | - | |
4127 | | - | |
4128 | | - | |
4129 | | - | |
4130 | | - | |
4131 | | - | |
4132 | | - | |
4133 | | - | |
| 4142 | + | |
| 4143 | + | |
| 4144 | + | |
| 4145 | + | |
| 4146 | + | |
| 4147 | + | |
| 4148 | + | |
| 4149 | + | |
| 4150 | + | |
| 4151 | + | |
| 4152 | + | |
| 4153 | + | |
| 4154 | + | |
| 4155 | + | |
| 4156 | + | |
| 4157 | + | |
| 4158 | + | |
| 4159 | + | |
| 4160 | + | |
4134 | 4161 | | |
| 4162 | + | |
| 4163 | + | |
| 4164 | + | |
4135 | 4165 | | |
4136 | 4166 | | |
4137 | | - | |
4138 | | - | |
4139 | | - | |
4140 | | - | |
| 4167 | + | |
| 4168 | + | |
4141 | 4169 | | |
4142 | 4170 | | |
4143 | | - | |
| 4171 | + | |
4144 | 4172 | | |
4145 | 4173 | | |
4146 | 4174 | | |
| |||
0 commit comments
Comments
(0)