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

[Analytics] like query on non-string field errors

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 6.5.0
    • 6.5.0
    • analytics
    • 6.5.0-4176
    • Untriaged
    • No
    • CX Sprint 166, CX Sprint 167

    Description

      load travel-sample

      run:

      SELECT id, airlineid, airline FROM `travel-sample` t WHERE (ANY s IN t.schedule SATISFIES s.day like "3%" END) AND `type` = "route" ORDER BY id, airlineid, airline

      This query is allowed to run even though the day field is of type int. It will return no results since day is an int field.

      The same query on analytics returns this error:

      SELECT id, airlineid, airline FROM `travel-sample` t WHERE (ANY s IN t.schedule SATISFIES s.day like '3%' END) AND `type` = "route" ORDER BY id, airlineid, airline
      

       [
       
      { "code": 24011, "msg": "Type mismatch: function like expects its 1st input parameter to be of type string, but the actual input type is bigint (in line 1, at column 97)", "query_from_user": "SELECT id, airlineid, airline FROM `travel-sample` t WHERE (ANY s IN t.schedule SATISFIES s.day like '3%' END) AND `type` = \"route\" ORDER BY id, airlineid, airline" }
       
      ]
      

      The documentation for like states:
      Match string with a wildcard expression. Use % for zero or more wildcards and _ to match any character at this place in a string.

      Attachments

        Issue Links

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

          Activity

            People

              mihir.kamdar Mihir Kamdar (Inactive)
              ajay.bhullar Ajay Bhullar
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty