The Exist function does not work as expected if it has a Joins condition. #1522

Closed
opened 2020-02-19 07:39:02 +00:00 by kusana · 4 comments
Contributor

The Exist function does not work as expected if it has a Joins condition.

ex.

session.Table("number").
	Select("player.id").
	Join("INNER", "order_list", "order_list.id = number.lid").
	Join("LEFT", "player", "player.id = order_list.eid")
has, err = session.Exist()

actual query

SELECT * FROM `number` LIMIT 1

expected

SELECT * FROM `number` 
INNER JOIN order_list ON order_list.id = number.lid 
LEFT JOIN player ON player.id = order_list.eid 
LIMIT 1
The Exist function does not work as expected if it has a Joins condition. ex. ``` session.Table("number"). Select("player.id"). Join("INNER", "order_list", "order_list.id = number.lid"). Join("LEFT", "player", "player.id = order_list.eid") has, err = session.Exist() ``` actual query ``` SELECT * FROM `number` LIMIT 1 ``` expected ``` SELECT * FROM `number` INNER JOIN order_list ON order_list.id = number.lid LEFT JOIN player ON player.id = order_list.eid LIMIT 1 ```
Author
Contributor

PR:#1520

why build was killed

PR:https://gitea.com/xorm/xorm/pulls/1520 why build was killed
Owner

@kusana CI server has some problems.

@kusana CI server has some problems.
Author
Contributor

@lunny
OK.
Please fix it after a while.

@lunny OK. Please fix it after a while.
Author
Contributor

Thanks, master merge.

#1520

Thanks, master merge. https://gitea.com/xorm/xorm/pulls/1520
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: xorm/xorm#1522
No description provided.