OrmLite && vs & output difference

Sample can be found here https://gistlyn.com/?gist=37c7173973ae30dc75156dcf62d1c124&collection=cd381848f252be2a84f8c239ed0d241b

These two expressions we would have assumed would have identical SQL output, but we have noticed they do not.
var x1 = db.Select<Track>(t=>t.Name =="Everythings Ruined" && t.Album == "Angel Dust");
vs.
var x2 = db.Select<Track>(t=>t.Name =="Everythings Ruined" & t.Album == "Angel Dust");

results in two different where clauses:
WHERE (("Name" = @0) AND ("Album" = @1))
vs.
WHERE (("Name" = @0) & ("Album" = @1))

Is there a compelling reason why it translates this way?

Bitwise & and Logical && are completely different operators.

1 Like