Commit 6b96824
committed
Fix CTAS crash.
If we create a replicated table when selecting project volatile
functions from a randomly distributed table, we will try to add
a Motion on a Motion node that will cause a crash.
Create table t1(id int) distributed randomly;
Create table t2 as select random() from t1 distributed replicated;
planner may have add a top Motion earlier if we know the query's
final locus. Some codes handle volatile functions lead us to
create_motion_path_for_insert(), and we should consider the case
to avoid Assertion failure when create_plan().
Authored-by: Zhang Mingli avamingli@gmail.com1 parent a402666 commit 6b96824
4 files changed
Lines changed: 16 additions & 1 deletion
File tree
- src
- backend/cdb
- test/regress
- expected
- sql
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2622 | 2622 | | |
2623 | 2623 | | |
2624 | 2624 | | |
2625 | | - | |
| 2625 | + | |
| 2626 | + | |
| 2627 | + | |
| 2628 | + | |
| 2629 | + | |
| 2630 | + | |
| 2631 | + | |
| 2632 | + | |
| 2633 | + | |
2626 | 2634 | | |
2627 | 2635 | | |
2628 | 2636 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
663 | 663 | | |
664 | 664 | | |
665 | 665 | | |
| 666 | + | |
| 667 | + | |
666 | 668 | | |
667 | 669 | | |
668 | 670 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
681 | 681 | | |
682 | 682 | | |
683 | 683 | | |
| 684 | + | |
| 685 | + | |
684 | 686 | | |
685 | 687 | | |
686 | 688 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
345 | 345 | | |
346 | 346 | | |
347 | 347 | | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
348 | 351 | | |
349 | 352 | | |
350 | 353 | | |
| |||
0 commit comments