Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-9760

Fulltext native search, wildcard * does not get escaped leading to long execution time

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 3.0.8-RC1
    • 3.0.7-PL1
    • Search
    • None
    • PHP 5.1.6, MySQL 5.1.41

      Fulltext native search.

      Search keywords examples:

      (*)
      |*|*|
      *|keyword
      

      Then you get:

      SELECT p.post_id FROM (phpbb_search_wordlist w0, phpbb_search_wordmatch m0) LEFT JOIN phpbb_posts p ON (m0.post_id = p.post_id) WHERE w0.word_text LIKE '%' AND m0.word_id = w0.word_id AND p.post_approved = 1 AND p.forum_id NOT IN (100, 101, 102, 103, 104, 105, 106) GROUP BY p.post_id, p.post_time ORDER BY p.post_time DESC
      LIMIT 250;

      The important part is:
      word_text LIKE '%'

      This will cause long execution time on big boards with large phpbb_search_wordmatch table. This will lead to table lock on other tables causing board to crash.

      Confirmed with version 3.0.2 and 3.0.7-PL1

            ToonArmy Chris Smith
            alex-An-70 alex-An-70 [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: