Uploaded image for project: 'Tajo (Retired)'
  1. Tajo (Retired)
  2. TAJO-120

TestCase doesn't call ResultSet.close

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • 0.2-incubating
    • 0.2-incubating
    • SQL Shell
    • None

    Description

      Current implementation is

      ResultSet res = tpch.execute("select 100 * sum(" +
              "case when p_type like 'PROMO%' then l_extendedprice else 0.0 end) / sum(l_extendedprice * (1 - l_discount)) "
              + "as promo_revenue from lineitem, part where l_partkey = p_partkey");
      
      assertTrue(res.next());
      assertEquals(33, res.getInt(1));
      

      Changed implementation is

      ResultSet res = tpch.execute("select 100 * sum(" +
              "case when p_type like 'PROMO%' then l_extendedprice else 0.0 end) / sum(l_extendedprice * (1 - l_discount)) "
              + "as promo_revenue from lineitem, part where l_partkey = p_partkey");
      
      try {
        assertTrue(res.next());
        assertEquals(33, res.getInt(1));
      } finally {
        res.close();
      }
      

      Attachments

        Issue Links

          Activity

            People

              hjkim Hyoungjun Kim
              hjkim Hyoungjun Kim
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: