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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 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
    • 10.8.3.3, 10.9.1.0
    • JDBC
    • None
    • High Value Fix, Repro attached
    • 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.

      Attachments

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

        Issue Links

          Activity

            People

              dagw Dag H. Wanvik
              dagw Dag H. Wanvik
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: