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

SELECT COUNT(*) FROM view - Inconsistently broken

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Trivial
    • Resolution: Not a Bug
    • 10.2.13, 10.2.14
    • N/A
    • N/A
    • Ubuntu Server 16.04 LTS

    Description

      We've hit an inconsistent bug where a simple "SELECT COUNT( * ) FROM view" returns 1 as a result, even though there are 1000+ rows in the view.

      The view contains a basic set of inner joins, if you do a "SELECT * FROM view" you can see that there are 1000+ returned, so no hidden WHERE/HAVING clauses or such.

      Unfortunately this is inconsistent behavior, I have tried restarting the mysql service and I also ran the query from terminal using the mysql client, it also returned 1 as count. When I added a WHERE clause it fixed everything and the original SQL also started working correctly so I think this may be related to caching.

      Note that I tried COUNT( * ) from several views and on different servers and from the terminal client just to rule out my database IDE as a possible problem.

      (Please see attached screenshot)

      Attachments

        Activity

          People

            alice Alice Sherepa
            Ravenheart Toshko Andreev
            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.