On 10.05.22 15:42, Fabien COELHO wrote:
Hello,
Thanks for the catch and the proposed fix! Indeed, on errors the timing
is not updated appropriately.
ISTM that the best course is to update the elapsed time whenever a
result is obtained, so that a sensible value is always available.
See attached patch which is a variant of Richard's version.
fabien=# SELECT 1 as one \; SELECT 1/0 \; SELECT 2 as two;
┌─────┐
│ one │
├─────┤
│ 1 │
└─────┘
(1 row)
ERROR: division by zero
Time: 0,352 ms
Probably it would be appropriate to add a test case. I'll propose
something later.
committed with a test