[MDEV-25448] select count(*) combined with MATCH AGAINST returns wrong count Created: 2021-04-19  Updated: 2021-04-19

Status: Open
Project: MariaDB Server
Component/s: Full-text Search
Affects Version/s: 10.5.9
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Patrick Heppler Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Environment:

CentOS 8.3



 Description   

I have a table accounts:

Field Type Null Key Default Extra
id bigint(20) unsigned NO PRI NULL auto_increment
fullname varchar(255) NO UNI NULL  
email varchar(255) NO UNI NULL  
created_at timestamp YES   NULL  
updated_at timestamp YES   NULL  

The table has 11 entries, where 4 have a fullname which contains "Foo".

But running this query the result is 11:

select count(*) as aggregate 
from `accounts` 
where MATCH (fullname) AGAINST ('+foo*' IN BOOLEAN MODE) 
   or `fullname` LIKE '%foo%';

While running this returns 4 rows

select * 
from `accounts` 
where MATCH (fullname) AGAINST ('+foo*' IN BOOLEAN MODE) 
   or `fullname` LIKE '%foo%';


Generated at Thu Feb 08 09:37:46 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.