[MDEV-15852] SELECT COUNT(*) FROM view - Inconsistently broken Created: 2018-04-12 Updated: 2018-04-15 Resolved: 2018-04-15 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | N/A |
| Affects Version/s: | 10.2.13, 10.2.14 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Trivial |
| Reporter: | Toshko Andreev | Assignee: | Alice Sherepa |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | cache | ||
| Environment: |
Ubuntu Server 16.04 LTS |
||
| Attachments: |
|
| 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) |
| Comments |
| Comment by Toshko Andreev [ 2018-04-13 ] | |||||||
|
I'll mark this as "Trivial" because I have some doubts it may actually be the DB IDE we use thats at fault. | |||||||
| Comment by Alice Sherepa [ 2018-04-15 ] | |||||||
|
Hi Ravenheart , you have typo in the query, it has "SELECT COUNT( * ) AS view" instead of FROM.
|