Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-20677

REGEXP_LIKE does not error out invalid pattern strings

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • 4.6.2, 5.0.0
    • bug-backlog
    • query
    • None
    • Untriaged
    • No

    Description

      In N1QL's current implementation of REGEXP_LIKE, "^" and "$" is added for the exact match:
      https://github.com/couchbase/query/blob/master/expression/func_regexp.go#L168

      Therefore, certain invalid regular expression pattern strings that should be rejected can be accepted.

      Example:
      SELECT REGEXP_LIKE('Steven', '*');
      Result:
      [

      { "$1": true }

      ]

      MySQL raises an error for that.
      mysql> SELECT 'Steven' rlike '*';
      ERROR 1139 (42000): Got error 'repetition-operator operand invalid' from regexp

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              Prerna.Manaktala Prerna Manaktala (Inactive)
              yingyi Yingyi Bu (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty