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

select count(*) combined with MATCH AGAINST returns wrong count

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 10.5.9
    • None
    • Full-text Search
    • None
    • 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%';
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            patrick.heppler Patrick Heppler
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.