subsonic / SubSonic-2.0

SubSonic 2.0 Home
http://subsonic.github.io/
Other
80 stars 45 forks source link

Bad Code in Constraint #27

Open rsrobbins opened 10 years ago

rsrobbins commented 10 years ago

In the Constraint.cs class, the method for the SQL IN statement using a nested Select statement seems to be enforcing a constraint incorrectly. The code is adding selectQuery.SelectColumnList.Length to selectQuery.Aggregates.Count and generating an error if the sum is not 1. Well, if you are using an aggregate function the aggregate count will be 1 and the column list length will be 1 giving you a sum of 2 so it gives you an error even though the SQL would be valid.