Derby
  1. Derby
  2. DERBY-4965

Boolean to char conversion results in integer

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.7.1.1
    • Fix Version/s: 10.8.1.2
    • Component/s: JDBC
    • Labels:
      None
    • Issue & fix info:
      Release Note Needed, Repro attached
    • Bug behavior facts:
      Deviation from standard

      Description

      Seen when running the Java EE CTS on Derby 10.7.1.1. The following code results in "1" being printed, whereas the expected result is "true":

      PreparedStatement ps = c.prepareStatement("values cast(? as char(10))");
      ps.setObject(1, Boolean.TRUE, Types.CHAR);
      ResultSet rs = ps.executeQuery();
      rs.next();
      System.out.println(rs.getString(1));

      Same seen when using VARCHAR or LONGVARCHAR instead of CHAR, and when using setBoolean() instead of setObject().

      1. update-comments.diff
        2 kB
        Knut Anders Hatlen
      2. releaseNote.html
        5 kB
        Knut Anders Hatlen
      3. releaseNote.html
        5 kB
        Rick Hillegas
      4. releaseNote.html
        5 kB
        Rick Hillegas
      5. derby-4965-1c.diff
        12 kB
        Knut Anders Hatlen
      6. derby-4965-1b.diff
        9 kB
        Knut Anders Hatlen
      7. derby-4965-1a.diff
        6 kB
        Knut Anders Hatlen

        Issue Links

          Activity

            People

            • Assignee:
              Knut Anders Hatlen
              Reporter:
              Knut Anders Hatlen
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development