Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-4965

Boolean to char conversion results in integer

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 10.7.1.1
    • 10.8.1.2
    • JDBC
    • None
    • Release Note Needed, Repro attached
    • 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().

      Attachments

        1. update-comments.diff
          2 kB
          Knut Anders Hatlen
        2. releaseNote.html
          5 kB
          Knut Anders Hatlen
        3. releaseNote.html
          5 kB
          Richard N. Hillegas
        4. releaseNote.html
          5 kB
          Richard N. 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

              knutanders Knut Anders Hatlen
              knutanders Knut Anders Hatlen
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: