fix: inaccurate result count when an inner embed is selected after a normal embed in the query string

This commit is contained in:
Laurence Isla
2022-07-12 22:29:42 -05:00
committed by GitHub
parent 9252ec2509
commit bdf1cbe111
6 changed files with 30 additions and 3 deletions
+1 -1
View File
@@ -248,7 +248,7 @@ readRequestToCountQuery (Node (Select{from=mainQi, fromAlias=tblAlias, implicitJ
existsSubquery readReq@(Node (_, (_, _, _, _, joinType, _)) _) rest =
if joinType == Just JTInner
then ("EXISTS (" <> readRequestToCountQuery readReq <> " )"):rest
else mempty
else rest
limitedQuery :: SQL.Snippet -> Maybe Integer -> SQL.Snippet
limitedQuery query maxRows = query <> SQL.sql (maybe mempty (\x -> " LIMIT " <> BS.pack (show x)) maxRows)