Skip to content
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

feat: wrap subQuery with parenthesis when it appears as table name #3496

Merged
merged 2 commits into from Oct 28, 2019

Conversation

edvardchen
Copy link
Contributor

Fixes #3485

@kibertoad
Copy link
Collaborator

Could you please also add integration test that would actually execute the generated sql?

@@ -1,6 +1,7 @@
/*global expect, d*/
'use strict';

const mysqlErrors = require('mysql/lib/protocol/constants/errors');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why depend on non-public part of external dependency and not just hardcode the constant internally?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Emm, OK. I will change it

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My concern is that if there is a major change in the driver and both the constant is no longer there and field is no longer set, comparison is still going to be "undefined === undefined" and will pass. Thanks for changing it!

@kibertoad
Copy link
Collaborator

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

please hint about missing "as()" when from(subquery) is missing it
2 participants