I don't really agree with leaving out the type-check. With custom variables types (eg. JPAVariable) the long-column (and other columns) can also be used. If the long-column is used by a custom variable, it's possible that the values stored in there don't correspond to an actual "long" or "int" value, rather are an ID of a referenced entity. So leaving out the type-comparison could introduce issues with these kind of variables.
Also, this whould also falsely report results, in case you query for "0" and "1" values, in relation to booleans, which also use a numeric representation in the database.