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

fix: treat single subselect properly #357

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nic11
Copy link
Contributor

@nic11 nic11 commented Sep 22, 2022

Fixes #352

@@ -565,16 +565,16 @@ func (esgs *expressionSQLGeneratorSuite) TestGenerate_BooleanExpression() {
int64(1), int64(2), int64(3),
}},

expressionTestCase{val: ident.In(ae), sql: `("a" IN ((SELECT "id" FROM "test2")))`},
expressionTestCase{val: ident.In(ae), sql: `("a" IN ((SELECT "id" FROM "test2")))`, isPrepared: true},
expressionTestCase{val: ident.In(ae), sql: `("a" IN (SELECT "id" FROM "test2"))`},
Copy link
Contributor Author

@nic11 nic11 Sep 22, 2022

Choose a reason for hiding this comment

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

There is a expressionTestCase{val: ident.Eq(ae), sql: `("a" IN (SELECT "id" FROM "test2"))`}, above, so maybe this was intended for some reason(??)

But looks strange anyway, I don't think that this should be a desired behaviour

@gwd
Copy link

gwd commented May 14, 2023

Any chance we can get this merged? I just spent several hours trying to figure out why my query was only getting a single result, only to find the extra paren made the difference.

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

Successfully merging this pull request may close these issues.

How to generate nested select statements
2 participants