MSSQL support (#3382)

* MSSQL support

* changes per reviewer's comments; doc

* clean up

* CONTRIBUTORS.md

* minor change in comment

* another minor change in comment

* minor formatting

* Comments formatting per recommend style; contributors in alphabet order

* more comment formatting per coding style

* Change MSSQL to SQLServer in codes and comments

* Change MSSQL to SQLServer in doc

* Use generateSequence to build repeats of ?,?,...?
This commit is contained in:
cxyzhang0
2018-07-20 08:25:15 -07:00
committed by Joel Dudley
parent e5d82cc9b4
commit d2446be69e
5 changed files with 154 additions and 2 deletions

View File

@ -471,7 +471,11 @@ class NodeVaultService(
if (paging.pageSize < 1) throw VaultQueryException("Page specification: invalid page size ${paging.pageSize} [must be a value between 1 and $MAX_PAGE_SIZE]")
}
query.firstResult = (paging.pageNumber - 1) * paging.pageSize
// For both SQLServer and PostgresSQL, firstResult must be >= 0. So we set a floor at 0.
// TODO: This is a catch-all solution. But why is the default pageNumber set to be -1 in the first place?
// Even if we set the default pageNumber to be 1 instead, that may not cover the non-default cases.
// So the floor may be necessary anyway.
query.firstResult = maxOf(0, (paging.pageNumber - 1) * paging.pageSize)
query.maxResults = paging.pageSize + 1 // detection too many results
// execution