forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit68ab8e8
committed
SQL commands in pgbench scripts are now ended by semicolons, not newlines.
To allow multiline SQL commands in scripts, adopt the same rules psql usesto decide what is the end of a SQL command, to wit, an unquoted semicolonnot encased in parentheses. Do this by importing the same flex lexer thatpsql uses, since coping with stuff like dollar-quoted literals is hard toget right without going the full nine yards.This makes use of the infrastructure added in commit0ea9efb tosupport independently-written flex lexers scanning the same PsqlScanStateinput-buffer data structure. Since that infrastructure isn't veryfriendly to ad-hoc parsing code such as strtok(), improve exprscan.lso that it can parse either whitespace-separated words or expressiontokens, on demand, and rewrite pgbench.c's backslash-command parsingcode to always use the lexer to fetch tokens.It's still the case that pgbench backslash commands extend to the endof the line, no more and no less. That could be changed in a fairlylocalized way now, and there was some interest in doing so, but itseems like material for a separate patch.In passing, make some marginal cleanups in syntax error reporting,const-ify a few data structures that could use it, and run some ofthis code through pgindent.I can't tell whether the MSVC build scripts need to be taught explicitlyabout the changes here or not, but the buildfarm will soon tell us.Kyotaro Horiguchi and Tom Lane1 parent5d03201 commit68ab8e8
File tree
6 files changed
+776
-441
lines changed- doc/src/sgml/ref
- src/bin/pgbench
6 files changed
+776
-441
lines changedLines changed: 29 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
743 | 743 |
| |
744 | 744 |
| |
745 | 745 |
| |
746 |
| - | |
747 |
| - | |
748 |
| - | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
749 | 749 |
| |
750 | 750 |
| |
751 | 751 |
| |
752 | 752 |
| |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
753 | 765 |
| |
754 | 766 |
| |
755 | 767 |
| |
| |||
789 | 801 |
| |
790 | 802 |
| |
791 | 803 |
| |
792 |
| - | |
| 804 | + | |
| 805 | + | |
793 | 806 |
| |
794 | 807 |
| |
795 | 808 |
| |
| |||
806 | 819 |
| |
807 | 820 |
| |
808 | 821 |
| |
809 |
| - | |
| 822 | + | |
810 | 823 |
| |
811 |
| - | |
| 824 | + | |
812 | 825 |
| |
813 | 826 |
| |
814 | 827 |
| |
| |||
938 | 951 |
| |
939 | 952 |
| |
940 | 953 |
| |
941 |
| - | |
942 |
| - | |
| 954 | + | |
| 955 | + | |
943 | 956 |
| |
944 | 957 |
| |
945 |
| - | |
946 |
| - | |
947 |
| - | |
948 |
| - | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
949 | 963 |
| |
950 | 964 |
| |
951 | 965 |
| |
| |||
964 | 978 |
| |
965 | 979 |
| |
966 | 980 |
| |
967 |
| - | |
| 981 | + | |
| 982 | + | |
968 | 983 |
| |
969 | 984 |
| |
970 | 985 |
| |
| |||
1010 | 1025 |
| |
1011 | 1026 |
| |
1012 | 1027 |
| |
1013 |
| - | |
| 1028 | + | |
1014 | 1029 |
| |
1015 | 1030 |
| |
1016 | 1031 |
| |
|
Lines changed: 12 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 |
| - | |
| 10 | + | |
11 | 11 |
| |
12 |
| - | |
| 12 | + | |
| 13 | + | |
13 | 14 |
| |
14 | 15 |
| |
15 | 16 |
| |
| |||
24 | 25 |
| |
25 | 26 |
| |
26 | 27 |
| |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
27 | 37 |
| |
28 | 38 |
| |
29 | 39 |
| |
|
Lines changed: 43 additions & 22 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
22 | 22 |
| |
23 | 23 |
| |
24 | 24 |
| |
25 |
| - | |
26 |
| - | |
| 25 | + | |
| 26 | + | |
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
| |||
114 | 114 |
| |
115 | 115 |
| |
116 | 116 |
| |
117 |
| - | |
| 117 | + | |
118 | 118 |
| |
119 | 119 |
| |
120 |
| - | |
| 120 | + | |
121 | 121 |
| |
122 |
| - | |
123 |
| - | |
| 122 | + | |
| 123 | + | |
124 | 124 |
| |
125 |
| - | |
| 125 | + | |
| 126 | + | |
126 | 127 |
| |
127 |
| - | |
128 |
| - | |
129 |
| - | |
130 |
| - | |
131 |
| - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
132 | 143 |
| |
133 |
| - | |
134 |
| - | |
135 |
| - | |
136 |
| - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
137 | 156 |
| |
138 |
| - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
139 | 160 |
| |
140 | 161 |
| |
141 | 162 |
| |
| |||
147 | 168 |
| |
148 | 169 |
| |
149 | 170 |
| |
150 |
| - | |
| 171 | + | |
151 | 172 |
| |
152 | 173 |
| |
153 | 174 |
| |
| |||
166 | 187 |
| |
167 | 188 |
| |
168 | 189 |
| |
169 |
| - | |
| 190 | + | |
170 | 191 |
| |
171 | 192 |
| |
172 | 193 |
| |
| |||
193 | 214 |
| |
194 | 215 |
| |
195 | 216 |
| |
196 |
| - | |
197 |
| - | |
| 217 | + | |
| 218 | + | |
198 | 219 |
| |
199 | 220 |
| |
200 | 221 |
| |
| |||
225 | 246 |
| |
226 | 247 |
| |
227 | 248 |
| |
228 |
| - | |
| 249 | + | |
229 | 250 |
| |
230 | 251 |
| |
231 | 252 |
| |
|
0 commit comments
Comments
(0)