Commit 4879a51
committed
Support plpgsql variable names that conflict with unreserved SQL keywords.
A variable name matching a statement-introducing keyword, such as
"comment" or "update", caused parse failures if one tried to write
a statement using that keyword. Commit bb1b8f6 already addressed
this scenario for the case of variable names matching unreserved
plpgsql keywords, but we didn't think about unreserved core-grammar
keywords. The same heuristic (viz, it can't be a variable name
unless the next token is assignment or '[') should work fine for
that case too, and as a bonus the code gets shorter and less
duplicative.
Per bug #15555 from Feike Steenbergen. Since this hasn't been
complained of before, and is easily worked around anyway,
I won't risk a back-patch.
Discussion: https://postgr.es/m/15555-149bbd70ddc7b4b6@postgresql.org1 parent cb719fa commit 4879a51
File tree
5 files changed
+75
-49
lines changed- src
- pl/plpgsql/src
- test/regress
- expected
- sql
5 files changed
+75
-49
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1353 | 1353 | | |
1354 | 1354 | | |
1355 | 1355 | | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
1356 | 1359 | | |
1357 | 1360 | | |
1358 | 1361 | | |
1359 | 1362 | | |
1360 | 1363 | | |
1361 | 1364 | | |
1362 | 1365 | | |
1363 | | - | |
| 1366 | + | |
1364 | 1367 | | |
1365 | 1368 | | |
1366 | 1369 | | |
1367 | 1370 | | |
1368 | 1371 | | |
1369 | | - | |
1370 | | - | |
1371 | | - | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
1372 | 1375 | | |
1373 | | - | |
| 1376 | + | |
1374 | 1377 | | |
1375 | 1378 | | |
1376 | 1379 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
328 | 328 | | |
329 | 329 | | |
330 | 330 | | |
| 331 | + | |
331 | 332 | | |
332 | 333 | | |
333 | 334 | | |
| |||
349 | 350 | | |
350 | 351 | | |
351 | 352 | | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
359 | 368 | | |
360 | | - | |
361 | | - | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
362 | 381 | | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
| 382 | + | |
| 383 | + | |
379 | 384 | | |
380 | 385 | | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
| 386 | + | |
399 | 387 | | |
400 | 388 | | |
401 | 389 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1175 | 1175 | | |
1176 | 1176 | | |
1177 | 1177 | | |
1178 | | - | |
| 1178 | + | |
1179 | 1179 | | |
1180 | 1180 | | |
1181 | 1181 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4781 | 4781 | | |
4782 | 4782 | | |
4783 | 4783 | | |
| 4784 | + | |
| 4785 | + | |
| 4786 | + | |
| 4787 | + | |
| 4788 | + | |
| 4789 | + | |
| 4790 | + | |
| 4791 | + | |
| 4792 | + | |
| 4793 | + | |
| 4794 | + | |
| 4795 | + | |
| 4796 | + | |
| 4797 | + | |
| 4798 | + | |
| 4799 | + | |
| 4800 | + | |
| 4801 | + | |
| 4802 | + | |
| 4803 | + | |
| 4804 | + | |
4784 | 4805 | | |
4785 | 4806 | | |
4786 | 4807 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3892 | 3892 | | |
3893 | 3893 | | |
3894 | 3894 | | |
| 3895 | + | |
| 3896 | + | |
| 3897 | + | |
| 3898 | + | |
| 3899 | + | |
| 3900 | + | |
| 3901 | + | |
| 3902 | + | |
| 3903 | + | |
| 3904 | + | |
| 3905 | + | |
| 3906 | + | |
| 3907 | + | |
| 3908 | + | |
3895 | 3909 | | |
3896 | 3910 | | |
3897 | 3911 | | |
| |||
0 commit comments