Commit 6b2c4e5
committed
Improve error cursor positions for problems with partition bounds.
We failed to pass down the query string to check_new_partition_bound,
so that its attempts to provide error cursor positions were for naught;
one must have the query string to get parser_errposition to do anything.
Adjust its API to require a ParseState to be passed down.
Also, improve the logic inside check_new_partition_bound so that the
cursor points at the partition bound for the specific column causing
the issue, when one can be identified.
That part is also for naught if we can't determine the query position of
the column with the problem. Improve transformPartitionBoundValue so
that it makes sure that const-simplified partition expressions will be
properly labeled with positions. In passing, skip calling evaluate_expr
if the value is already a Const, which is surely the most common case.
Alexandra Wang, Ashwin Agrawal, Amit Langote; reviewed by Ashutosh Bapat
Discussion: https://postgr.es/m/CACiyaSopZoqssfMzgHk6fAkp01cL6vnqBdmTw2C5_KJaFR_aMg@mail.gmail.com
Discussion: https://postgr.es/m/CAJV4CdrZ5mKuaEsRSbLf2URQ3h6iMtKD=hik8MaF5WwdmC9uZw@mail.gmail.com1 parent 3ea7e95 commit 6b2c4e5
File tree
6 files changed
+160
-58
lines changed- src
- backend
- commands
- parser
- partitioning
- include/partitioning
- test/regress/expected
6 files changed
+160
-58
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
543 | 543 | | |
544 | 544 | | |
545 | 545 | | |
546 | | - | |
| 546 | + | |
| 547 | + | |
547 | 548 | | |
548 | 549 | | |
549 | 550 | | |
| |||
1007 | 1008 | | |
1008 | 1009 | | |
1009 | 1010 | | |
1010 | | - | |
| 1011 | + | |
1011 | 1012 | | |
1012 | 1013 | | |
1013 | 1014 | | |
| |||
4718 | 4719 | | |
4719 | 4720 | | |
4720 | 4721 | | |
4721 | | - | |
| 4722 | + | |
| 4723 | + | |
4722 | 4724 | | |
4723 | 4725 | | |
4724 | 4726 | | |
| |||
16280 | 16282 | | |
16281 | 16283 | | |
16282 | 16284 | | |
16283 | | - | |
| 16285 | + | |
| 16286 | + | |
16284 | 16287 | | |
16285 | 16288 | | |
16286 | 16289 | | |
| |||
16295 | 16298 | | |
16296 | 16299 | | |
16297 | 16300 | | |
| 16301 | + | |
| 16302 | + | |
| 16303 | + | |
16298 | 16304 | | |
16299 | 16305 | | |
16300 | 16306 | | |
| |||
16460 | 16466 | | |
16461 | 16467 | | |
16462 | 16468 | | |
16463 | | - | |
| 16469 | + | |
16464 | 16470 | | |
16465 | 16471 | | |
16466 | 16472 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4164 | 4164 | | |
4165 | 4165 | | |
4166 | 4166 | | |
4167 | | - | |
| 4167 | + | |
4168 | 4168 | | |
4169 | 4169 | | |
4170 | 4170 | | |
| |||
4176 | 4176 | | |
4177 | 4177 | | |
4178 | 4178 | | |
| 4179 | + | |
| 4180 | + | |
| 4181 | + | |
| 4182 | + | |
| 4183 | + | |
| 4184 | + | |
| 4185 | + | |
4179 | 4186 | | |
4180 | 4187 | | |
4181 | 4188 | | |
| |||
4220 | 4227 | | |
4221 | 4228 | | |
4222 | 4229 | | |
4223 | | - | |
| 4230 | + | |
| 4231 | + | |
| 4232 | + | |
| 4233 | + | |
| 4234 | + | |
4224 | 4235 | | |
4225 | 4236 | | |
4226 | 4237 | | |
| |||
4236 | 4247 | | |
4237 | 4248 | | |
4238 | 4249 | | |
4239 | | - | |
4240 | | - | |
4241 | | - | |
4242 | | - | |
4243 | 4250 | | |
4244 | | - | |
4245 | | - | |
4246 | | - | |
| 4251 | + | |
| 4252 | + | |
4247 | 4253 | | |
4248 | | - | |
| 4254 | + | |
| 4255 | + | |
| 4256 | + | |
| 4257 | + | |
| 4258 | + | |
| 4259 | + | |
| 4260 | + | |
| 4261 | + | |
| 4262 | + | |
| 4263 | + | |
| 4264 | + | |
| 4265 | + | |
| 4266 | + | |
| 4267 | + | |
| 4268 | + | |
| 4269 | + | |
| 4270 | + | |
| 4271 | + | |
4249 | 4272 | | |
4250 | 4273 | | |
4251 | | - | |
4252 | | - | |
| 4274 | + | |
| 4275 | + | |
| 4276 | + | |
4253 | 4277 | | |
4254 | | - | |
4255 | | - | |
4256 | | - | |
4257 | | - | |
| 4278 | + | |
4258 | 4279 | | |
4259 | 4280 | | |
4260 | 4281 | | |
0 commit comments