forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd0aa965
committed
Consistently catch errors from Python _New() functions
Python Py*_New() functions can fail and return NULL in out-of-memoryconditions. The previous code handled that inconsistently or not atall. This change organizes that better. If we are in a function thatis called from Python, we just check for failure and return NULLourselves, which will cause any exception information to be passed up.If we are called from PostgreSQL, we consistently create an "out ofmemory" error.Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>1 parent976a1a4 commitd0aa965
File tree
10 files changed
+70
-23
lines changed- contrib
- hstore_plpython
- ltree_plpython
- src/pl/plpython
10 files changed
+70
-23
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
93 | 93 |
| |
94 | 94 |
| |
95 | 95 |
| |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
96 | 100 |
| |
97 | 101 |
| |
98 | 102 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
46 | 46 |
| |
47 | 47 |
| |
48 | 48 |
| |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
49 | 53 |
| |
50 | 54 |
| |
51 | 55 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
457 | 457 |
| |
458 | 458 |
| |
459 | 459 |
| |
460 |
| - | |
461 |
| - | |
462 |
| - | |
463 |
| - | |
464 |
| - | |
| 460 | + | |
465 | 461 |
| |
466 |
| - | |
467 |
| - | |
468 |
| - | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
469 | 475 |
| |
470 |
| - | |
| 476 | + | |
| 477 | + | |
471 | 478 |
| |
472 | 479 |
| |
473 | 480 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
420 | 420 |
| |
421 | 421 |
| |
422 | 422 |
| |
| 423 | + | |
| 424 | + | |
| 425 | + | |
423 | 426 |
| |
424 | 427 |
| |
425 | 428 |
| |
| |||
693 | 696 |
| |
694 | 697 |
| |
695 | 698 |
| |
696 |
| - | |
| 699 | + | |
697 | 700 |
| |
698 | 701 |
| |
699 | 702 |
| |
| |||
826 | 829 |
| |
827 | 830 |
| |
828 | 831 |
| |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
829 | 837 |
| |
830 | 838 |
| |
831 | 839 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
167 | 167 |
| |
168 | 168 |
| |
169 | 169 |
| |
170 |
| - | |
| 170 | + | |
171 | 171 |
| |
172 | 172 |
| |
173 | 173 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
233 | 233 |
| |
234 | 234 |
| |
235 | 235 |
| |
236 |
| - | |
| 236 | + | |
237 | 237 |
| |
238 | 238 |
| |
239 | 239 |
| |
| |||
268 | 268 |
| |
269 | 269 |
| |
270 | 270 |
| |
271 |
| - | |
| 271 | + | |
272 | 272 |
| |
273 | 273 |
| |
274 | 274 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
368 | 368 |
| |
369 | 369 |
| |
370 | 370 |
| |
| 371 | + | |
| 372 | + | |
371 | 373 |
| |
372 | 374 |
| |
373 | 375 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
112 | 112 |
| |
113 | 113 |
| |
114 | 114 |
| |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
115 | 120 |
| |
116 | 121 |
| |
117 | 122 |
| |
| |||
147 | 152 |
| |
148 | 153 |
| |
149 | 154 |
| |
| 155 | + | |
| 156 | + | |
150 | 157 |
| |
151 | 158 |
| |
152 | 159 |
| |
| |||
171 | 178 |
| |
172 | 179 |
| |
173 | 180 |
| |
| 181 | + | |
| 182 | + | |
174 | 183 |
| |
175 | 184 |
| |
176 | 185 |
| |
| |||
195 | 204 |
| |
196 | 205 |
| |
197 | 206 |
| |
| 207 | + | |
| 208 | + | |
198 | 209 |
| |
199 | 210 |
| |
200 | 211 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
360 | 360 |
| |
361 | 361 |
| |
362 | 362 |
| |
| 363 | + | |
| 364 | + | |
363 | 365 |
| |
364 | 366 |
| |
365 | 367 |
| |
| |||
409 | 411 |
| |
410 | 412 |
| |
411 | 413 |
| |
412 |
| - | |
413 |
| - | |
414 |
| - | |
415 |
| - | |
416 |
| - | |
| 414 | + | |
417 | 415 |
| |
418 |
| - | |
419 |
| - | |
420 |
| - | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
421 | 429 |
| |
422 |
| - | |
| 430 | + | |
| 431 | + | |
423 | 432 |
| |
424 | 433 |
| |
425 | 434 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
718 | 718 |
| |
719 | 719 |
| |
720 | 720 |
| |
| 721 | + | |
| 722 | + | |
721 | 723 |
| |
722 | 724 |
| |
723 | 725 |
| |
| |||
826 | 828 |
| |
827 | 829 |
| |
828 | 830 |
| |
829 |
| - | |
| 831 | + | |
830 | 832 |
| |
831 | 833 |
| |
832 | 834 |
| |
|
0 commit comments
Comments
(0)