Skip to content

Commit

Permalink
Merge pull request #55 from aquality-automation/develop
Browse files Browse the repository at this point in the history
Hot fix SELECT_LATEST_RESULTS_BY_MILESTONE procedure
  • Loading branch information
VladislavKostyukevich authored Mar 2, 2020
2 parents 98f29ac + 4983d6e commit 08b86ae
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/main/resources/db_changelog/db.changelog-0.3.7.xml
Original file line number Diff line number Diff line change
Expand Up @@ -661,4 +661,38 @@
</rollback>
</changeSet>

<changeSet id="Update SELECT_LATEST_RESULTS_BY_MILESTONE with Select columns" author="v.kostyukevich">
<sql endDelimiter="#">

DROP PROCEDURE IF EXISTS `SELECT_LATEST_RESULTS_BY_MILESTONE`;

#

CREATE PROCEDURE `SELECT_LATEST_RESULTS_BY_MILESTONE`(
IN request_milestone_id VARCHAR(11)
)
BEGIN
select final.*
from test_results AS final
inner join (

Select t_r.test_id, MAX(t_r.finish_date) as finish_date from test_results AS t_r
right join (select test_runs.* from test_runs

right join (select * from milestone_suites where milestone_id = request_milestone_id)
as links ON test_runs.test_suite_id = links.suite_id AND test_runs.milestone_id = request_milestone_id where test_runs.debug = 0)

as runs ON t_r.test_run_id = runs.id
group BY t_r.test_id, runs.test_suite_id

) AS tests ON final.test_id = tests.test_id AND final.finish_date = tests.finish_date;
END
</sql>
<rollback>
DROP FUNCTION IF EXISTS `SELECT_LATEST_RESULTS_BY_MILESTONE`;
</rollback>
</changeSet>



</databaseChangeLog>

0 comments on commit 08b86ae

Please sign in to comment.