From f24d584845b43eafd7814c9ad30508a1211bc759 Mon Sep 17 00:00:00 2001 From: junsklee Date: Wed, 16 Oct 2024 13:17:05 +0900 Subject: [PATCH] [CBRD-25484] Added a new sql test case for When using inner joins and Oracle style outer joins together, errors occur depending on the order of the join conditions --- .../_24_2h/answers/cbrd_25484_1.answer | 901 ++++++++++++++ .../_24_2h/answers/cbrd_25484_2.answer | 1050 +++++++++++++++++ .../_24_2h/cases/cbrd_25484_1.queryPlan | 0 sql/_13_issues/_24_2h/cases/cbrd_25484_1.sql | 129 ++ .../_24_2h/cases/cbrd_25484_2.queryPlan | 0 sql/_13_issues/_24_2h/cases/cbrd_25484_2.sql | 136 +++ 6 files changed, 2216 insertions(+) create mode 100755 sql/_13_issues/_24_2h/answers/cbrd_25484_1.answer create mode 100755 sql/_13_issues/_24_2h/answers/cbrd_25484_2.answer create mode 100644 sql/_13_issues/_24_2h/cases/cbrd_25484_1.queryPlan create mode 100644 sql/_13_issues/_24_2h/cases/cbrd_25484_1.sql create mode 100644 sql/_13_issues/_24_2h/cases/cbrd_25484_2.queryPlan create mode 100644 sql/_13_issues/_24_2h/cases/cbrd_25484_2.sql diff --git a/sql/_13_issues/_24_2h/answers/cbrd_25484_1.answer b/sql/_13_issues/_24_2h/answers/cbrd_25484_1.answer new file mode 100755 index 0000000000..93827ac19b --- /dev/null +++ b/sql/_13_issues/_24_2h/answers/cbrd_25484_1.answer @@ -0,0 +1,901 @@ +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== + +1. When there are no table specs other than left_tbl and right_tbl + +=================================================== +1 + +Query plan: +nl-join (left outer join) + edge: term[?] + outer: sscan + class: lt node[?] + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from left_tbl lt left outer join right_tbl rt on lt.col_a=rt.col_a +=================================================== + +2. Spec with join_type == PT_JOIN_NONE is on the left side of left_tbl + +=================================================== +1 + +Query plan: +nl-join (left outer join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: sscan + class: t_a node[?] + cost: ? card ? + inner: sscan + class: t_b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: lt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from tbl_a t_a, tbl_b t_b, left_tbl lt left outer join right_tbl rt on lt.col_a=rt.col_a where t_a.col_a=t_b.col_a and t_a.col_a=lt.col_a +=================================================== + +3. Spec with join_type == PT_JOIN_NONE is on the left side of left_tbl + +=================================================== +1 + +Query plan: +nl-join (cross join) + outer: nl-join (cross join) + outer: sscan + class: t_a node[?] + cost: ? card ? + inner: sscan + class: t_b node[?] + cost: ? card ? + cost: ? card ? + inner: temp + order: UNORDERED + subplan: nl-join (left outer join) + edge: term[?] + outer: sscan + class: lt node[?] + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from tbl_a t_a, tbl_b t_b, left_tbl lt left outer join right_tbl rt on lt.col_a=rt.col_a +=================================================== + +4. Spec with join_type == PT_JOIN_NONE is on the left side of left_tbl + +=================================================== +1 + +Query plan: +nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: t_a node[?] + cost: ? card ? + inner: sscan + class: t_b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: lt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from tbl_a t_a left outer join tbl_b t_b on t_a.col_a=t_b.col_a left outer join left_tbl lt on t_a.col_a=lt.col_a left outer join right_tbl rt on lt.col_a=rt.col_a +=================================================== + +5. Spec with join_type == PT_JOIN_NONE and another spec with join_type != PT_JOIN_NONE are on the left side of left_tbl + +=================================================== +1 + +Query plan: +nl-join (left outer join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: t_a node[?] + cost: ? card ? + inner: sscan + class: t_b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: lt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from tbl_a t_a left outer join tbl_b t_b on t_a.col_a=t_b.col_a, left_tbl lt left outer join right_tbl rt on lt.col_a=rt.col_a where t_a.col_a=lt.col_a +=================================================== + +6. Spec with join_type == PT_JOIN_NONE and another spec with join_type != PT_JOIN_NONE are on the left side of left_tbl + +=================================================== +1 + +Query plan: +nl-join (cross join) + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: t_a node[?] + cost: ? card ? + inner: sscan + class: t_b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: temp + order: UNORDERED + subplan: nl-join (left outer join) + edge: term[?] + outer: sscan + class: lt node[?] + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from tbl_a t_a left outer join tbl_b t_b on t_a.col_a=t_b.col_a, left_tbl lt left outer join right_tbl rt on lt.col_a=rt.col_a +=================================================== + +7. Spec with join_type == PT_JOIN_NONE and another spec with join_type != PT_JOIN_NONE are on the left side of left_tbl + +=================================================== +1 + +Query plan: +nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: t_a node[?] + cost: ? card ? + inner: sscan + class: t_b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: lt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from tbl_a t_a left outer join tbl_b t_b on t_a.col_a=t_b.col_a left outer join left_tbl lt on t_a.col_a=lt.col_a left outer join right_tbl rt on lt.col_a=rt.col_a +=================================================== + +8. Spec with join_type == PT_JOIN_NONE is between left_tbl and right_tbl + +=================================================== +1 + +Query plan: +nl-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: sscan + class: lt node[?] + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_a node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from left_tbl lt, right_tbl rt, tbl_a t_a, tbl_b t_b where t_a.col_a=t_b.col_a and rt.col_a=t_a.col_a and lt.col_a=rt.col_a +=================================================== + +9. Spec with join_type == PT_JOIN_NONE is between left_tbl and right_tbl + +=================================================== +1 + +Query plan: +nl-join (cross join) + outer: nl-join (cross join) + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: lt node[?] + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_a node[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_b node[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from left_tbl lt left outer join right_tbl rt on lt.col_a=rt.col_a, tbl_a t_a, tbl_b t_b +=================================================== + +10. Spec with join_type == PT_JOIN_NONE is between left_tbl and right_tbl + +=================================================== +1 + +Query plan: +nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: lt node[?] + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_a node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from left_tbl lt left outer join right_tbl rt on lt.col_a=rt.col_a left outer join tbl_a t_a on rt.col_a=t_a.col_a left outer join tbl_b t_b on t_a.col_a=t_b.col_a +=================================================== + +11. Spec with join_type == PT_JOIN_NONE and another spec with join_type != PT_JOIN_NONE is between left_tbl and right_tbl + +=================================================== +1 + +Query plan: +nl-join (left outer join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: sscan + class: lt node[?] + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_a node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from left_tbl lt, right_tbl rt, tbl_a t_a left outer join tbl_b t_b on t_a.col_a=t_b.col_a where rt.col_a=t_a.col_a and lt.col_a=rt.col_a +=================================================== + +12. Spec with join_type == PT_JOIN_NONE and another spec with join_type != PT_JOIN_NONE is between left_tbl and right_tbl + +=================================================== +1 + +Query plan: +nl-join (cross join) + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: lt node[?] + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: temp + order: UNORDERED + subplan: nl-join (left outer join) + edge: term[?] + outer: sscan + class: t_a node[?] + cost: ? card ? + inner: sscan + class: t_b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from left_tbl lt left outer join right_tbl rt on lt.col_a=rt.col_a, tbl_a t_a left outer join tbl_b t_b on t_a.col_a=t_b.col_a +=================================================== + +13. Spec with join_type == PT_JOIN_NONE and another spec with join_type != PT_JOIN_NONE is between left_tbl and right_tbl + +=================================================== +1 + +Query plan: +nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: lt node[?] + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_a node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from left_tbl lt left outer join right_tbl rt on lt.col_a=rt.col_a left outer join tbl_a t_a on rt.col_a=t_a.col_a left outer join tbl_b t_b on t_a.col_a=t_b.col_a +=================================================== + +14. Spec with join_type != PT_JOIN_NONE and another spec with join_type == PT_JOIN_NONE is between left_tbl and right_tbl + +=================================================== +1 + +Query plan: +nl-join (inner join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: sscan + class: lt node[?] + cost: ? card ? + inner: sscan + class: t_a node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from left_tbl lt inner join tbl_a t_a left outer join right_tbl rt on lt.col_a=rt.col_a, tbl_b t_b where t_a.col_a=t_b.col_a and lt.col_a=t_a.col_a +=================================================== + +15. Spec with join_type != PT_JOIN_NONE and another spec with join_type == PT_JOIN_NONE is between left_tbl and right_tbl + +=================================================== +1 + +Query plan: +nl-join (cross join) + outer: nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: lt node[?] + cost: ? card ? + inner: sscan + class: t_a node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_b node[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from left_tbl lt left outer join tbl_a t_a on lt.col_a=t_a.col_a left outer join right_tbl rt on lt.col_a=rt.col_a, tbl_b t_b +=================================================== + +16. Spec with join_type != PT_JOIN_NONE and another spec with join_type == PT_JOIN_NONE is between left_tbl and right_tbl + +=================================================== +1 + +Query plan: +nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: lt node[?] + cost: ? card ? + inner: sscan + class: t_a node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from left_tbl lt left outer join tbl_a t_a on lt.col_a=t_a.col_a left outer join right_tbl rt on lt.col_a=rt.col_a left outer join tbl_b t_b on t_a.col_a=t_b.col_a +=================================================== + +17. Spec with join_type != PT_JOIN_NONE is between left_tbl and right_tbl + +=================================================== +1 + +Query plan: +nl-join (left outer join) + edge: term[?] + outer: sscan + class: lt node[?] + cost: ? card ? + inner: temp + order: UNORDERED + subplan: nl-join (left outer join) + edge: term[?] + outer: sscan + class: rt node[?] + cost: ? card ? + inner: sscan + class: t_a node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from tbl_a t_a right outer join right_tbl rt on rt.col_a=t_a.col_a right outer join left_tbl lt on lt.col_a=rt.col_a +=================================================== + +18. Spec with join_type == PT_JOIN_NONE is on the right side of right_tbl + +=================================================== +1 + +Query plan: +nl-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: lt node[?] + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_a node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from left_tbl lt left outer join right_tbl rt on lt.col_a=rt.col_a, tbl_a t_a, tbl_b t_b where t_a.col_a=t_b.col_a and t_a.col_a=lt.col_a +=================================================== + +19. Spec with join_type == PT_JOIN_NONE is on the right side of right_tbl + +=================================================== +1 + +Query plan: +nl-join (cross join) + outer: nl-join (cross join) + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: lt node[?] + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_a node[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_b node[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from left_tbl lt left outer join right_tbl rt on lt.col_a=rt.col_a, tbl_a t_a, tbl_b t_b +=================================================== + +20. Spec with join_type == PT_JOIN_NONE is on the right side of right_tbl + +=================================================== +1 + +Query plan: +nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: lt node[?] + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_a node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from left_tbl lt left outer join right_tbl rt on lt.col_a=rt.col_a left outer join tbl_a t_a on t_a.col_a=lt.col_a left outer join tbl_b t_b on t_a.col_a=t_b.col_a +=================================================== + +21. Spec with join_type == PT_JOIN_NONE and another spec with join_type != PT_JOIN_NONE is on the right side of right_tbl + +=================================================== +1 + +Query plan: +nl-join (left outer join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: lt node[?] + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_a node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from left_tbl lt left outer join right_tbl rt on lt.col_a=rt.col_a, tbl_a t_a left outer join tbl_b t_b on t_a.col_a=t_b.col_a where t_a.col_a=lt.col_a +=================================================== + +22. Spec with join_type == PT_JOIN_NONE and another spec with join_type != PT_JOIN_NONE is on the right side of right_tbl + +=================================================== +1 + +Query plan: +nl-join (cross join) + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: lt node[?] + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: temp + order: UNORDERED + subplan: nl-join (left outer join) + edge: term[?] + outer: sscan + class: t_a node[?] + cost: ? card ? + inner: sscan + class: t_b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from left_tbl lt left outer join right_tbl rt on lt.col_a=rt.col_a, tbl_a t_a left outer join tbl_b t_b on t_a.col_a=t_b.col_a +=================================================== + +23. Spec with join_type == PT_JOIN_NONE and another spec with join_type != PT_JOIN_NONE is on the right side of right_tbl + +=================================================== +1 + +Query plan: +nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: lt node[?] + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_a node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from left_tbl lt left outer join right_tbl rt on lt.col_a=rt.col_a left outer join tbl_a t_a on t_a.col_a=lt.col_a left outer join tbl_b t_b on t_a.col_a=t_b.col_a +=================================================== + +24. Spec with join_type != PT_JOIN_NONE and another spec with join_type == PT_JOIN_NONE is on the right side of right_tbl + +=================================================== +1 + +Query plan: +nl-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: sscan + class: lt node[?] + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_a node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from left_tbl lt, right_tbl rt, tbl_a t_a, tbl_b t_b where t_b.col_a=t_a.col_a and lt.col_a=rt.col_a and rt.col_a=t_a.col_a +=================================================== + +25. Spec with join_type != PT_JOIN_NONE and another spec with join_type == PT_JOIN_NONE is on the right side of right_tbl + +=================================================== +1 + +Query plan: +nl-join (cross join) + outer: nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: lt node[?] + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_a node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_b node[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from left_tbl lt left outer join right_tbl rt on lt.col_a=rt.col_a left outer join tbl_a t_a on rt.col_a=t_a.col_a, tbl_b t_b +=================================================== + +26. Spec with join_type != PT_JOIN_NONE and another spec with join_type == PT_JOIN_NONE is on the right side of right_tbl + +=================================================== +1 + +Query plan: +nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: lt node[?] + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_a node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from left_tbl lt left outer join right_tbl rt on lt.col_a=rt.col_a left outer join tbl_a t_a on rt.col_a=t_a.col_a left outer join tbl_b t_b on t_b.col_a=t_a.col_a +=================================================== + +27. Spec with join_type != PT_JOIN_NONE is between left_tbl and right_tbl + +=================================================== +1 + +Query plan: +nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: lt node[?] + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_a node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from left_tbl lt left outer join right_tbl rt on lt.col_a=rt.col_a left outer join tbl_a t_a on rt.col_a=t_a.col_a left outer join tbl_b t_b on t_a.col_a=t_b.col_a +=================================================== +0 diff --git a/sql/_13_issues/_24_2h/answers/cbrd_25484_2.answer b/sql/_13_issues/_24_2h/answers/cbrd_25484_2.answer new file mode 100755 index 0000000000..0d59995bdb --- /dev/null +++ b/sql/_13_issues/_24_2h/answers/cbrd_25484_2.answer @@ -0,0 +1,1050 @@ +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== +0 +=================================================== + +1. Spec with only left_tbl and right_tbl, and no other table specs with a join relationship + +=================================================== +1 + +Query plan: +nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: t_a node[?] + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: lt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from tbl_a t_a left outer join right_tbl rt on t_a.col_a=rt.col_a left outer join left_tbl lt on lt.col_a=rt.col_a +=================================================== + +2. Spec with join_type == PT_JOIN_NONE is on the left side of left_tbl + +=================================================== +1 + +Query plan: +nl-join (inner join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: lt node[?] + cost: ? card ? + inner: temp + order: UNORDERED + subplan: nl-join (left outer join) + edge: term[?] + outer: sscan + class: rt node[?] + cost: ? card ? + inner: sscan + class: t_b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_a node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from tbl_b t_b right outer join right_tbl rt on t_b.col_a=rt.col_a right outer join left_tbl lt on lt.col_a=rt.col_a, tbl_a t_a where t_a.col_a=lt.col_a +=================================================== + +3. Spec with join_type == PT_JOIN_NONE is on the left side of left_tbl + +=================================================== +1 + +Query plan: +nl-join (cross join) + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: lt node[?] + cost: ? card ? + inner: temp + order: UNORDERED + subplan: nl-join (left outer join) + edge: term[?] + outer: sscan + class: rt node[?] + cost: ? card ? + inner: sscan + class: t_b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_a node[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from tbl_b t_b right outer join right_tbl rt on t_b.col_a=rt.col_a right outer join left_tbl lt on lt.col_a=rt.col_a, tbl_a t_a +=================================================== + +4. Spec with join_type == PT_JOIN_NONE is on the left side of left_tbl + +=================================================== +1 + +Query plan: +nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: lt node[?] + cost: ? card ? + inner: temp + order: UNORDERED + subplan: nl-join (left outer join) + edge: term[?] + outer: sscan + class: rt node[?] + cost: ? card ? + inner: sscan + class: t_b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_a node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from tbl_b t_b right outer join right_tbl rt on t_b.col_a=rt.col_a right outer join left_tbl lt on lt.col_a=rt.col_a left outer join tbl_a t_a on t_a.col_a=lt.col_a +=================================================== + +5. Spec with join_type == PT_JOIN_NONE and another spec with join_type != PT_JOIN_NONE are on the left side of left_tbl + +=================================================== +1 + +Query plan: +nl-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: rt node[?] + cost: ? card ? + inner: sscan + class: t_c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: lt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_a node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from tbl_c t_c right outer join right_tbl rt on t_c.col_a=rt.col_a left outer join left_tbl lt on lt.col_a=rt.col_a, tbl_a t_a inner join tbl_b t_b where t_a.col_a=rt.col_a and t_a.col_a=t_b.col_a +=================================================== + +6. Spec with join_type == PT_JOIN_NONE and another spec with join_type != PT_JOIN_NONE are on the left side of left_tbl + +=================================================== +1 + +Query plan: +nl-join (cross join) + outer: nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: rt node[?] + cost: ? card ? + inner: sscan + class: t_c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: lt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: temp + order: UNORDERED + subplan: nl-join (left outer join) + edge: term[?] + outer: sscan + class: t_a node[?] + cost: ? card ? + inner: sscan + class: t_b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from tbl_c t_c right outer join right_tbl rt on t_c.col_a=rt.col_a left outer join left_tbl lt on lt.col_a=rt.col_a, tbl_a t_a left outer join tbl_b t_b on t_a.col_a=t_b.col_a +=================================================== + +7. Spec with join_type == PT_JOIN_NONE and another spec with join_type != PT_JOIN_NONE are on the left side of left_tbl + +=================================================== +Error:-494 +=================================================== + +8. Spec with join_type == PT_JOIN_NONE is between left_tbl and right_tbl + +=================================================== +1 + +Query plan: +nl-join (inner join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: sscan + class: t_b node[?] + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: lt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_a node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from tbl_b t_b inner join right_tbl rt left outer join left_tbl lt on lt.col_a=rt.col_a, tbl_a t_a where t_a.col_a=rt.col_a and t_b.col_a=rt.col_a +=================================================== + +9. Spec with join_type == PT_JOIN_NONE is between left_tbl and right_tbl + +=================================================== +1 + +Query plan: +nl-join (cross join) + outer: nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: t_b node[?] + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: lt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_a node[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from tbl_b t_b left outer join right_tbl rt on t_b.col_a=rt.col_a left outer join left_tbl lt on lt.col_a=rt.col_a, tbl_a t_a +=================================================== + +10. Spec with join_type == PT_JOIN_NONE is between left_tbl and right_tbl + +=================================================== +1 + +Query plan: +nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: t_b node[?] + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: lt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_a node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from tbl_b t_b left outer join right_tbl rt on t_b.col_a=rt.col_a left outer join left_tbl lt on lt.col_a=rt.col_a left outer join tbl_a t_a on t_a.col_a=t_b.col_a +=================================================== + +11. Spec with join_type == PT_JOIN_NONE and another spec with join_type != PT_JOIN_NONE is between left_tbl and right_tbl + +=================================================== +1 + +Query plan: +nl-join (left outer join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: t_c node[?] + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: lt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_a node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from tbl_c t_c left outer join right_tbl rt on t_c.col_a=rt.col_a left outer join left_tbl lt on lt.col_a=rt.col_a, tbl_a t_a left outer join tbl_b t_b on t_a.col_a=t_b.col_a where t_a.col_a=t_c.col_a +=================================================== + +12. Spec with join_type == PT_JOIN_NONE and another spec with join_type != PT_JOIN_NONE is between left_tbl and right_tbl + +=================================================== +1 + +Query plan: +nl-join (cross join) + outer: nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: t_c node[?] + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: lt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: temp + order: UNORDERED + subplan: nl-join (left outer join) + edge: term[?] + outer: sscan + class: t_a node[?] + cost: ? card ? + inner: sscan + class: t_b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from tbl_c t_c left outer join right_tbl rt on t_c.col_a=rt.col_a left outer join left_tbl lt on lt.col_a=rt.col_a, tbl_a t_a left outer join tbl_b t_b on t_a.col_a=t_b.col_a +=================================================== + +13. Spec with join_type == PT_JOIN_NONE and another spec with join_type != PT_JOIN_NONE is between left_tbl and right_tbl + +=================================================== +1 + +Query plan: +nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: t_a node[?] + cost: ? card ? + inner: sscan + class: t_b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: lt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from tbl_a t_a left outer join tbl_b t_b on t_a.col_a=t_b.col_a left outer join tbl_c t_c on t_c.col_a=t_b.col_a left outer join right_tbl rt on t_c.col_a=rt.col_a left outer join left_tbl lt on lt.col_a=rt.col_a +=================================================== + +14. Spec with join_type != PT_JOIN_NONE and another spec with join_type == PT_JOIN_NONE is between left_tbl and right_tbl + +=================================================== +1 + +Query plan: +nl-join (inner join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: sscan + class: t_c node[?] + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: lt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_a node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from tbl_c t_c inner join right_tbl rt left outer join left_tbl lt on lt.col_a=rt.col_a left outer join tbl_a t_a on lt.col_a=t_a.col_a, tbl_b t_b where t_b.col_a=rt.col_a and t_c.col_a=rt.col_a +=================================================== + +15. Spec with join_type != PT_JOIN_NONE and another spec with join_type == PT_JOIN_NONE is between left_tbl and right_tbl + +=================================================== +1 + +Query plan: +nl-join (cross join) + outer: nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: t_c node[?] + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: lt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_a node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_b node[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from tbl_c t_c left outer join right_tbl rt on t_c.col_a=rt.col_a left outer join left_tbl lt on lt.col_a=rt.col_a left outer join tbl_a t_a on lt.col_a=t_a.col_a, tbl_b t_b +=================================================== + +16. Spec with join_type != PT_JOIN_NONE and another spec with join_type == PT_JOIN_NONE is between left_tbl and right_tbl + +=================================================== +1 + +Query plan: +nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: t_c node[?] + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: lt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_a node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from tbl_c t_c left outer join right_tbl rt on t_c.col_a=rt.col_a left outer join left_tbl lt on lt.col_a=rt.col_a left outer join tbl_a t_a on lt.col_a=t_a.col_a left outer join tbl_b t_b on t_b.col_a=rt.col_a +=================================================== + +17. Spec with join_type != PT_JOIN_NONE is between left_tbl and right_tbl + +=================================================== +1 + +Query plan: +nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: t_c node[?] + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: lt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_a node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from tbl_c t_c left outer join right_tbl rt on t_c.col_a=rt.col_a left outer join left_tbl lt on lt.col_a=rt.col_a left outer join tbl_a t_a on lt.col_a=t_a.col_a left outer join tbl_b t_b on t_a.col_a=t_b.col_a +=================================================== + +18. Spec with join_type == PT_JOIN_NONE is on the right side of right_tbl + +=================================================== +1 + +Query plan: +nl-join (inner join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: lt node[?] + cost: ? card ? + inner: temp + order: UNORDERED + subplan: nl-join (left outer join) + edge: term[?] + outer: sscan + class: rt node[?] + cost: ? card ? + inner: sscan + class: t_a node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from tbl_a t_a right outer join right_tbl rt on t_a.col_a=rt.col_a right outer join left_tbl lt on lt.col_a=rt.col_a, tbl_b t_b where t_b.col_a=lt.col_a +=================================================== + +19. Spec with join_type == PT_JOIN_NONE is on the right side of right_tbl + +=================================================== +1 + +Query plan: +nl-join (cross join) + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: lt node[?] + cost: ? card ? + inner: temp + order: UNORDERED + subplan: nl-join (left outer join) + edge: term[?] + outer: sscan + class: rt node[?] + cost: ? card ? + inner: sscan + class: t_a node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_b node[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from tbl_a t_a right outer join right_tbl rt on t_a.col_a=rt.col_a right outer join left_tbl lt on lt.col_a=rt.col_a, tbl_b t_b +=================================================== + +20. Spec with join_type == PT_JOIN_NONE is on the right side of right_tbl + +=================================================== +1 + +Query plan: +nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: lt node[?] + cost: ? card ? + inner: temp + order: UNORDERED + subplan: nl-join (left outer join) + edge: term[?] + outer: sscan + class: rt node[?] + cost: ? card ? + inner: sscan + class: t_a node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from tbl_a t_a right outer join right_tbl rt on t_a.col_a=rt.col_a right outer join left_tbl lt on lt.col_a=rt.col_a left outer join tbl_b t_b on t_b.col_a=lt.col_a +=================================================== + +21. Spec with join_type == PT_JOIN_NONE and another spec with join_type != PT_JOIN_NONE is on the right side of right_tbl + +=================================================== +1 + +Query plan: +nl-join (left outer join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: t_a node[?] + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: lt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from tbl_a t_a left outer join right_tbl rt on t_a.col_a=rt.col_a left outer join left_tbl lt on lt.col_a=rt.col_a, tbl_b t_b left outer join tbl_c t_c on t_b.col_a=t_c.col_a where t_b.col_a=t_a.col_a +=================================================== + +22. Spec with join_type == PT_JOIN_NONE and another spec with join_type != PT_JOIN_NONE is on the right side of right_tbl + +=================================================== +1 + +Query plan: +nl-join (cross join) + outer: nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: t_a node[?] + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: lt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: temp + order: UNORDERED + subplan: nl-join (left outer join) + edge: term[?] + outer: sscan + class: t_b node[?] + cost: ? card ? + inner: sscan + class: t_c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from tbl_a t_a left outer join right_tbl rt on t_a.col_a=rt.col_a left outer join left_tbl lt on lt.col_a=rt.col_a, tbl_b t_b left outer join tbl_c t_c on t_b.col_a=t_c.col_a +=================================================== + +23. Spec with join_type == PT_JOIN_NONE and another spec with join_type != PT_JOIN_NONE is on the right side of right_tbl + +=================================================== +Error:-494 +=================================================== +1 + +Query plan: +nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: t_a node[?] + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: lt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from tbl_a t_a left outer join right_tbl rt on t_a.col_a=rt.col_a left outer join left_tbl lt on lt.col_a=rt.col_a left outer join tbl_b t_b on t_b.col_a=t_a.col_a left outer join tbl_c t_c on t_b.col_a=t_c.col_a +=================================================== +1 + +Query plan: +nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: t_a node[?] + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: lt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from tbl_a t_a left outer join right_tbl rt on t_a.col_a=rt.col_a left outer join left_tbl lt on lt.col_a=rt.col_a left outer join tbl_b t_b on t_b.col_a=rt.col_a left outer join tbl_c t_c on t_b.col_a=t_c.col_a +=================================================== + +24. Spec with join_type != PT_JOIN_NONE and another spec with join_type == PT_JOIN_NONE is on the right side of right_tbl + +=================================================== +1 + +Query plan: +nl-join (inner join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: nl-join (inner join) + edge: term[?] + outer: sscan + class: t_a node[?] + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: lt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from tbl_a t_a inner join right_tbl rt inner join tbl_b t_b left outer join left_tbl lt on lt.col_a=rt.col_a, tbl_c t_c where t_c.col_a=t_b.col_a and t_a.col_a=rt.col_a and rt.col_a=t_b.col_a +=================================================== + +25. Spec with join_type != PT_JOIN_NONE and another spec with join_type == PT_JOIN_NONE is on the right side of right_tbl + +=================================================== +1 + +Query plan: +nl-join (cross join) + outer: nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: t_a node[?] + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: lt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_c node[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from tbl_a t_a left outer join right_tbl rt on t_a.col_a=rt.col_a left outer join tbl_b t_b on rt.col_a=t_b.col_a left outer join left_tbl lt on lt.col_a=rt.col_a, tbl_c t_c +=================================================== + +26. Spec with join_type != PT_JOIN_NONE and another spec with join_type == PT_JOIN_NONE is on the right side of right_tbl + +=================================================== +Error:-494 +=================================================== +1 + +Query plan: +nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: t_b node[?] + cost: ? card ? + inner: temp + order: UNORDERED + subplan: nl-join (left outer join) + edge: term[?] + outer: sscan + class: rt node[?] + cost: ? card ? + inner: sscan + class: t_a node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + cost: ? card ? + cost: ? card ? + inner: sscan + class: lt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_c node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from tbl_a t_a right outer join right_tbl rt on t_a.col_a=rt.col_a right outer join tbl_b t_b on rt.col_a=t_b.col_a left outer join left_tbl lt on lt.col_a=rt.col_a left outer join tbl_c t_c on t_c.col_a=lt.col_a +=================================================== + +27. Spec with join_type != PT_JOIN_NONE is on the right side of right_tbl + +=================================================== +1 + +Query plan: +nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: nl-join (left outer join) + edge: term[?] + outer: sscan + class: t_a node[?] + cost: ? card ? + inner: sscan + class: rt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: t_b node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? + inner: sscan + class: lt node[?] + sargs: term[?] + cost: ? card ? + cost: ? card ? +Query stmt: +select ? from tbl_a t_a left outer join right_tbl rt on t_a.col_a=rt.col_a left outer join tbl_b t_b on rt.col_a=t_b.col_a left outer join left_tbl lt on lt.col_a=rt.col_a +=================================================== +0 diff --git a/sql/_13_issues/_24_2h/cases/cbrd_25484_1.queryPlan b/sql/_13_issues/_24_2h/cases/cbrd_25484_1.queryPlan new file mode 100644 index 0000000000..e69de29bb2 diff --git a/sql/_13_issues/_24_2h/cases/cbrd_25484_1.sql b/sql/_13_issues/_24_2h/cases/cbrd_25484_1.sql new file mode 100644 index 0000000000..6e633c91c0 --- /dev/null +++ b/sql/_13_issues/_24_2h/cases/cbrd_25484_1.sql @@ -0,0 +1,129 @@ + +--This test case verifies the following issue: CBRD-25484. +--Validate when using inner joins and Oracle style outer joins together, errors no longer occur depending on the order of the join conditions. + +/* ---------------------------------------- +* The left spec in the join is referred to as left_tbl, and the right spec as right_tbl. +* In the scenario below, the point at which the join_type of the spec located on the right is checked +* is when converting the Oracle-style outer join between left_tbl and right_tbl to an ANSI join. +* +* 1. The join_type of the spec located on the right, which is being converted to an ANSI join, is PT_JOIN_NONE. +* 2. The join_type of the spec located on the right, which is being converted to an ANSI join, is not PT_JOIN_NONE. +* +* This file covers test cases for item 1. +* ---------------------------------------- */ +drop if exists tbl_a, tbl_b, left_tbl, right_tbl; + +create table tbl_a (col_a int); +create table tbl_b (col_a int); +create table left_tbl (col_a int); +create table right_tbl (col_a int); + +evaluate '1. When there are no table specs other than left_tbl and right_tbl'; +select /*+ recompile */ 1 from left_tbl lt, right_tbl rt where lt.col_a = rt.col_a(+); + +evaluate '2. Spec with join_type == PT_JOIN_NONE is on the left side of left_tbl'; +-- PT_JOIN_NONE means an inner join +select /*+ recompile */ 1 from tbl_a t_a, tbl_b t_b, left_tbl lt, right_tbl rt where lt.col_a = rt.col_a(+) and t_a.col_a = t_b.col_a and t_a.col_a = lt.col_a; + +evaluate '3. Spec with join_type == PT_JOIN_NONE is on the left side of left_tbl'; +-- PT_JOIN_NONE means a cross join +select /*+ recompile */ 1 from tbl_a t_a, tbl_b t_b, left_tbl lt, right_tbl rt where lt.col_a = rt.col_a(+); + +evaluate '4. Spec with join_type == PT_JOIN_NONE is on the left side of left_tbl'; +-- PT_JOIN_NONE represents an unhandled Oracle-style outer join +select /*+ recompile */ 1 from tbl_a t_a, tbl_b t_b, left_tbl lt, right_tbl rt where lt.col_a = rt.col_a(+) and t_a.col_a = t_b.col_a(+) and t_a.col_a = lt.col_a(+); + +evaluate '5. Spec with join_type == PT_JOIN_NONE and another spec with join_type != PT_JOIN_NONE are on the left side of left_tbl'; +-- PT_JOIN_NONE means an inner join +select /*+ recompile */ 1 from tbl_a t_a, tbl_b t_b, left_tbl lt, right_tbl rt where t_a.col_a = t_b.col_a(+) and lt.col_a = rt.col_a(+) and t_a.col_a = lt.col_a; + +evaluate '6. Spec with join_type == PT_JOIN_NONE and another spec with join_type != PT_JOIN_NONE are on the left side of left_tbl'; +-- PT_JOIN_NONE means a cross join +select /*+ recompile */ 1 from tbl_a t_a, tbl_b t_b, left_tbl lt, right_tbl rt where t_a.col_a = t_b.col_a(+) and lt.col_a = rt.col_a(+); + +evaluate '7. Spec with join_type == PT_JOIN_NONE and another spec with join_type != PT_JOIN_NONE are on the left side of left_tbl'; +-- PT_JOIN_NONE represents an unhandled Oracle-style outer join +select /*+ recompile */ 1 from tbl_a t_a, tbl_b t_b, left_tbl lt, right_tbl rt where t_a.col_a = t_b.col_a(+) and lt.col_a = rt.col_a(+) and t_a.col_a = lt.col_a(+); + +evaluate '8. Spec with join_type == PT_JOIN_NONE is between left_tbl and right_tbl'; +-- PT_JOIN_NONE means an inner join +select /*+ recompile */ 1 from left_tbl lt, tbl_a t_a, tbl_b t_b, right_tbl rt where lt.col_a = rt.col_a(+) and t_a.col_a = t_b.col_a and rt.col_a = t_a.col_a; + +evaluate '9. Spec with join_type == PT_JOIN_NONE is between left_tbl and right_tbl'; +-- PT_JOIN_NONE means a cross join +select /*+ recompile */ 1 from left_tbl lt, tbl_a t_a, tbl_b t_b, right_tbl rt where lt.col_a = rt.col_a(+); + +evaluate '10. Spec with join_type == PT_JOIN_NONE is between left_tbl and right_tbl'; +-- PT_JOIN_NONE represents an unhandled Oracle-style outer join +select /*+ recompile */ 1 from left_tbl lt, tbl_a t_a, tbl_b t_b, right_tbl rt where lt.col_a = rt.col_a(+) and t_a.col_a = t_b.col_a(+) and rt.col_a = t_a.col_a(+); + +evaluate '11. Spec with join_type == PT_JOIN_NONE and another spec with join_type != PT_JOIN_NONE is between left_tbl and right_tbl'; +-- PT_JOIN_NONE means an inner join +select /*+ recompile */ 1 from left_tbl lt, tbl_a t_a, tbl_b t_b, right_tbl rt where t_a.col_a = t_b.col_a(+) and lt.col_a = rt.col_a(+) and rt.col_a = t_a.col_a; + +evaluate '12. Spec with join_type == PT_JOIN_NONE and another spec with join_type != PT_JOIN_NONE is between left_tbl and right_tbl'; +-- PT_JOIN_NONE means a cross join +select /*+ recompile */ 1 from left_tbl lt, tbl_a t_a, tbl_b t_b, right_tbl rt where t_a.col_a = t_b.col_a(+) and lt.col_a = rt.col_a(+); + +evaluate '13. Spec with join_type == PT_JOIN_NONE and another spec with join_type != PT_JOIN_NONE is between left_tbl and right_tbl'; +-- PT_JOIN_NONE represents an unhandled Oracle-style outer join +select /*+ recompile */ 1 from left_tbl lt, tbl_a t_a, tbl_b t_b, right_tbl rt where t_a.col_a = t_b.col_a(+) and lt.col_a = rt.col_a(+) and rt.col_a = t_a.col_a(+); + +evaluate '14. Spec with join_type != PT_JOIN_NONE and another spec with join_type == PT_JOIN_NONE is between left_tbl and right_tbl'; +-- PT_JOIN_NONE means an inner join +select /*+ recompile */ 1 from left_tbl lt, tbl_a t_a, tbl_b t_b, right_tbl rt where lt.col_a = t_a.col_a(+) and lt.col_a = rt.col_a(+) and t_a.col_a = t_b.col_a; + +evaluate '15. Spec with join_type != PT_JOIN_NONE and another spec with join_type == PT_JOIN_NONE is between left_tbl and right_tbl'; +-- PT_JOIN_NONE means a cross join +select /*+ recompile */ 1 from left_tbl lt, tbl_a t_a, tbl_b t_b, right_tbl rt where lt.col_a = t_a.col_a(+) and lt.col_a = rt.col_a(+); + +evaluate '16. Spec with join_type != PT_JOIN_NONE and another spec with join_type == PT_JOIN_NONE is between left_tbl and right_tbl'; +-- PT_JOIN_NONE represents an unhandled Oracle-style outer join +select /*+ recompile */ 1 from left_tbl lt, tbl_a t_a, tbl_b t_b, right_tbl rt where lt.col_a = t_a.col_a(+) and lt.col_a = rt.col_a(+) and t_a.col_a = t_b.col_a(+); + +evaluate '17. Spec with join_type != PT_JOIN_NONE is between left_tbl and right_tbl'; +-- No PT_JOIN_NONE spec here +select /*+ recompile */ 1 from left_tbl lt, tbl_a t_a, right_tbl rt where rt.col_a = t_a.col_a(+) and lt.col_a = rt.col_a(+); + +evaluate '18. Spec with join_type == PT_JOIN_NONE is on the right side of right_tbl'; +-- PT_JOIN_NONE means an inner join +select /*+ recompile */ 1 from left_tbl lt, right_tbl rt, tbl_a t_a, tbl_b t_b where lt.col_a = rt.col_a(+) and t_a.col_a = t_b.col_a and t_a.col_a = lt.col_a; + +evaluate '19. Spec with join_type == PT_JOIN_NONE is on the right side of right_tbl'; +-- PT_JOIN_NONE means a cross join +select /*+ recompile */ 1 from left_tbl lt, right_tbl rt, tbl_a t_a, tbl_b t_b where lt.col_a = rt.col_a(+); + +evaluate '20. Spec with join_type == PT_JOIN_NONE is on the right side of right_tbl'; +-- PT_JOIN_NONE represents an unhandled Oracle-style outer join +select /*+ recompile */ 1 from left_tbl lt, right_tbl rt, tbl_a t_a, tbl_b t_b where lt.col_a = rt.col_a(+) and t_a.col_a = t_b.col_a(+) and t_a.col_a(+) = lt.col_a; + +evaluate '21. Spec with join_type == PT_JOIN_NONE and another spec with join_type != PT_JOIN_NONE is on the right side of right_tbl'; +-- PT_JOIN_NONE means an inner join +select /*+ recompile */ 1 from left_tbl lt, right_tbl rt, tbl_a t_a, tbl_b t_b where t_a.col_a = t_b.col_a(+) and lt.col_a = rt.col_a(+) and t_a.col_a = lt.col_a; + +evaluate '22. Spec with join_type == PT_JOIN_NONE and another spec with join_type != PT_JOIN_NONE is on the right side of right_tbl'; +-- PT_JOIN_NONE means a cross join +select /*+ recompile */ 1 from left_tbl lt, right_tbl rt, tbl_a t_a, tbl_b t_b where t_a.col_a = t_b.col_a(+) and lt.col_a = rt.col_a(+); + +evaluate '23. Spec with join_type == PT_JOIN_NONE and another spec with join_type != PT_JOIN_NONE is on the right side of right_tbl'; +-- PT_JOIN_NONE represents an unhandled Oracle-style outer join +select /*+ recompile */ 1 from left_tbl lt, right_tbl rt, tbl_a t_a, tbl_b t_b where t_a.col_a = t_b.col_a(+) and lt.col_a = rt.col_a(+) and t_a.col_a(+) = lt.col_a; + +evaluate '24. Spec with join_type != PT_JOIN_NONE and another spec with join_type == PT_JOIN_NONE is on the right side of right_tbl'; +-- PT_JOIN_NONE means an inner join +select /*+ recompile */ 1 from left_tbl lt, right_tbl rt, tbl_a t_a, tbl_b t_b where rt.col_a = t_a.col_a(+) and lt.col_a = rt.col_a(+) and t_b.col_a = t_a.col_a; + +evaluate '25. Spec with join_type != PT_JOIN_NONE and another spec with join_type == PT_JOIN_NONE is on the right side of right_tbl'; +-- PT_JOIN_NONE means a cross join +select /*+ recompile */ 1 from left_tbl lt, right_tbl rt, tbl_a t_a, tbl_b t_b where rt.col_a = t_a.col_a(+) and lt.col_a = rt.col_a(+); + +evaluate '26. Spec with join_type != PT_JOIN_NONE and another spec with join_type == PT_JOIN_NONE is on the right side of right_tbl'; +-- PT_JOIN_NONE represents an unhandled Oracle-style outer join +select /*+ recompile */ 1 from left_tbl lt, right_tbl rt, tbl_a t_a, tbl_b t_b where rt.col_a = t_a.col_a(+) and lt.col_a = rt.col_a(+) and t_b.col_a(+) = t_a.col_a; + +evaluate '27. Spec with join_type != PT_JOIN_NONE is between left_tbl and right_tbl'; +-- No PT_JOIN_NONE spec here +select /*+ recompile */ 1 from left_tbl lt, right_tbl rt, tbl_a t_a, tbl_b t_b where t_a.col_a = t_b.col_a(+) and rt.col_a = t_a.col_a(+) and lt.col_a = rt.col_a(+); + +drop if exists tbl_a, tbl_b, left_tbl, right_tbl; diff --git a/sql/_13_issues/_24_2h/cases/cbrd_25484_2.queryPlan b/sql/_13_issues/_24_2h/cases/cbrd_25484_2.queryPlan new file mode 100644 index 0000000000..e69de29bb2 diff --git a/sql/_13_issues/_24_2h/cases/cbrd_25484_2.sql b/sql/_13_issues/_24_2h/cases/cbrd_25484_2.sql new file mode 100644 index 0000000000..98d09e1295 --- /dev/null +++ b/sql/_13_issues/_24_2h/cases/cbrd_25484_2.sql @@ -0,0 +1,136 @@ + +--This test case verifies the following issue: CBRD-25484. +--Validate when using inner joins and Oracle style outer joins together, errors no longer occur depending on the order of the join conditions. + +/* ---------------------------------------- +* The left spec in the join is referred to as left_tbl, and the right spec as right_tbl. +* In the scenario below, the point at which the join_type of the spec located on the right is checked +* is when converting the Oracle-style outer join between left_tbl and right_tbl to an ANSI join. +* +* 1. The join_type of the spec located on the right, which is being converted to an ANSI join, is PT_JOIN_NONE. +* 2. The join_type of the spec located on the right, which is being converted to an ANSI join, is not PT_JOIN_NONE. +* +* This file covers test cases for item 2. +* When considering the join_type of the spec located between left_tbl and right_tbl, the first spec joined with right_tbl is not considered. +* ---------------------------------------- */ +drop if exists tbl_a, tbl_b, tbl_c, left_tbl, right_tbl; + +create table tbl_a (col_a int); +create table tbl_b (col_a int); +create table tbl_c (col_a int); +create table left_tbl (col_a int); +create table right_tbl (col_a int); + +evaluate '1. Spec with only left_tbl and right_tbl, and no other table specs with a join relationship'; +-- Only left_tbl and right_tbl with a spec for an outer join +select /*+ recompile */ 1 from left_tbl lt, tbl_a t_a, right_tbl rt where t_a.col_a = rt.col_a(+) and lt.col_a(+) = rt.col_a; + +evaluate '2. Spec with join_type == PT_JOIN_NONE is on the left side of left_tbl'; +-- PT_JOIN_NONE means an inner join +select /*+ recompile */ 1 from tbl_a t_a, left_tbl lt, tbl_b t_b, right_tbl rt where t_b.col_a(+) = rt.col_a and lt.col_a = rt.col_a(+) and t_a.col_a = lt.col_a; + +evaluate '3. Spec with join_type == PT_JOIN_NONE is on the left side of left_tbl'; +-- PT_JOIN_NONE means a cross join +select /*+ recompile */ 1 from tbl_a t_a, left_tbl lt, tbl_b t_b, right_tbl rt where t_b.col_a(+) = rt.col_a and lt.col_a = rt.col_a(+); + +evaluate '4. Spec with join_type == PT_JOIN_NONE is on the left side of left_tbl'; +-- PT_JOIN_NONE represents an unhandled Oracle-style outer join +select /*+ recompile */ 1 from tbl_a t_a, left_tbl lt, tbl_b t_b, right_tbl rt where t_b.col_a(+) = rt.col_a and lt.col_a = rt.col_a(+) and t_a.col_a(+) = lt.col_a; + +evaluate '5. Spec with join_type == PT_JOIN_NONE and another spec with join_type != PT_JOIN_NONE are on the left side of left_tbl'; +-- PT_JOIN_NONE means an inner join +select /*+ recompile */ 1 from tbl_a t_a, tbl_b t_b, left_tbl lt, tbl_c t_c, right_tbl rt where t_c.col_a(+) = rt.col_a and t_a.col_a(+) = t_b.col_a and lt.col_a(+) = rt.col_a and t_a.col_a = rt.col_a; + +evaluate '6. Spec with join_type == PT_JOIN_NONE and another spec with join_type != PT_JOIN_NONE are on the left side of left_tbl'; +-- PT_JOIN_NONE means a cross join +select /*+ recompile */ 1 from tbl_a t_a, tbl_b t_b, left_tbl lt, tbl_c t_c, right_tbl rt where t_c.col_a(+) = rt.col_a and t_a.col_a = t_b.col_a(+) and lt.col_a(+) = rt.col_a; + +evaluate '7. Spec with join_type == PT_JOIN_NONE and another spec with join_type != PT_JOIN_NONE are on the left side of left_tbl'; +-- PT_JOIN_NONE represents an unhandled Oracle-style outer join +select /*+ recompile */ 1 from tbl_a t_a, tbl_b t_b, left_tbl lt, tbl_c t_c, right_tbl rt where t_c.col_a(+) = rt.col_a and t_a.col_a = t_b.col_a(+) and lt.col_a(+) = rt.col_a and t_a.col_a = lt.col_a(+); + +evaluate '8. Spec with join_type == PT_JOIN_NONE is between left_tbl and right_tbl'; +-- PT_JOIN_NONE means an inner join +select /*+ recompile */ 1 from left_tbl lt, tbl_a t_a, tbl_b t_b, right_tbl rt where t_b.col_a = rt.col_a(+) and lt.col_a(+) = rt.col_a and t_a.col_a = rt.col_a; + +evaluate '9. Spec with join_type == PT_JOIN_NONE is between left_tbl and right_tbl'; +-- PT_JOIN_NONE means a cross join +select /*+ recompile */ 1 from left_tbl lt, tbl_a t_a, tbl_b t_b, right_tbl rt where t_b.col_a = rt.col_a(+) and lt.col_a(+) = rt.col_a; + +evaluate '10. Spec with join_type == PT_JOIN_NONE is between left_tbl and right_tbl'; +-- PT_JOIN_NONE represents an unhandled Oracle-style outer join +select /*+ recompile */ 1 from left_tbl lt, tbl_a t_a, tbl_b t_b, right_tbl rt where t_b.col_a = rt.col_a(+) and lt.col_a(+) = rt.col_a and t_a.col_a(+) = t_b.col_a; + +evaluate '11. Spec with join_type == PT_JOIN_NONE and another spec with join_type != PT_JOIN_NONE is between left_tbl and right_tbl'; +-- PT_JOIN_NONE means an inner join +select /*+ recompile */ 1 from left_tbl lt, tbl_a t_a, tbl_b t_b, tbl_c t_c, right_tbl rt where t_a.col_a = t_b.col_a(+) and t_c.col_a = rt.col_a(+) and lt.col_a(+) = rt.col_a and t_a.col_a = t_c.col_a; + +evaluate '12. Spec with join_type == PT_JOIN_NONE and another spec with join_type != PT_JOIN_NONE is between left_tbl and right_tbl'; +-- PT_JOIN_NONE means a cross join +select /*+ recompile */ 1 from left_tbl lt, tbl_a t_a, tbl_b t_b, tbl_c t_c, right_tbl rt where t_a.col_a = t_b.col_a(+) and t_c.col_a = rt.col_a(+) and lt.col_a(+) = rt.col_a; + +evaluate '13. Spec with join_type == PT_JOIN_NONE and another spec with join_type != PT_JOIN_NONE is between left_tbl and right_tbl'; +-- PT_JOIN_NONE represents an unhandled Oracle-style outer join +select /*+ recompile */ 1 from left_tbl lt, tbl_a t_a, tbl_b t_b, tbl_c t_c, right_tbl rt where t_a.col_a = t_b.col_a(+) and t_c.col_a = rt.col_a(+) and lt.col_a(+) = rt.col_a and t_c.col_a(+) = t_b.col_a; + +evaluate '14. Spec with join_type != PT_JOIN_NONE and another spec with join_type == PT_JOIN_NONE is between left_tbl and right_tbl'; +-- PT_JOIN_NONE means an inner join +select /*+ recompile */ 1 from left_tbl lt, tbl_a t_a, tbl_b t_b, tbl_c t_c, right_tbl rt where lt.col_a = t_a.col_a(+) and t_c.col_a = rt.col_a(+) and lt.col_a(+) = rt.col_a and t_b.col_a = rt.col_a; + +evaluate '15. Spec with join_type != PT_JOIN_NONE and another spec with join_type == PT_JOIN_NONE is between left_tbl and right_tbl'; +-- PT_JOIN_NONE means a cross join +select /*+ recompile */ 1 from left_tbl lt, tbl_a t_a, tbl_b t_b, tbl_c t_c, right_tbl rt where lt.col_a = t_a.col_a(+) and t_c.col_a = rt.col_a(+) and lt.col_a(+) = rt.col_a; + +evaluate '16. Spec with join_type != PT_JOIN_NONE and another spec with join_type == PT_JOIN_NONE is between left_tbl and right_tbl'; +-- PT_JOIN_NONE represents an unhandled Oracle-style outer join +select /*+ recompile */ 1 from left_tbl lt, tbl_a t_a, tbl_b t_b, tbl_c t_c, right_tbl rt where lt.col_a = t_a.col_a(+) and t_c.col_a = rt.col_a(+) and lt.col_a(+) = rt.col_a and t_b.col_a(+) = rt.col_a; + +evaluate '17. Spec with join_type != PT_JOIN_NONE is between left_tbl and right_tbl'; +-- No PT_JOIN_NONE spec here +select /*+ recompile */ 1 from left_tbl lt, tbl_a t_a, tbl_b t_b, tbl_c t_c, right_tbl rt where t_a.col_a = t_b.col_a(+) and lt.col_a = t_a.col_a(+) and t_c.col_a = rt.col_a(+) and lt.col_a(+) = rt.col_a; + +evaluate '18. Spec with join_type == PT_JOIN_NONE is on the right side of right_tbl'; +-- PT_JOIN_NONE means an inner join +select /*+ recompile */ 1 from left_tbl lt, tbl_a t_a, right_tbl rt, tbl_b t_b where t_a.col_a(+) = rt.col_a and lt.col_a = rt.col_a(+) and t_b.col_a = lt.col_a; + +evaluate '19. Spec with join_type == PT_JOIN_NONE is on the right side of right_tbl'; +-- PT_JOIN_NONE means a cross join +select /*+ recompile */ 1 from left_tbl lt, tbl_a t_a, right_tbl rt, tbl_b t_b where t_a.col_a(+) = rt.col_a and lt.col_a = rt.col_a(+); + +evaluate '20. Spec with join_type == PT_JOIN_NONE is on the right side of right_tbl'; +-- PT_JOIN_NONE represents an unhandled Oracle-style outer join +select /*+ recompile */ 1 from left_tbl lt, tbl_a t_a, right_tbl rt, tbl_b t_b where t_a.col_a(+) = rt.col_a and lt.col_a = rt.col_a(+) and t_b.col_a(+) = lt.col_a; + +evaluate '21. Spec with join_type == PT_JOIN_NONE and another spec with join_type != PT_JOIN_NONE is on the right side of right_tbl'; +-- PT_JOIN_NONE means an inner join +select /*+ recompile */ 1 from left_tbl lt, tbl_a t_a, right_tbl rt, tbl_b t_b, tbl_c t_c where t_b.col_a = t_c.col_a(+) and t_a.col_a = rt.col_a(+) and lt.col_a(+) = rt.col_a and t_b.col_a = t_a.col_a; + +evaluate '22. Spec with join_type == PT_JOIN_NONE and another spec with join_type != PT_JOIN_NONE is on the right side of right_tbl'; +-- PT_JOIN_NONE means a cross join +select /*+ recompile */ 1 from left_tbl lt, tbl_a t_a, right_tbl rt, tbl_b t_b, tbl_c t_c where t_b.col_a = t_c.col_a(+) and t_a.col_a = rt.col_a(+) and lt.col_a(+) = rt.col_a; + +evaluate '23. Spec with join_type == PT_JOIN_NONE and another spec with join_type != PT_JOIN_NONE is on the right side of right_tbl'; +-- PT_JOIN_NONE represents an unhandled Oracle-style outer join +select /*+ recompile */ 1 from left_tbl lt, tbl_a t_a, right_tbl rt, tbl_b t_b, tbl_c t_c where t_b.col_a(+) = t_c.col_a and t_a.col_a(+) = rt.col_a and lt.col_a = rt.col_a(+) and t_b.col_a(+) = lt.col_a; +select /*+ recompile */ 1 from left_tbl lt, tbl_a t_a, right_tbl rt, tbl_b t_b, tbl_c t_c where t_b.col_a = t_c.col_a(+) and t_a.col_a = rt.col_a(+) and lt.col_a(+) = rt.col_a and t_b.col_a(+) = t_a.col_a; +select /*+ recompile */ 1 from left_tbl lt, tbl_a t_a, right_tbl rt, tbl_b t_b, tbl_c t_c where t_b.col_a = t_c.col_a(+) and t_a.col_a = rt.col_a(+) and lt.col_a(+) = rt.col_a and t_b.col_a(+) = rt.col_a; + + +evaluate '24. Spec with join_type != PT_JOIN_NONE and another spec with join_type == PT_JOIN_NONE is on the right side of right_tbl'; +-- PT_JOIN_NONE means an inner join +select /*+ recompile */ 1 from left_tbl lt, tbl_a t_a, right_tbl rt, tbl_b t_b, tbl_c t_c where rt.col_a = t_b.col_a(+) and t_a.col_a = rt.col_a(+) and lt.col_a(+) = rt.col_a and t_c.col_a = t_b.col_a; + +evaluate '25. Spec with join_type != PT_JOIN_NONE and another spec with join_type == PT_JOIN_NONE is on the right side of right_tbl'; +-- PT_JOIN_NONE means a cross join +select /*+ recompile */ 1 from left_tbl lt, tbl_a t_a, right_tbl rt, tbl_b t_b, tbl_c t_c where rt.col_a = t_b.col_a(+) and t_a.col_a = rt.col_a(+) and lt.col_a(+) = rt.col_a; + +evaluate '26. Spec with join_type != PT_JOIN_NONE and another spec with join_type == PT_JOIN_NONE is on the right side of right_tbl'; +-- PT_JOIN_NONE represents an unhandled Oracle-style outer join +select /*+ recompile */ 1 from left_tbl lt, tbl_a t_a, right_tbl rt, tbl_b t_b, tbl_c t_c where rt.col_a = t_b.col_a(+) and t_a.col_a(+) = rt.col_a and lt.col_a(+) = rt.col_a and t_c.col_a = lt.col_a(+); +select /*+ recompile */ 1 from left_tbl lt, tbl_a t_a, right_tbl rt, tbl_b t_b, tbl_c t_c where rt.col_a(+) = t_b.col_a and t_a.col_a(+) = rt.col_a and lt.col_a(+) = rt.col_a and t_c.col_a(+) = lt.col_a; + +evaluate '27. Spec with join_type != PT_JOIN_NONE is on the right side of right_tbl'; +-- No PT_JOIN_NONE spec here +select /*+ recompile */ 1 from left_tbl lt, tbl_a t_a, right_tbl rt, tbl_b t_b where rt.col_a = t_b.col_a(+) and t_a.col_a = rt.col_a(+) and lt.col_a(+) = rt.col_a; + +drop if exists tbl_a, tbl_b, tbl_c, left_tbl, right_tbl;