forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd9a4cce
committed
Fix error case for CREATE ROLE ... IN ROLE.
CreateRole() was passing a Value node, not a RoleSpec node, for thenewly-created role name when adding the role as a member of existingroles for the IN ROLE syntax.This mistake went unnoticed because the node in question is used onlyfor error messages and is not accessed on non-error paths.In older pg versions (such as 9.5 where this was found), this resultsin an "unexpected node type" error in place of the real error. Thatnode type check was removed at some point, after which the code wouldaccidentally fail to fail on 64-bit platforms (on which accessing theValue node as if it were a RoleSpec would be mostly harmless) or givean "unexpected role type" error on 32-bit platforms.Fix the code to pass the correct node type, and add an lfirst_nodeassertion just in case.Per report on irc from user m1chelangelo.Backpatch all the way, because this error has been around for a longtime.1 parent6c5f916 commitd9a4cce
1 file changed
+24
-13
lines changedLines changed: 24 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
470 | 470 |
| |
471 | 471 |
| |
472 | 472 |
| |
473 |
| - | |
| 473 | + | |
474 | 474 |
| |
475 |
| - | |
476 |
| - | |
477 |
| - | |
478 |
| - | |
479 |
| - | |
480 |
| - | |
481 |
| - | |
482 |
| - | |
483 |
| - | |
484 |
| - | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
485 | 482 |
| |
486 |
| - | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
487 | 498 |
| |
488 | 499 |
| |
489 | 500 |
| |
| |||
1503 | 1514 |
| |
1504 | 1515 |
| |
1505 | 1516 |
| |
1506 |
| - | |
| 1517 | + | |
1507 | 1518 |
| |
1508 | 1519 |
| |
1509 | 1520 |
| |
|
0 commit comments
Comments
(0)