Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-14538

FOUND_ROWS() returns 1 when no results were found in previous query

    XMLWordPrintable

Details

    Description

      After executing a query which includes SQL_CALC_FOUND_ROWS directive, if the query returns zero results, the FOUND_ROWS() function returns '1'.

      Example:
      SELECT SQL_CALC_FOUND_ROWS * FROM table_name WHERE some_field = 'some value that matches 0 rows';

      SELECT FOUND_ROWS() as count_of_rows;

      returns count_of_rows = 1

      Version 5.5.56 is the latest version available in my distro's packages. Is this bug fixed with newer versions?
      This bug seems to be similar to MySQL bug 83110: https://bugs.mysql.com/bug.php?id=83110

      Attachments

        Activity

          People

            Unassigned Unassigned
            ryangriggs Ryan Griggs
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.