• Sergey Vojtovich's avatar
    BUG#38842 - Fix for 25951 seems incorrect · ab9ecae4
    Sergey Vojtovich authored
    With fix for bug 25951 index hints are ignored for fulltext
    searches, as handling of fulltext indexes is different from
    handling regular indexes. Meaning it is not possible to
    implement true index hints support for fulltext indexes within
    the scope of current fulltext architecture.
    
    The problem is that prior to fix for bug 25951, some useful
    index hints still could be given for boolean mode searches.
    
    This patch implements special index hints support for fulltext
    indexes with the following characteristics:
    - all index hints are still ignored for NLQ mode searches -
      it cannot work without an index;
    - for 5.1 and up index hints FOR ORDER BY and FOR GROUP BY are
      still ignored for fulltext indexes;
    - boolean mode searches honor USE/FORCE/IGNORE INDEX hints;
    - as opposed to index hints for regular indexes, index hints
      for fulltext BOOLEAN mode searches affect the usage of the
      index for the whole query.
    
    mysql-test/r/fulltext.result:
      A test case for BUG#38842.
    mysql-test/t/fulltext.test:
      A test case for BUG#38842.
    sql/item_func.cc:
      For boolean mode searches, which can work without fulltext
      index, use keys_in_use_for_query bitmap instead of keys_in_use.
      
      The effect is that boolean mode searches now honor index hints.
    ab9ecae4
item_func.cc 139 KB