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

Treat offset and limit input the same way #3183

Closed
wants to merge 1 commit into from

Commits on May 6, 2019

  1. Treat offset and limit input the same way

    Currently, if you give offset a string, it will throw an error like this:
    ```
    code: 'ER_PARSE_ERROR',
      errno: 1064,
      sqlMessage:
       'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'\'0\'\' at line 1',
      sqlState: '42000',
      index: 0,
      sql:
       'select * from `Alert` inner join `AlertType` on `Alert`.`AlertTypeID` = `AlertType`.`AlertTypeID` order by `AlertDate` desc limit 2 offset \'0\'' }
    ```
    This is problematic, seeing how offset is likely used in pagination using a query in the url, which is usually treated as a string. It's weird to me that it's not like this already since `limit`, a relatively similar method, is implemented this way.
    AndreasClausen committed May 6, 2019
    Configuration menu
    Copy the full SHA
    560bd09 View commit details
    Browse the repository at this point in the history