forked from agentgt/jirm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Partial parser validate comparison incorrect. Fixed agentgt#26
- Loading branch information
Showing
3 changed files
with
67 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
jirm-core/src/test/resources/co/jirm/core/sql/issue26-partial-test-validate.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
SELECT | ||
-- {#stuff} | ||
c.id, c.name, c.tags, c.category, c.description, | ||
c.division, c.experience_level as "experienceLevel", | ||
c.locations, c.type, c.parent_id as "parentId", | ||
g.latitude as "latitude", g.longitude as "longitude" | ||
-- {/stuff} | ||
FROM campaign c | ||
LEFT OUTER JOIN | ||
(SELECT DISTINCT cg.campaign, geo.latitude, geo.longitude from campaign_geo cg | ||
INNER JOIN geo geo on geo.id = cg.geo | ||
WHERE geo.latitude IS NOT NULL AND geo.longitude IS NOT NULL AND cg.createts < now() -- {} | ||
) g on g.campaign = c.id | ||
WHERE | ||
-- {> #blah} | ||
c.type = 'JOBPAGE' AND c.createts < now() -- {} | ||
-- {<} | ||
ORDER BY c.createts ASC, c.id, g.latitude, g.longitude | ||
LIMIT 100 -- {} | ||
OFFSET 1 -- {} | ||
|
||
SELECT | ||
-- {> #stuff} | ||
c.id, c.name, c.tags, c.category, c.description, | ||
c.division, c.experience_level as "experienceLevel", | ||
c.locations, c.type, c.parent_id as "parentId", | ||
g.latitude as "latitude", g.longitude as "longitude" | ||
-- {<} | ||
FROM campaign c | ||
LEFT OUTER JOIN | ||
(SELECT DISTINCT cg.campaign, geo.latitude, geo.longitude from campaign_geo cg | ||
INNER JOIN geo geo on geo.id = cg.geo | ||
WHERE geo.latitude IS NOT NULL AND geo.longitude IS NOT NULL AND cg.createts < now() -- {} | ||
) g on g.campaign = c.id | ||
WHERE | ||
-- {#blah} | ||
c.type = 'JOBPAGE' AND c.createts < now() -- {} | ||
-- {/blah} | ||
ORDER BY c.createts ASC, c.id, g.latitude, g.longitude | ||
LIMIT 100 -- {} | ||
OFFSET 1 -- {} | ||
|
||
-- {#other} | ||
SELECT | ||
-- {> #stuff same } | ||
c.id, c.name, c.tags, c.category, c.description, | ||
c.division, c.experience_level as "experienceLevel", | ||
c.locations, c.type, c.parent_id as "parentId", | ||
g.latitude as "latitude", g.longitude as "longitude" | ||
-- {<} | ||
FROM campaign c | ||
LEFT OUTER JOIN | ||
(SELECT DISTINCT cg.campaign, geo.latitude, geo.longitude from campaign_geo cg | ||
INNER JOIN geo geo on geo.id = cg.geo | ||
WHERE geo.latitude IS NOT NULL AND geo.longitude IS NOT NULL AND cg.createts < now() -- {} | ||
) g on g.campaign = c.id | ||
ORDER BY c.createts ASC, c.id, g.latitude, g.longitude | ||
LIMIT 100 -- {} | ||
OFFSET 1 -- {} | ||
-- {/other} |