forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd854720
committed
postgres_fdw: Tighten up allowed values for batch_size, fetch_size options.
Previously the values such as '100$%$#$#', '9,223,372,' were accepted andtreated as valid integers for postgres_fdw options batch_size and fetch_size.Whereas this is not the case with fdw_startup_cost and fdw_tuple_cost optionsfor which an error is thrown. This was because endptr was not usedwhile converting strings to integers using strtol.This commit changes the logic so that it uses parse_int functioninstead of strtol as it serves the purpose by returning false in caseif it is unable to convert the string to integer. Note thatthis function also rounds off the values such as '100.456' to 100 and'100.567' or '100.678' to 101.While on this, use parse_real for fdw_startup_cost and fdw_tuple_cost options.Since parse_int and parse_real are being used for reloptions and GUCs,it is more appropriate to use in postgres_fdw rather than using strtoland strtod directly.Back-patch to v14.Author: Bharath RupireddyReviewed-by: Ashutosh Bapat, Tom Lane, Kyotaro Horiguchi, Fujii MasaoDiscussion:https://postgr.es/m/CALj2ACVMO6wY5Pc4oe1OCgUOAtdjHuFsBDw8R5uoYR86eWFQDA@mail.gmail.com1 parent9fd8557 commitd854720
File tree
5 files changed
+82
-35
lines changed- contrib/postgres_fdw
- expected
- sql
- doc/src/sgml
5 files changed
+82
-35
lines changedLines changed: 19 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10480 | 10480 |
| |
10481 | 10481 |
| |
10482 | 10482 |
| |
| 10483 | + | |
| 10484 | + | |
| 10485 | + | |
| 10486 | + | |
| 10487 | + | |
| 10488 | + | |
| 10489 | + | |
| 10490 | + | |
| 10491 | + | |
| 10492 | + | |
| 10493 | + | |
| 10494 | + | |
| 10495 | + | |
| 10496 | + | |
| 10497 | + | |
| 10498 | + | |
| 10499 | + | |
| 10500 | + | |
| 10501 | + |
Lines changed: 31 additions & 21 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
20 | 20 |
| |
21 | 21 |
| |
22 | 22 |
| |
| 23 | + | |
23 | 24 |
| |
24 | 25 |
| |
25 | 26 |
| |
| |||
119 | 120 |
| |
120 | 121 |
| |
121 | 122 |
| |
122 |
| - | |
123 |
| - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
124 | 126 |
| |
125 |
| - | |
126 |
| - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
127 | 137 |
| |
128 |
| - | |
129 |
| - | |
| 138 | + | |
| 139 | + | |
130 | 140 |
| |
131 | 141 |
| |
132 | 142 |
| |
133 | 143 |
| |
134 | 144 |
| |
135 | 145 |
| |
136 | 146 |
| |
137 |
| - | |
| 147 | + | |
| 148 | + | |
138 | 149 |
| |
139 |
| - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
140 | 156 |
| |
141 |
| - | |
142 |
| - | |
| 157 | + | |
143 | 158 |
| |
144 |
| - | |
145 |
| - | |
146 |
| - | |
147 |
| - | |
148 |
| - | |
149 |
| - | |
150 |
| - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
151 | 162 |
| |
152 |
| - | |
153 |
| - | |
| 163 | + | |
154 | 164 |
| |
155 |
| - | |
156 |
| - | |
| 165 | + | |
| 166 | + | |
157 | 167 |
| |
158 | 168 |
| |
159 | 169 |
| |
|
Lines changed: 9 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5024 | 5024 |
| |
5025 | 5025 |
| |
5026 | 5026 |
| |
5027 |
| - | |
| 5027 | + | |
5028 | 5028 |
| |
5029 | 5029 |
| |
5030 | 5030 |
| |
| |||
5034 | 5034 |
| |
5035 | 5035 |
| |
5036 | 5036 |
| |
5037 |
| - | |
| 5037 | + | |
5038 | 5038 |
| |
5039 | 5039 |
| |
5040 | 5040 |
| |
| |||
5801 | 5801 |
| |
5802 | 5802 |
| |
5803 | 5803 |
| |
5804 |
| - | |
| 5804 | + | |
| 5805 | + | |
5805 | 5806 |
| |
5806 |
| - | |
| 5807 | + | |
| 5808 | + | |
5807 | 5809 |
| |
5808 | 5810 |
| |
5809 | 5811 |
| |
5810 | 5812 |
| |
5811 |
| - | |
| 5813 | + | |
5812 | 5814 |
| |
5813 | 5815 |
| |
5814 | 5816 |
| |
| |||
5831 | 5833 |
| |
5832 | 5834 |
| |
5833 | 5835 |
| |
5834 |
| - | |
| 5836 | + | |
5835 | 5837 |
| |
5836 | 5838 |
| |
5837 | 5839 |
| |
| |||
7341 | 7343 |
| |
7342 | 7344 |
| |
7343 | 7345 |
| |
7344 |
| - | |
| 7346 | + | |
7345 | 7347 |
| |
7346 | 7348 |
| |
7347 | 7349 |
| |
|
Lines changed: 16 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3339 | 3339 |
| |
3340 | 3340 |
| |
3341 | 3341 |
| |
| 3342 | + | |
| 3343 | + | |
| 3344 | + | |
| 3345 | + | |
| 3346 | + | |
| 3347 | + | |
| 3348 | + | |
| 3349 | + | |
| 3350 | + | |
| 3351 | + | |
| 3352 | + | |
| 3353 | + | |
| 3354 | + | |
| 3355 | + | |
| 3356 | + | |
| 3357 | + |
Lines changed: 7 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
266 | 266 |
| |
267 | 267 |
| |
268 | 268 |
| |
269 |
| - | |
270 |
| - | |
271 |
| - | |
272 |
| - | |
273 |
| - | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
274 | 274 |
| |
275 | 275 |
| |
276 | 276 |
| |
| |||
280 | 280 |
| |
281 | 281 |
| |
282 | 282 |
| |
283 |
| - | |
284 |
| - | |
| 283 | + | |
| 284 | + | |
285 | 285 |
| |
286 | 286 |
| |
287 | 287 |
| |
|
0 commit comments
Comments
(0)