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

Root aliases in set subqueries are not isolated from one another #281

Closed
Mobe91 opened this issue Nov 15, 2016 · 0 comments
Closed

Root aliases in set subqueries are not isolated from one another #281

Mobe91 opened this issue Nov 15, 2016 · 0 comments

Comments

@Mobe91
Copy link
Contributor

Mobe91 commented Nov 15, 2016

Consider the following snippet:

.where("cte.id").notIn()
		.from(UserDataPermissionCte.class, "cte1")
		.from(UserPermission.class, "up")
		.select("cte1.id")
		.where("cte1.field").eqExpression("up1.field")
		.where("cte1.entity").eqExpression("up1.entity")
		.where("cte1.actionName").eqExpression("up1.actionName")
		.where("cte1.subjectId").eqExpression("up1.subject.id")
	.unionAll()
		.from(UserDataPermissionCte.class, "cte2")
		.from(UserPermission.class, "up")
		.select("cte2.id")
		.where("up2.field").eqExpression(":emptyField")
		.where("cte2.entity").eqExpression("up2.entity")
		.where("cte2.actionName").eqExpression("up2.actionName")
		.where("cte2.subjectId").eqExpression("up2.subject.id")
	.endSet()
.end()

This results in an exception because up is reported as duplicate alias. This is wrong since the two queries should be isolated.

@beikov beikov added this to the 1.2.0 milestone Nov 16, 2016
Mobe91 added a commit that referenced this issue Dec 18, 2016
@beikov beikov self-assigned this Dec 22, 2016
@beikov beikov closed this as completed in 5977d67 Dec 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants