Bugzilla Import PostgreSQL bytea causes "Bad value for type int" exception

XMLWordPrintable

    • 3.06

      Newer Bugzilla versions support PostgreSQL as bug database. The 'attachments' table has a field 'thedata' of
      type 'bytea'.

      Now PostgreSQL has two ways of storing BLOBs, see:
      http://jdbc.postgresql.org/documentation/80/binary-data.html

      The code in 'BugzillaImportBean.java' assumes the wrong one. So the code:

      final Blob fileData = resultsSet.getBlob('thedata');

      failes with the exception:

      "Bad value for type int: <binary data>"

      I provide a fast patch for 'BugzillaImportBean.java' for those few out there which happen to have run Bugzilla with PostgreSQL.

        1. bugzillaimportbean.jar
          23 kB
          Michelle de Guzman
        2. BugzillaImportBean.java
          65 kB
          Dylan Etkin [Atlassian]
        3. bugzillaimportbean-3.6.4.jar
          23 kB
          Michelle de Guzman
        4. BugzillaImportBean-postgresql-bytea-BLOB-patch
          2 kB
          Andreas Baumann

            Assignee:
            Dylan Etkin [Atlassian]
            Reporter:
            Andreas Baumann
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: