Derby
  1. Derby
  2. DERBY-5459

Result set metadata are out of sync on client after underlying table is altered

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.2.1.6, 10.2.2.0, 10.3.1.4, 10.3.2.1, 10.3.3.0, 10.4.1.3, 10.4.2.0, 10.5.1.1, 10.5.2.0, 10.5.3.0, 10.6.1.0, 10.6.2.1, 10.7.1.1, 10.8.1.2
    • Fix Version/s: 10.8.3.3, 10.9.1.0
    • Component/s: JDBC
    • Labels:
      None
    • Issue & fix info:
      High Value Fix, Repro attached
    • Bug behavior facts:
      Embedded/Client difference, Wrong query result

      Description

      Cf the discussion on DERBY-3823.

      The enclosed repro program shows what happens. When I run it with
      client/server and embedded respectively we see these two differing
      results:

      client/server:

      $ java -cp .:$CLASSPATH Repo
      Done loading data
      executing alter
      execp.getResultDescription: select * from t1
      2. PS#getMetaData: char column length is 8
      Reexecuting ps on changed table...
      3. RS#getMetadata: char column length is 8
      data:1 12345678

      dag@T61pOS:~/java/sb/apps/derby3823$ !rm
      rm -rf DERBY3823DB

      embedded:

      dag@T61pOS:~/java/sb/apps/derby3823$ java -cp .:$CLASSPATH Repro 2
      execp.getResultDescription: insert into t1 values(?,'aaaaa')
      execp.getResultDescription: insert into t1 values(?,'aaaaa')
      Done loading data
      execp.getResultDescription: select * from t1
      execp.getResultDescription: select * from t1
      executing alter
      2. PS#getMetaData: char column length is 5
      Reexecuting ps on changed tableh...
      3. RS#getMetadata: char column length is 5
      data:1 12345678

      As we can see, the metadata results are different after the ALTER
      TABLE. The trace from EmbedPreparedData
      ("execp.getResultDescription:") lines (see repro-patch.diff) show that
      after ALTER, the metadata are not refreshed on the server side.

      1. Repro.java
        3 kB
        Dag H. Wanvik
      2. repro-patch.diff
        0.6 kB
        Dag H. Wanvik
      3. derby-5459-1.diff
        9 kB
        Dag H. Wanvik
      4. derby-5459-1.stat
        0.7 kB
        Dag H. Wanvik
      5. derby-5459-2.diff
        11 kB
        Dag H. Wanvik
      6. derby-5459-2.stat
        0.7 kB
        Dag H. Wanvik
      7. derby-5459-3.diff
        12 kB
        Dag H. Wanvik
      8. derby-5459-3.stat
        0.8 kB
        Dag H. Wanvik

        Issue Links

          Activity

          Mamta A. Satoor made changes -
          Link This issue is related to DERBY-6289 [ DERBY-6289 ]
          Mamta A. Satoor made changes -
          Fix Version/s 10.8.3.1 [ 12323475 ]
          Gavin made changes -
          Workflow jira [ 12637584 ] Default workflow, editable Closed status [ 12802852 ]
          Knut Anders Hatlen made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Dag H. Wanvik made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Dag H. Wanvik made changes -
          Comment [ With the patch to Emma, the fix to DERBY-5512 (thanks, Knut) and setting the path the the old releases when calling ant (since i'm behind a firewall), I was able to make all tests in ant target "derby-core" run with emma jars, albeit a few at a time. I'll start all the tests now passing larger heap size etc in via ANT_OPTS, so I'll see how far I get with Emma running the "emma-all" target. It would be nice to have it running again. ]
          Dag H. Wanvik made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          Dag H. Wanvik made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Dag H. Wanvik made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Issue & fix info Repro attached,Patch Available,High Value Fix [ 10424,10102,10422 ] High Value Fix,Repro attached [ 10422,10424 ]
          Fix Version/s 10.9.0.0 [ 12316344 ]
          Resolution Fixed [ 1 ]
          Dag H. Wanvik made changes -
          Attachment derby-5459-3.diff [ 12504882 ]
          Attachment derby-5459-3.stat [ 12504883 ]
          Dag H. Wanvik made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Dag H. Wanvik made changes -
          Assignee Dag H. Wanvik [ dagw ]
          Dag H. Wanvik made changes -
          Attachment derby-5459-2.diff [ 12503882 ]
          Attachment derby-5459-2.stat [ 12503883 ]
          Dag H. Wanvik made changes -
          Issue & fix info Repro attached,High Value Fix [ 10424,10422 ] High Value Fix,Patch Available,Repro attached [ 10422,10102,10424 ]
          Dag H. Wanvik made changes -
          Attachment derby-5459-1.diff [ 12503742 ]
          Attachment derby-5459-1.stat [ 12503743 ]
          Dag H. Wanvik made changes -
          Link This issue is related to DERBY-2402 [ DERBY-2402 ]
          Dag H. Wanvik made changes -
          Affects Version/s 10.8.1.2 [ 12316362 ]
          Affects Version/s 10.7.1.1 [ 12315564 ]
          Affects Version/s 10.6.2.1 [ 12315343 ]
          Affects Version/s 10.6.1.0 [ 12313727 ]
          Affects Version/s 10.5.3.0 [ 12314117 ]
          Affects Version/s 10.5.2.0 [ 12314116 ]
          Affects Version/s 10.5.1.1 [ 12313771 ]
          Affects Version/s 10.4.2.0 [ 12313345 ]
          Affects Version/s 10.4.1.3 [ 12313111 ]
          Affects Version/s 10.3.3.0 [ 12313142 ]
          Affects Version/s 10.3.2.1 [ 12312876 ]
          Affects Version/s 10.3.1.4 [ 12312590 ]
          Affects Version/s 10.2.2.0 [ 12312027 ]
          Affects Version/s 10.2.1.6 [ 11187 ]
          Component/s JDBC [ 11407 ]
          Dag H. Wanvik made changes -
          Link This issue is related to DERBY-4373 [ DERBY-4373 ]
          Dag H. Wanvik made changes -
          Link This issue is related to DERBY-3839 [ DERBY-3839 ]
          Dag H. Wanvik made changes -
          Attachment repro-patch.diff [ 12498847 ]
          Dag H. Wanvik made changes -
          Field Original Value New Value
          Attachment Repro.java [ 12498846 ]
          Dag H. Wanvik created issue -

            People

            • Assignee:
              Dag H. Wanvik
              Reporter:
              Dag H. Wanvik
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development