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

spider returns incorrect results for FOUND_ROWS() with SELECT SQL_CALC_FOUND_ROWS

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.6, 10.11, 11.4, 11.8, 12.1
    • None
    • None
    • Unexpected results

    Description

      (Copied from https://jira.mariadb.org/browse/MDEV-36478?focusedCommentId=303588&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-303588)

      Turned out spider does not support found_rows() at all and the correct output in *.basic_sql without view protocol is just a coincidence.

      Here's a simple test demonstrating this fact:

      create table t2 (c int);
      create table t1 (c int) ENGINE=Spider
      COMMENT='WRAPPER "mysql", srv "srv",TABLE "t2"';
      insert into t1 values (1), (2), (3), (4), (5);
      select SQL_CALC_FOUND_ROWS c from t1 order by c limit 4;
      c
      1
      2
      3
      4
      select found_rows();
      found_rows()
      1
      select SQL_CALC_FOUND_ROWS c from t2 order by c limit 4;
      c
      1
      2
      3
      4
      select found_rows();
      found_rows()
      5
      

      See https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/information-functions/found_rows for documentation

      Attachments

        Issue Links

          Activity

            People

              ycp Yuchen Pei
              ycp Yuchen Pei
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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