-
-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SqlsrvDriver: offset must have a order by #302
base: master
Are you sure you want to change the base?
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
17866e0
to
82c45c3
Compare
dd46ea7
to
9e71132
Compare
4947fa5
to
04f006a
Compare