Uploaded image for project: 'TinkerPop'
  1. TinkerPop
  2. TINKERPOP-2856

math() step fails if variable name contains a keyword

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 3.5.4
    • 3.7.0, 3.6.3, 3.5.6
    • process
    • None
    • Any Gremlin version that has the math() step. Reproduced on 3.6.0

    Description

      As reported on StackOverflow if a variable used as part of the math() step contains a reserved word such as "exp" the evaluation of the expression fails. For example

       

      math('number1-expected_value').next()

      results in

      *GremlinServerError: 499: {"detailedMessage":"Unknown function or variable 'cted_value' at pos 20 in expression 'number1 - expected_value'","requestId":"01e3f9e6-3cf2-4af0-bf94-5a4979d488b4","code":"InvalidParameterException"}*

      I am able to reproduce this in the Gremlin Console using TinkerPop version 3.6.0 using:{}

      gremlin> g.inject(1).as('expa').constant(2).as('c').math('c - expa')
      Unknown function or variable 'a' at pos 7 in expression 'c - expa'
      Type ':help' or ':h' for help.
      Display stack trace? [yN]
      
      gremlin> g.inject(1).as('a').constant(2).as('c').math('c - a')
      ==>1.0  

      Attachments

        Activity

          People

            spmallette Stephen Mallette
            krlawrence Kelvin Lawrence
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: