Open jberryman opened 7 years ago
subselects don't seem to have this issue, maybe there's a solution there
I am not totally sure we should be fixing a mysql "feature", but, on the other hand, there is already special action for this case in Param.hs, which could be seen as incorrect.
If you feel like trying a solution, I'd be happy to look at a PR! Unfortunately, I don't think it can be local to the instance for In
in Param.hs, since an empty sub-select still needs the correct type.
I think if it can't be worked around properly, the next best thing would be to make In
take/be a non-empty list type (maybe eventually https://hackage.haskell.org/package/base-4.9.1.0/docs/Data-List-NonEmpty.html), or to simply throw an exception on an empty list. I think the current (null)
thing is a misfeature
This just manifested as a bug. It wasn't difficult to track down, but would have been easy to miss (and may exist elsewhere in my code). https://stackoverflow.com/a/37419910/176841
Observe:
I'm not sure there's anything you can substitute for
?
that would fix this. I guess you could rewriteIN ?
andNOT IN ?
to simplyfalse
ortrue
respectively. Or maybe this has been solved in other libraries.