|
8 | 8 | Three tables are used, where 1 table (RC) holds references to the two other tables (R and C).
|
9 | 9 | The two tables R and C contain both 1 value that isn't inside RC.
|
10 | 10 | NOTES:
|
11 |
| -[27.12.2020] |
12 |
| - added 'rc.categoryid' to 'order by' list in order to have always stable sort result. |
13 |
| - Mismatch with expected result due to different position of records with the same 'rc.relationid' |
14 |
| - occured on 4.0.0.2298. CHecked on 4.0.0.2303. |
| 11 | + [27.12.2020] |
| 12 | + added 'rc.categoryid' to 'order by' list in order to have always stable sort result. |
| 13 | + Mismatch with expected result due to different position of records with the same 'rc.relationid' |
| 14 | + occured on 4.0.0.2298. CHecked on 4.0.0.2303. |
| 15 | + [07.03.2023] pzotov |
| 16 | + Replaced WHERE-expr: added coalesce() after discussion with dimitr, letter 07-mar-2023 16:29. |
| 17 | + Plan changed for datasource 'R'. |
| 18 | + Checked on 3.0.11.33665, 4.0.3.2904, 5.0.0.970 |
15 | 19 | FBTEST: functional.arno.optimizer.opt_full_join_02
|
16 | 20 | """
|
17 | 21 |
|
|
67 | 71 |
|
68 | 72 | test_script = """
|
69 | 73 | set plan on;
|
| 74 | + --set explain on; |
70 | 75 | --set list on;
|
71 | 76 |
|
72 | 77 | --full join should return ...
|
|
80 | 85 | full join relationcategories rc on (rc.relationid = r.relationid)
|
81 | 86 | full join categories c on (c.categoryid = rc.categoryid)
|
82 | 87 | where
|
83 |
| - r.relationid >= 2 |
| 88 | + --r.relationid >= 2 |
| 89 | + coalesce(r.relationid,0) >= 2 |
84 | 90 | order by
|
85 | 91 | rc.relationid desc
|
86 | 92 | ,rc.categoryid
|
|
90 | 96 | act = isql_act('db', test_script, substitutions=[('=', ''), ('[ \t]+', ' ')])
|
91 | 97 |
|
92 | 98 | expected_stdout = """
|
93 |
| - PLAN SORT (JOIN (JOIN (C NATURAL, JOIN (JOIN (RC NATURAL, R INDEX (PK_RELATIONS)), JOIN (R INDEX (PK_RELATIONS), RC INDEX (FK_RC_RELATIONS)))), JOIN (JOIN (JOIN (RC NATURAL, R INDEX (PK_RELATIONS)), JOIN (R INDEX (PK_RELATIONS), RC INDEX (FK_RC_RELATIONS))), C NATURAL))) |
94 |
| -
|
| 99 | + PLAN SORT (JOIN (JOIN (C NATURAL, JOIN (JOIN (RC NATURAL, R INDEX (PK_RELATIONS)), JOIN (R NATURAL, RC INDEX (FK_RC_RELATIONS)))), JOIN (JOIN (JOIN (RC NATURAL, R INDEX (PK_RELATIONS)), JOIN (R NATURAL, RC INDEX (FK_RC_RELATIONS))), C NATURAL))) |
95 | 100 | RELATIONNAME RELATIONID CATEGORYID DESCRIPTION
|
96 | 101 | =================================== ============ ============ ============
|
97 | 102 | racing turtle 3 1 relation
|
|
0 commit comments