dreamfactorysoftware / dreamfactory

DreamFactory API Management Platform
https://www.dreamfactory.com
Apache License 2.0
1.5k stars 309 forks source link

Sorting by column produces similar results on subsequent pages #153

Open vijayst opened 7 years ago

vijayst commented 7 years ago

I have a table which has cat_name field. The cat_name field has null entries. On sorting descending by cat_name, the null fields come at the top of the result. I am showing the results of first page and second page below.

{
  "resource": [
    {
      "app_name": "BleachBit 1"
    },
    {
      "app_name": "RealPlayer 18"
    },
    {
      "app_name": "AirDroid 3"
    },
    {
      "app_name": "EasyWeather 7"
    },
    {
      "app_name": "Ctrl2Cap 2"
    },
    {
      "app_name": "METEONORM 7"
    },
    {
      "app_name": "BSPlayer 2"
    },
    {
      "app_name": "Ctrl2Cap 2"
    },
    {
      "app_name": "Integrated Logistics Solutions 2008"
    },
    {
      "app_name": "Inkview 0.9"
    }
  ]
}
{
  "resource": [
    {
      "app_name": "Sumatra PDF 3"
    },
    {
      "app_name": "Ctrl2Cap 2"
    },
    {
      "app_name": "METEONORM 7"
    },
    {
      "app_name": "RPVoIP 5"
    },
    {
      "app_name": "BSPlayer 2"
    },
    {
      "app_name": "EasyWeather 7"
    },
    {
      "app_name": "AirDroid 3"
    },
    {
      "app_name": "Ctrl2Cap 2"
    },
    {
      "app_name": "LogMeIn Rescue Calling Card 7"
    },
    {
      "app_name": "Flash Slideshow Maker Professional 5"
    }
  ]
}

As you can see from the results above, page 1 and page 2 are returning similar results. It looks like a bug with the way pagination is handled.

todda48 commented 6 years ago

What type of database are you using?

vijayst commented 6 years ago

We are using PostGres DB.