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

SELECT 1-1 gives parse error

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 3.0
    • 2.1.0
    • query
    • Security Level: Public
    • None

    Description

      tuq> select 1-1
      {
      "error":

      { "caller": "standard:50", "cause": "Parse Error - syntax error", "code": 4100, "key": "parse_error", "message": "Parse Error" }

      }
      tuq> select (1)-(1)
      {
      "resultset": [

      { "$1": 0 }

      ],
      "info": [

      { "caller": "http_response:150", "code": 100, "key": "total_rows", "message": "1" }

      ,

      { "caller": "http_response:152", "code": 101, "key": "total_elapsed_time", "message": "1.12849ms" }

      ]
      }

      I believe the problem is that we parse negative numbers directly, when instead we should only parse the positive versions, and let the sign change operator give the effect. This would at least let the statement parse. It still might parse incorrectly, but that would be a separate issue.

      Attachments

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

        Activity

          People

            iryna iryna
            mschoch Marty Schoch [X] (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