* Convenience routines for starting/committing a single command. */
| 3550 | * Convenience routines for starting/committing a single command. |
| 3551 | */ |
| 3552 | static void |
| 3553 | start_xact_command(void) |
| 3554 | { |
| 3555 | if (!xact_started) |
| 3556 | { |
| 3557 | StartTransactionCommand(); |
| 3558 | |
| 3559 | xact_started = true; |
| 3560 | } |
| 3561 | |
| 3562 | /* |
| 3563 | * Start statement timeout if necessary. Note that this'll intentionally |
| 3564 | * not reset the clock on an already started timeout, to avoid the timing |
| 3565 | * overhead when start_xact_command() is invoked repeatedly, without an |
| 3566 | * interceding finish_xact_command() (e.g. parse/bind/execute). If that's |
| 3567 | * not desired, the timeout has to be disabled explicitly. |
| 3568 | */ |
| 3569 | enable_statement_timeout(); |
| 3570 | |
| 3571 | /* Start timeout for checking if the client has gone away if necessary. */ |
| 3572 | if (client_connection_check_interval > 0 && |
| 3573 | IsUnderPostmaster && |
| 3574 | MyProcPort && |
| 3575 | !get_timeout_active(CLIENT_CONNECTION_CHECK_TIMEOUT)) |
| 3576 | enable_timeout_after(CLIENT_CONNECTION_CHECK_TIMEOUT, |
| 3577 | client_connection_check_interval); |
| 3578 | } |
| 3579 | |
| 3580 | static void |
| 3581 | finish_xact_command(void) |
no test coverage detected