Count (*) returning a negative value

I have a strange problem and something that I have not encountered before. I have a mysql query like below

SELECT COUNT( * ) AS total_count FROM postcodes WHERE prefix='M1'; 

My query matches a single line, so I expect the value of total_count is 1. However, it returns -1 instead. Does anyone know why if a negative value were returned?

+4
source share
1 answer

According to this error report , you need to run REPAIR TABLE .

+4
source

Source: https://habr.com/ru/post/1491295/


All Articles