forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit6eb8a1a
committed
Avoid unnecessary computation of pgbench's script line number.
ParseScript only needs the lineno for meta-commands, so let's notbother computing it otherwise. While this doesn't save much giventhe previous patch, there's no point in doing unnecessary work.While we're at it, avoid calling psql_scan_get_location() twice fora meta-command.One reason for making this change is that the line number computedin ParseScript's main loop was actually wrong in most cases: itwould point just past the semicolon of the previous SQL command,not at what the user thinks the current command's line number is.We could add some code to skip whitespace before capturing the linenumber, but it would be pretty pointless at present. Just move thecall to avoid the temptation to rely on that value. (Once we'velexed the backslash, the computed line number will be right.)This change also means that pgbench never inquires about thelocation before it's lexed something, so that the care taken inthe previous patch to behave sanely in that case is unnecessary.It seems best to keep that logic, though, as future callersmight depend on it.Author: Daniel Vérité <daniel@manitou-mail.org>Discussion:https://postgr.es/m/84a8a89e-adb8-47a9-9d34-c13f7150ee45@manitou-mail.org1 parentc8c74ad commit6eb8a1a
1 file changed
+11
-12
lines changedLines changed: 11 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5677 | 5677 |
| |
5678 | 5678 |
| |
5679 | 5679 |
| |
5680 |
| - | |
| 5680 | + | |
| 5681 | + | |
5681 | 5682 |
| |
5682 | 5683 |
| |
5683 | 5684 |
| |
5684 | 5685 |
| |
5685 | 5686 |
| |
5686 |
| - | |
5687 |
| - | |
5688 | 5687 |
| |
5689 | 5688 |
| |
5690 | 5689 |
| |
5691 | 5690 |
| |
5692 |
| - | |
5693 |
| - | |
5694 |
| - | |
5695 |
| - | |
5696 | 5691 |
| |
5697 | 5692 |
| |
5698 | 5693 |
| |
| |||
5980 | 5975 |
| |
5981 | 5976 |
| |
5982 | 5977 |
| |
5983 |
| - | |
5984 |
| - | |
5985 | 5978 |
| |
5986 | 5979 |
| |
5987 | 5980 |
| |
5988 | 5981 |
| |
5989 | 5982 |
| |
5990 | 5983 |
| |
5991 |
| - | |
5992 |
| - | |
5993 | 5984 |
| |
5994 | 5985 |
| |
5995 | 5986 |
| |
| |||
6002 | 5993 |
| |
6003 | 5994 |
| |
6004 | 5995 |
| |
6005 |
| - | |
| 5996 | + | |
| 5997 | + | |
| 5998 | + | |
| 5999 | + | |
| 6000 | + | |
| 6001 | + | |
| 6002 | + | |
| 6003 | + | |
| 6004 | + | |
6006 | 6005 |
| |
6007 | 6006 |
| |
6008 | 6007 |
| |
|
0 commit comments
Comments
(0)