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

SQL_CALC_FOUND_ROWS not working properly for single SELECT for DUAL.

Details

    Description

      SQL_CALC_FOUND_ROWS not working properly, gives output zero because send_records is not getting incremented properly.

       
      MariaDB [test]> SELECT SQL_CALC_FOUND_ROWS 1 FROM DUAL WHERE 0;
      Empty set (0.00 sec)
       
      MariaDB [test]> SELECT FOUND_ROWS();
      +--------------+
      | FOUND_ROWS() |
      +--------------+
      |            0 |
      +--------------+
      1 row in set (0.00 sec)
       
      
      

      Attachments

        Activity

          rucha174 Rucha Deodhar added a comment -

          send_records in JOIN::exec_inner() was assigning 0 directly to send_records without checking if the flag that represents SQL_CALC_FOUND_ROWS is set. If it is set, send_records should be 1 otherwise 0.

          rucha174 Rucha Deodhar added a comment - send_records in JOIN::exec_inner() was assigning 0 directly to send_records without checking if the flag that represents SQL_CALC_FOUND_ROWS is set. If it is set, send_records should be 1 otherwise 0.

          OK to push after adding space between MDEV number with : and title of the bug.

          sanja Oleksandr Byelkin added a comment - OK to push after adding space between MDEV number with : and title of the bug.

          People

            rucha174 Rucha Deodhar
            rucha174 Rucha Deodhar
            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.