- Notifications
You must be signed in to change notification settings - Fork5
Commitbca6eeb
committed
Fix miserable coding in pg_stat_get_activity().
Commitdd1a3bc replaced a test on whether a subroutine returned anull pointer with a test on whether &pointer->backendStatus was null.This accidentally failed to fail, at least on common compilers, becausebackendStatus is the first field in the struct; but it was surely troublewaiting to happen. Commitf91feba then messed things up further,changing the logic tolocal_beentry = pgstat_fetch_stat_local_beentry(curr_backend);if (!local_beentry)continue;beentry = &local_beentry->backendStatus;if (!beentry){where the second "if" is now dead code, so that the intended behavior ofprinting a row with "<backend information not available>" cannot occur.I suspect this is all moot because pgstat_fetch_stat_local_beentrywill never actually return null in this function's usage, but it's stillvery poor coding. Repair back to 9.4 where the original problem wasintroduced.1 parentf337658 commitbca6eeb
1 file changed
+11
-15
lines changedLines changed: 11 additions & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
577 | 577 |
| |
578 | 578 |
| |
579 | 579 |
| |
580 |
| - | |
581 |
| - | |
582 |
| - | |
583 |
| - | |
584 |
| - | |
585 |
| - | |
586 |
| - | |
587 |
| - | |
588 |
| - | |
589 |
| - | |
590 | 580 |
| |
591 | 581 |
| |
592 | 582 |
| |
593 |
| - | |
594 |
| - | |
595 |
| - | |
596 |
| - | |
597 | 583 |
| |
598 | 584 |
| |
599 | 585 |
| |
600 |
| - | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
601 | 591 |
| |
602 | 592 |
| |
603 | 593 |
| |
| |||
607 | 597 |
| |
608 | 598 |
| |
609 | 599 |
| |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
610 | 606 |
| |
611 | 607 |
| |
612 | 608 |
| |
|
0 commit comments
Comments
(0)