Skip to content

Commit bf632c7

Browse files
authored
Merge pull request ldbc#359 from ldbc/bug/mssql-rounding-error
Bug/mssql rounding error
2 parents 734aa0c + 7637bd0 commit bf632c7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

mssql/ddl/func-bfs-weight.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ BEGIN
4848
UNION ALL
4949

5050
SELECT n.personId, d.OrderDiscovered,
51-
CAST(cte.Path + ';' + CAST(n.personId as varchar(MAX)) as varchar(MAX)), cte.score + CAST(ROUND(40 - SQRT(d.weight)) AS bigint)
51+
CAST(cte.Path + ';' + CAST(n.personId as varchar(MAX)) as varchar(MAX)), cte.score + CAST(ROUND(40 - SQRT(d.weight),0) AS bigint)
5252
FROM #Discovered d JOIN BacktraceCTE cte ON d.Predecessor = cte.Id
5353
JOIN dbo.Person n ON d.Id = n.personId
5454
)

mssql/ddl/func-calculate-weights.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ BEGIN
1818
GROUP BY mid1, mid2
1919
) tmp
2020
RETURN CASE
21-
WHEN (ROUND(40 - SQRT(@score))) > 1
21+
WHEN (ROUND(40 - SQRT(@score), 0)) > 1
2222
THEN @score
2323
ELSE 0
2424
END

0 commit comments

Comments
 (0)