Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-8179

gfsh query command returns incorrect results if '=' sign is missing for query option

    XMLWordPrintableJSON

Details

    Description

      gfsh returns correct result when "=" is there for the query option:

      gfsh>query --query="Select ID from /portfolio where ID = 3"
      Result : true
      Limit : 100
      Rows : 1

      Result
      ------
      3

      It returns wrong result when "=" is missing for the query option.

      gfsh>query --query "Select ID from /portfolio where ID <= 3 "
      Result : true
      Limit : 100
      Rows : 3

      Result
      ------
      0
      1
      2

      gfsh>query --query "<trace> Select ID from /portfolio where ID = 3 "
      Result : false
      Message : Query is invalid due to error : <Syntax error in query: unexpected token: ID>

      gfsh>query --query "<trace> Select ID from /portfolio where ID == 3 "
      Result : true
      Limit : 100
      Rows : 1
      Query Trace : Query Executed in 0.968059 ms; indexesUsed(0)

      Result
      ------
      3

      gfsh>query --query "<trace> Select ID from /portfolio where ID =<= 3 "
      Result : true
      Limit : 100
      Rows : 4
      Query Trace : Query Executed in 1.427194 ms; indexesUsed(0)

      Result
      ------
      0
      1
      2
      3

      Seems that first '=' in the query string is discarded by gfsh.
      Either fail the query if the query option'=' is missing or gfsh should return correct result from the query string.

      Attachments

        Activity

          People

            alberto.bustamante.reyes Alberto Bustamante Reyes
            eshu Eric Shu
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: