Conversation
rumcais
commented
Jul 27, 2018
- bug fix
|
Limitations in Using OFFSET-FETCH OFFSET clause is mandatory with FETCH. You can never use, ORDER BY … FETCH. TOP cannot be combined with OFFSET and FETCH in the same query expression. The OFFSET/FETCH rowcount expression can be any arithmetic, constant, or parameter expression that will return an integer value. The rowcount expression does not support scalar sub-queries. https://technet.microsoft.com/en-us/library/gg699618(v=sql.110).aspx |
|
I think ORDER BY must be added by programmer, because he knows how to order rows. ORDER BY 1 solves nothing. |
|
But the queries you have in the tests do not pass to MSSQL. "SELECT 1 OFFSET 10 ROWS FETCH NEXT 10 ROWS ONLY" ends with MSSQL error. Furthermore, FetchSingle() does not pass a simple query, and it does problems with addons like datagrid, etc. |
So tests should be fixed, or not?
Can you send here example code? |
e5e6a36 to
7a49609
Compare
4e171c7 to
0535d57
Compare
6b34262 to
34e1603
Compare
680e3f6 to
ed2a827
Compare
|
Perhaps we could throw an exception instead from I think that would be a good hint for simple cases like: $dibi->select('*')->from('table')->fetch();When I read this, I assume it does something like this: SELECT TOP 1 * FROM [table]
If we don't want to force the programmer to order the query, fallback to |
4c708e6 to
bc0332a
Compare
4947fa5 to
04f006a
Compare
60c2108 to
514bd23
Compare
8157984 to
4ea907a
Compare
013da5d to
c097256
Compare