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

Client driver silently truncates strings that exceed 32KB

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 10.8.1.2
    • 10.8.2.2, 10.9.1.0
    • Network Client
    • None
    • Repro attached
    • Embedded/Client difference, Wrong query result

    Description

      Can be seen with this JUnit test case that retrieves a VARCHAR value with 20000 characters. With the client driver, the string is truncated to 10900 characters (32700 bytes when encoded in UTF-8).

      public void testLongColumn() throws SQLException

      { PreparedStatement ps = prepareStatement( "values cast(? as varchar(20000))"); char[] chars = new char[20000]; Arrays.fill(chars, '\u4e10'); String str = new String(chars); ps.setString(1, str); JDBC.assertSingleValueResultSet(ps.executeQuery(), str); }

      Attachments

        1. d5236-5a-fix-version-check.diff
          1 kB
          Knut Anders Hatlen
        2. d5236-4b.diff
          4 kB
          Knut Anders Hatlen
        3. d5236-4a-client-compatibility.diff
          4 kB
          Knut Anders Hatlen
        4. d5236-3a-warning.diff
          26 kB
          Knut Anders Hatlen
        5. d5236-2a-longer-strings.diff
          10 kB
          Knut Anders Hatlen
        6. d5236-1a-client-fetch-complete.diff
          14 kB
          Knut Anders Hatlen
        7. write-full-string.diff
          3 kB
          Knut Anders Hatlen
        8. repro.diff
          3 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: