Skip to content
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

MSSQL - Pagination fix #7149

Closed
wants to merge 4 commits into from
Closed

MSSQL - Pagination fix #7149

wants to merge 4 commits into from

Conversation

alikon
Copy link
Contributor

@alikon alikon commented Jun 10, 2015

Steps to reproduce the issue

use pagination and set a limit
example go to Administration Article Manager Articles and set a limit for show only 5 articlesper page

Expected result

pagination works well show only 5 articles per page

Actual result

don't work show more articles

jmssql pagination administration article manager articles

System information (as much as possible)

PHP Version 5.5.9
Web Server Apache/2.4.7 (Win32)
Joomla! Version Joomla! 3.4.1
Database MSSQL 2008 R2

Additional comments

fixed the process limit query on sqlsrv

  SELECT * FROM ( 
   the old $query
) A WHERE A.RowNumber  BETWEEN start AND end;

#### Steps to reproduce the issue
use pagination and set a limit
example go to Administration   Article Manager  Articles and set a limit for show only 5 articlesper page



#### Expected result

pagination works well  show only 5 articles per page

#### Actual result

don't work  show all articles



#### System information (as much as possible)
PHP Version  5.5.9
Web Server  Apache/2.4.7 (Win32) 
Joomla! Version Joomla! 3.4.1 
Database MSSQL 2008 R2





#### Additional comments
fixed the process limit query 
  SELECT * FROM ( 
    SELECT *, ROW_NUMBER() OVER (ORDER BY id) as RowNumber 
        FROM [joomla].[dbo].[qwyd5_content]
) a WHERE a.RowNumber  BETWEEN 50 AND 60;
@wilsonge
Copy link
Contributor

This exact code was removed in #5293 - are we sure that we aren't introducing new bugs elsewhere?

@alikon
Copy link
Contributor Author

alikon commented Jun 10, 2015

i've followed these
http://blogs.msdn.com/b/sqlserver/archive/2006/10/25/limit-in-sql-server.aspx
https://technet.microsoft.com/en-us/library/ms186734.aspx

don't know about #5293 and azure

p.s
for #6414 the correct query was removed by mistake i think in #5293

space
zero-24 and others added 2 commits June 10, 2015 22:14
https://travis-ci.org/joomla/joomla-cms/jobs/66274374

```

FILE: ...avis/build/joomla/joomla-cms/libraries/joomla/database/query/sqlsrv.php
--------------------------------------------------------------------------------
FOUND 1 ERROR(S) AFFECTING 1 LINE(S)
--------------------------------------------------------------------------------
 334 | ERROR | Concat operator must be preceeded by one space
--------------------------------------------------------------------------------
UPGRADE TO PHP_CODESNIFFER 2.0 TO FIX ERRORS AUTOMATICALLY
--------------------------------------------------------------------------------
```
@sovainfo
Copy link
Contributor

@test OK
Issue confirmed on MS SQL. PR resolves issue.
Fixes the regression introduced by #5293 reported in #6414 !

Considering Azure works the same, it should be applied there as well.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7149.

@coolcat-creations
Copy link
Contributor

Is there any free webhost service for testing MS SQL? I just tried somee.com but have some issues creating the ms sql Database there... :(


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7149.

@alikon
Copy link
Contributor Author

alikon commented Jun 14, 2015

i can recommend to use on a localhost the "express" edition is a free version of MSSQL

@waader
Copy link
Contributor

waader commented Jun 26, 2015

@test works!

@zero-24
Copy link
Contributor

zero-24 commented Jun 26, 2015

RTC Thanks!


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7149.

@zero-24 zero-24 added the RTC This Pull Request is Ready To Commit label Jun 26, 2015
@wilsonge wilsonge added this to the Joomla! 3.4.2 milestone Jun 27, 2015
@wilsonge
Copy link
Contributor

Merged - thanks!

@wilsonge wilsonge closed this in cbeeb09 Jun 27, 2015
@zero-24 zero-24 removed the RTC This Pull Request is Ready To Commit label Oct 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants