R
R
Roman Revin2015-12-21 19:27:48
MySQL
Roman Revin, 2015-12-21 19:27:48

Why does select count(*) return zero, while normal select returns a normal selection?

Good afternoon, colleagues.
There was such a problem.
Updated mysql 5.6 (only a minor figure has been updated, now 5.6.27 from the official mysql repository, that is, before that there was another 5.6.* version).
And now the simple select count(*) request has fallen off.
Full listing:

SELECT COUNT(*) as `count` FROM `package` WHERE `active`=1 AND `deleted`=0
The query returns null.
Such a request
SELECT * FROM `package` WHERE `active`=1 AND `deleted`=0
returns a normal selection of 900+ records (total ~ 1000 rows in the table)
If executed with only one of the conditions, for example
SELECT COUNT(*) as `count` FROM `package` WHERE `deleted`=0
or
SELECT COUNT(*) as `count` FROM `package` WHERE `active`=1
then a normal value (900+) is returned.
After optimize table about 10 minutes the base starts returning the correct value. But after 10 minutes again zero.
Once a minute, one row in the table is updated. No new lines appear.
What could be the problem?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question