Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.12
    • Fix Version/s: 1.13
    • Component/s: parser
    • Labels:
    • Flags:
      Patch

      Description

      NPE when there is a null String in a SQLite DB.

      Caused by: java.lang.NullPointerException
      at org.apache.tika.parser.jdbc.JDBCTableReader.addAllCharacters(JDBCTableReader.java:252)
      at org.apache.tika.parser.jdbc.JDBCTableReader.handleCell(JDBCTableReader.java:135)
      at org.apache.tika.parser.jdbc.JDBCTableReader.nextRow(JDBCTableReader.java:95)
      at org.apache.tika.parser.jdbc.AbstractDBParser.parse(AbstractDBParser.java:90)
      at org.apache.tika.parser.jdbc.SQLite3Parser.parse(SQLite3Parser.java:78)

        Activity

        Hide
        githubbot ASF GitHub Bot added a comment -

        GitHub user fxfixer opened a pull request:

        https://github.com/apache/tika/pull/98

        TIKA-1927: NPE in JDBCTableReader

        Updated to handle null strings and added row of null values to test db file

        You can merge this pull request into a Git repository by running:

        $ git pull https://github.com/fxfixer/tika master

        Alternatively you can review and apply these changes as the patch at:

        https://github.com/apache/tika/pull/98.patch

        To close this pull request, make a commit to your master/trunk branch
        with (at least) the following in the commit message:

        This closes #98


        commit e64f71e2af699ff6157c34e4b55ab7e8bc828179
        Author: fxfixer <fxfixer@users.noreply.github.com>
        Date: 2016-04-03T23:59:27Z

        NPE in JDBCTableReader

        Handle null strings


        Show
        githubbot ASF GitHub Bot added a comment - GitHub user fxfixer opened a pull request: https://github.com/apache/tika/pull/98 TIKA-1927 : NPE in JDBCTableReader Updated to handle null strings and added row of null values to test db file You can merge this pull request into a Git repository by running: $ git pull https://github.com/fxfixer/tika master Alternatively you can review and apply these changes as the patch at: https://github.com/apache/tika/pull/98.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #98 commit e64f71e2af699ff6157c34e4b55ab7e8bc828179 Author: fxfixer <fxfixer@users.noreply.github.com> Date: 2016-04-03T23:59:27Z NPE in JDBCTableReader Handle null strings
        Hide
        nicholasc Nick C added a comment -

        One thing I noticed but didn't fix was the handling of nulls for primitive data types. They don't cause errors but do result in zeros in the output. If these should generate blank values I would probably refactor the code some.

        Show
        nicholasc Nick C added a comment - One thing I noticed but didn't fix was the handling of nulls for primitive data types. They don't cause errors but do result in zeros in the output. If these should generate blank values I would probably refactor the code some.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user asfgit closed the pull request at:

        https://github.com/apache/tika/pull/98

        Show
        githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/tika/pull/98
        Hide
        hudson Hudson added a comment -

        UNSTABLE: Integrated in tika-trunk-jdk1.7 #939 (See https://builds.apache.org/job/tika-trunk-jdk1.7/939/)
        TIKA-1927 – Thanks to fxfixer (Nick C) for opening the issue and (tallison: rev 4f22b085b1569d66d711b79751478dfb8448c353)

        • tika-parsers/src/test/resources/test-documents/testSqlite3b.db
        • tika-parsers/src/main/java/org/apache/tika/parser/jdbc/JDBCTableReader.java
        • tika-parsers/src/main/java/org/apache/tika/parser/jdbc/SQLite3TableReader.java
        • tika-parsers/src/test/java/org/apache/tika/parser/jdbc/SQLite3ParserTest.java
          TIKA-1927 – update changes . This closes #98 (tallison: rev 48d17b69d00645e17f934eae7bd4a15303ea93f5)
        • CHANGES.txt
        Show
        hudson Hudson added a comment - UNSTABLE: Integrated in tika-trunk-jdk1.7 #939 (See https://builds.apache.org/job/tika-trunk-jdk1.7/939/ ) TIKA-1927 – Thanks to fxfixer (Nick C) for opening the issue and (tallison: rev 4f22b085b1569d66d711b79751478dfb8448c353) tika-parsers/src/test/resources/test-documents/testSqlite3b.db tika-parsers/src/main/java/org/apache/tika/parser/jdbc/JDBCTableReader.java tika-parsers/src/main/java/org/apache/tika/parser/jdbc/SQLite3TableReader.java tika-parsers/src/test/java/org/apache/tika/parser/jdbc/SQLite3ParserTest.java TIKA-1927 – update changes . This closes #98 (tallison: rev 48d17b69d00645e17f934eae7bd4a15303ea93f5) CHANGES.txt
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in tika-trunk-jdk1.7 #940 (See https://builds.apache.org/job/tika-trunk-jdk1.7/940/)
        TIKA-1927 – add catch for UnsupportedOperationException, which (tallison: rev 5a74addc0ded0120949fc330564986607f6d8b39)

        • tika-parsers/src/main/java/org/apache/tika/parser/jdbc/JDBCTableReader.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in tika-trunk-jdk1.7 #940 (See https://builds.apache.org/job/tika-trunk-jdk1.7/940/ ) TIKA-1927 – add catch for UnsupportedOperationException, which (tallison: rev 5a74addc0ded0120949fc330564986607f6d8b39) tika-parsers/src/main/java/org/apache/tika/parser/jdbc/JDBCTableReader.java
        Hide
        tallison@mitre.org Tim Allison added a comment -

        Thank you, Nick C. I added a new row to our test db where all data types were null. I also fixed the null handling of primitive (e.g. int) types so that nothing is printed out instead of "0". While working on this, I also noticed TIKA-1929.

        Show
        tallison@mitre.org Tim Allison added a comment - Thank you, Nick C . I added a new row to our test db where all data types were null. I also fixed the null handling of primitive (e.g. int) types so that nothing is printed out instead of "0". While working on this, I also noticed TIKA-1929 .

          People

          • Assignee:
            tallison@mitre.org Tim Allison
            Reporter:
            nicholasc Nick C
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development