-
-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non-ambiguous ORDER BY col should not error #2091
Conversation
sql/planbuilder/parse_test.go
Outdated
@@ -41,10 +41,23 @@ type planTest struct { | |||
|
|||
func TestPlanBuilder(t *testing.T) { | |||
var verbose, rewrite bool | |||
//verbose = true | |||
//rewrite = true | |||
verbose = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert these.
@@ -45,6 +45,19 @@ func TestPlanBuilder(t *testing.T) { | |||
//rewrite = true | |||
|
|||
var tests = []planTest{ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This apparently works in MySQL
select t1.x as x, t1.x as x from xy t1, xy t2 order by x;
but this fails in MySQL
select t1.x as x, t2.x as x from xy t1, xy t2 order by x;
I think they both fail in dolt even with your fix.
Also should make sure
select x, y as x from xy order by x;
still fails
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch, take another peek see if the solution's OK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I previously outlined the exact resolution rules for ORDER BY
in MySQL here: dolthub/dolt#6676
e4cddae
to
86deb33
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.