Menu

#398 QueryDataSet getTable() can only return the first table.

v2.5.*
pending
None
(not fixed)
3
2017-09-17
2017-01-26
No

QueryDataSet getTable() can only return the first table stored into it. Any additional table added to the QueryDataSet will not be retrievable by calling getTable().

This is caused because getTable() is not overwritten in QueryDataSet and thus AbstractDataSet.getTable() is called instead. QueryDataSet records added tables in QueryDataSet.tables while AbstractDataset saves its list under AbstractDataset.orderedTableNameMap.

The class has two effective OrderedTableNameMap while it should only have one.

Occurs in 2.5.3, but looking at the Git code, the problem still persists.

Discussion

  • Jeff Jensen

    Jeff Jensen - 2017-01-26

    Thanks for the analyis and report.

    I am wondering if you are in progress with or planning on fixing? Creating tests that show the problem is a big help, and also with a fix is best help. If so, either a patch or merge request work well.

     
  • Hans Deragon

    Hans Deragon - 2017-01-26

    I do not have the time now, but what type of fix would you apply? At first glance, I would remove QueryDataSet.tables and have QueryDataSet make use of AbstractDataset.orderedTableNameMap.

     
  • Jeff Jensen

    Jeff Jensen - 2017-01-26

    Tests are more time consuming than the actual change.

     
  • Jeff Jensen

    Jeff Jensen - 2017-04-02
    • status: open --> pending
    • assigned_to: Jeff Jensen
     
  • Hans Deragon

    Hans Deragon - 2017-04-05

    CachedDataSet has the same problem. I removed the list from CachedDataSet and made use of the one inherited by AbstractDataSet and it works fine. I had to do this because it caused my recently added addTable() fonctions to fail.

     
  • Hans Deragon

    Hans Deragon - 2017-07-02

    Upon furth investigation and tests on QueryDataSet, I started to understand how it is working. I believe it needs the two lists after all. I need to spend more time on that class to fully understand what is going on.

    There are two other classes that are using a local version of OrderedTableNameMap instead
    of the one inherited by AbstractDataSet.

    dataset/CachedDataSet.java
    dataset/xml/FlatDtdDataSet.java

    I will open another bug report to investigate further their cases.

     
  • Jeff Jensen

    Jeff Jensen - 2017-07-02

    Thanks for the update and continued investigations, Hans.

     
  • Hans Deragon

    Hans Deragon - 2017-09-17

    DatabaseDataSet also has this problem. This one is tricky to fix.

     

Log in to post a comment.