forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitcdde886
committed
Fix crash when using partition bound expressions
Since7c079d7, partition bounds are able to use generalized expressionsyntax when processed, treating "minvalue" and "maxvalue" as specificcases as they get passed down for transformation as a column references.The checks for infinite bounds in range expressions have been laxthough, causing crashes when trying to use column reference names withmore than one field. Here is an example causing a crash:CREATE TABLE list_parted (a int) PARTITION BY LIST (a);CREATE TABLE part_list_crash PARTITION OF list_parted FOR VALUES IN (somename.somename);Note that the creation of the second relation should fail as partitionbounds cannot have column references in their expressions, so whenfinding an expression which does not match the expected infinite bounds,then this commit lets the generic transformation machinery check afterit. The error message generated in this case references as well amissing RTE, which is confusing. This problem will be treatedseparately as it impacts as well default expressions for some time, andfor now only the cases where a crash can happen are fixed.While on it, extend the set of regression tests in place for listpartition bounds and add an extra set for range partition bounds.Reported-by: Alexander LakhinAuthor: Michael PaquierReviewed-by: Amit LangoteDiscussion:https://postgr.es/m/15668-0377b1981aa1a393@postgresql.org1 parent2e3da03 commitcdde886
File tree
3 files changed
+90
-4
lines changed- src
- backend/parser
- test/regress
- expected
- sql
3 files changed
+90
-4
lines changedLines changed: 14 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3746 | 3746 |
| |
3747 | 3747 |
| |
3748 | 3748 |
| |
| 3749 | + | |
| 3750 | + | |
| 3751 | + | |
| 3752 | + | |
3749 | 3753 |
| |
3750 | 3754 |
| |
3751 | 3755 |
| |
3752 | 3756 |
| |
3753 |
| - | |
3754 |
| - | |
| 3757 | + | |
| 3758 | + | |
| 3759 | + | |
| 3760 | + | |
| 3761 | + | |
| 3762 | + | |
| 3763 | + | |
| 3764 | + | |
| 3765 | + | |
| 3766 | + | |
3755 | 3767 |
| |
3756 | 3768 |
| |
3757 | 3769 |
| |
|
Lines changed: 54 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
489 | 489 |
| |
490 | 490 |
| |
491 | 491 |
| |
492 |
| - | |
| 492 | + | |
493 | 493 |
| |
494 | 494 |
| |
495 | 495 |
| |
496 | 496 |
| |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
497 | 501 |
| |
498 | 502 |
| |
499 | 503 |
| |
| |||
502 | 506 |
| |
503 | 507 |
| |
504 | 508 |
| |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
505 | 517 |
| |
506 | 518 |
| |
507 | 519 |
| |
| |||
558 | 570 |
| |
559 | 571 |
| |
560 | 572 |
| |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
561 | 614 |
| |
562 | 615 |
| |
563 | 616 |
| |
|
Lines changed: 22 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
450 | 450 |
| |
451 | 451 |
| |
452 | 452 |
| |
453 |
| - | |
| 453 | + | |
454 | 454 |
| |
| 455 | + | |
455 | 456 |
| |
456 | 457 |
| |
| 458 | + | |
| 459 | + | |
457 | 460 |
| |
458 | 461 |
| |
459 | 462 |
| |
| |||
497 | 500 |
| |
498 | 501 |
| |
499 | 502 |
| |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
500 | 521 |
| |
501 | 522 |
| |
502 | 523 |
| |
|
0 commit comments
Comments
(0)