forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit2940f1c
committed
psql: Set variables from query result on failure when printing tuples
SetResultVariables() was not getting called when "printing" a resultthat failed (see around PrintQueryResult), which would cause somevariables to not be set, like ROW_COUNT, SQLSTATE or ERROR. This can beconfusing as a previous result would be retained.This state could be reached when failing to process tuples in a fewcommands, like \gset when it returns no tuples, or \crosstabview. Atest is added, based on \gset.This is arguably a bug fix, but no backpatch is done as there is a riskof breaking scripts that rely on the previous behavior, even if they doso accidentally.Reported-by: amutuAuthor: Japin LiReviewed-by: Tom Lane, Michael PaquierDiscussion:https://postgr.es/m/18134-87126d90cb4dd049@postgresql.org1 parente1f95ec commit2940f1c
3 files changed
+12
-3
lines changedLines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1659 | 1659 |
| |
1660 | 1660 |
| |
1661 | 1661 |
| |
1662 |
| - | |
1663 |
| - | |
1664 |
| - | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
1665 | 1665 |
| |
1666 | 1666 |
| |
1667 | 1667 |
| |
|
Lines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
171 | 171 |
| |
172 | 172 |
| |
173 | 173 |
| |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
174 | 179 |
| |
175 | 180 |
| |
176 | 181 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
87 | 87 |
| |
88 | 88 |
| |
89 | 89 |
| |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
90 | 94 |
| |
91 | 95 |
| |
92 | 96 |
| |
|
0 commit comments
Comments
(0)