Uploaded image for project: 'Couchbase Lite'
  1. Couchbase Lite
  2. CBL-5589

Beryllium - N1QL Parser has exponential slowdown for redundant parentheses

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • Beryllium
    • Beryllium, 3.0.18, 3.1.7
    • LiteCore
    • Security Level: Public
    • None
    • LiteCore 129
    • 1

    Description

      A query like `SELECT * FROM _ WHERE (((((type == "6")))))` should be the same as `SELECT * FROM _ WHERE (type == "6")`. But the N1QL parser creates a new expression for every parentheses. Because the parser acts recursively, this can cause exponential slowdown. We should strip the redundant parentheses at the top-level, to avoid creating unnecessary expressions.
      We must be careful not to remove all parentheses.

      Attachments

        Issue Links

          Activity

            People

              callum.birks Callum Birks
              callum.birks Callum Birks
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                PagerDuty