forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit3d929dc
committed
Improve pg_upgrade's load_directory() function.
Error out on out-of-memory, rather than returning -1, which the soleexisting caller wasn't checking for anyway. There doesn't seem to beany use-case for making the caller check for failure here.Detect failure return from readdir().Use a less platform-dependent method of calculating the entrysize.It's possible, but not yet confirmed, that this explains bug #6733,in which Mike Wilson reports a pg_upgrade crash that did not occurin 9.1. (Note that load_directory is effectively new code in 9.2,at least on platforms that have scandir().)Fix up comments, avoid uselessly using two counters, reduce the numberof realloc calls to something sane.1 parent4abcce8 commit3d929dc
3 files changed
+47
-31
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
227 | | - | |
228 | | - | |
229 | | - | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
230 | 230 | | |
231 | | - | |
232 | | - | |
233 | | - | |
| 231 | + | |
| 232 | + | |
234 | 233 | | |
235 | 234 | | |
236 | 235 | | |
237 | 236 | | |
238 | 237 | | |
239 | 238 | | |
240 | 239 | | |
241 | | - | |
| 240 | + | |
242 | 241 | | |
243 | 242 | | |
244 | | - | |
245 | | - | |
| 243 | + | |
| 244 | + | |
246 | 245 | | |
247 | | - | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
248 | 249 | | |
249 | | - | |
| 250 | + | |
250 | 251 | | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
| 252 | + | |
257 | 253 | | |
258 | | - | |
259 | | - | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
260 | 257 | | |
261 | 258 | | |
262 | | - | |
| 259 | + | |
263 | 260 | | |
264 | 261 | | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
| 262 | + | |
272 | 263 | | |
273 | | - | |
| 264 | + | |
274 | 265 | | |
275 | | - | |
| 266 | + | |
276 | 267 | | |
277 | 268 | | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
278 | 282 | | |
279 | 283 | | |
280 | 284 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
430 | 430 | | |
431 | 431 | | |
432 | 432 | | |
433 | | - | |
| 433 | + | |
| 434 | + | |
434 | 435 | | |
435 | 436 | | |
436 | 437 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
| 186 | + | |
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
196 | 207 | | |
197 | 208 | | |
198 | 209 | | |
| |||
0 commit comments
Comments
(0)