1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Fix a problem with handling single row partitions in the percent_rank() window

function.

FossilOrigin-Name: b84fbf16eac718c151731e2b2dcc73f2f2a144e3670f8566a30793f1e4e6a3ec
This commit is contained in:
dan
2018-06-21 19:20:39 +00:00
parent 9c27758eb4
commit b7306f6f6e
5 changed files with 52 additions and 10 deletions

View File

@@ -279,7 +279,7 @@ static void percent_rankValueFunc(sqlite3_context *pCtx){
double r = (double)(p->nValue-1) / (double)(p->nTotal-1);
sqlite3_result_double(pCtx, r);
}else{
sqlite3_result_double(pCtx, 100.0);
sqlite3_result_double(pCtx, 0.0);
}
p->nValue = 0;
}