Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
1211ded0
Unverified
Commit
1211ded0
authored
3 years ago
by
Anton Kulyk
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Repro for #15342: The order of join-type causes query fail (#17201)
parent
996835ca
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontend/test/metabase-db/mysql/reproductions/15342.cy.spec.js
+82
-0
82 additions, 0 deletions
...end/test/metabase-db/mysql/reproductions/15342.cy.spec.js
with
82 additions
and
0 deletions
frontend/test/metabase-db/mysql/reproductions/15342.cy.spec.js
0 → 100644
+
82
−
0
View file @
1211ded0
import
{
restore
,
popover
,
addMySQLDatabase
}
from
"
__support__/e2e/cypress
"
;
const
MYSQL_DB_NAME
=
"
QA MySQL8
"
;
describe
.
skip
(
"
15342
"
,
()
=>
{
beforeEach
(()
=>
{
restore
();
cy
.
signInAsAdmin
();
cy
.
viewport
(
4000
,
1200
);
// huge width required so three joined tables can fit
addMySQLDatabase
(
MYSQL_DB_NAME
);
});
it
(
"
should correctly order joins for MySQL queries
"
,
()
=>
{
cy
.
intercept
(
"
POST
"
,
"
/api/dataset
"
).
as
(
"
query
"
);
cy
.
visit
(
"
/question/new
"
);
cy
.
findByText
(
"
Custom question
"
).
click
();
cy
.
findByText
(
MYSQL_DB_NAME
).
click
();
cy
.
findByText
(
"
People
"
).
click
();
addJoin
({
leftColumn
:
"
ID
"
,
rightTable
:
"
Orders
"
,
rightColumn
:
"
Product ID
"
,
});
addJoin
({
leftTable
:
"
Orders
"
,
leftColumn
:
"
Product ID
"
,
rightTable
:
"
Products
"
,
rightColumn
:
"
ID
"
,
joinType
:
"
inner
"
,
});
cy
.
button
(
"
Visualize
"
).
click
();
cy
.
wait
(
"
@query
"
);
cy
.
get
(
"
.Visualization
"
).
within
(()
=>
{
cy
.
findByText
(
"
Email
"
);
// from People table
cy
.
findByText
(
"
Orders → ID
"
);
// joined Orders table columns
cy
.
findByText
(
"
Products → ID
"
);
// joined Products table columns
});
});
});
function
selectFromDropdown
(
itemName
)
{
return
popover
().
findByText
(
itemName
);
}
const
JOIN_LABEL
=
{
left
:
"
Left outer join
"
,
right
:
"
Right outer join
"
,
inner
:
"
Inner join
"
,
};
function
addJoin
({
leftTable
,
leftColumn
,
rightTable
,
rightColumn
,
joinType
=
"
left
"
,
}
=
{})
{
cy
.
icon
(
"
join_left_outer
"
)
.
last
()
.
click
();
selectFromDropdown
(
rightTable
).
click
();
if
(
leftTable
)
{
selectFromDropdown
(
leftTable
).
click
();
}
selectFromDropdown
(
leftColumn
).
click
();
selectFromDropdown
(
rightColumn
).
click
();
cy
.
findAllByText
(
"
Join data
"
)
.
last
()
.
next
()
.
within
(()
=>
{
cy
.
icon
(
"
join_left_outer
"
).
click
();
});
selectFromDropdown
(
JOIN_LABEL
[
joinType
]).
click
();
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment