Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-5896

GroovyRowResult object returns different kinds of values when calling size() depending on how object was instantiated

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Not A Problem
    • 1.7.11
    • None
    • GroovyScriptEngine
    • None
    • Windows 7

    Description

      Not sure if this is intended behavior, but when using size() as applied to a GroovyRowresult object, it will return the number of rows in the object if the object was created by a call to

      {Sql object}.rows(sql_select_text). However if the GroovyRowresult object was created by a call to {Sql object}

      .firstRow(sql_select_text), it will return the number of fields in the returned record. Problem seems to be that the returned value of a call to

      {GroovyRowresult object}

      .size() is determined by how the GroovyRowresult object came into being and not anything else that would be an obvious or clear distinction. Is this intended behavior or not? I can't find it referred to in the Groovy documantation even for the most current ver. of Groovy. Code that reproduces the behavior is attached.

      Attachments

        1. groovyResultsetSizeIssue.txt
          0.9 kB
          Matt Campbell

        Activity

          People

            blackdrag Jochen Theodorou
            mcc99 Matt Campbell
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: