MMBase

Unexpected results from getList when specifying startNodes=-1

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Won't Fix
  • Affects Version/s: 1.7.0
  • Fix Version/s: Irrelevant
  • Component/s: Mmci
  • Description:
    Hide
    original bugid: #6656
    When calling the Cloud method getList(), specifying "-1" for the first argument (startNodes), gives the same result as specifying no startNodes at all.
    It makes more sense if in this case no results are returned, since there is no node with this nodenumber. This also conforms to the practice that is used in some parts of MMBase to use -1 to denote "no node".
    It would be easy to fix this (see Queries.creatQuery()), but in order to do that it needs to be established this has no site-effects. Possibly the special treatment of startNodes "-1" is due to some quick-and-dirty hack, so I want to know how it is motivated.

    (Note that negative nodenumbers are sometimes assigned to new nodes that are not committed yet, but that's not relevant here.)

    Show
    original bugid: #6656 When calling the Cloud method getList(), specifying "-1" for the first argument (startNodes), gives the same result as specifying no startNodes at all. It makes more sense if in this case no results are returned, since there is no node with this nodenumber. This also conforms to the practice that is used in some parts of MMBase to use -1 to denote "no node". It would be easy to fix this (see Queries.creatQuery()), but in order to do that it needs to be established this has no site-effects. Possibly the special treatment of startNodes "-1" is due to some quick-and-dirty hack, so I want to know how it is motivated. (Note that negative nodenumbers are sometimes assigned to new nodes that are not committed yet, but that's not relevant here.)

Activity

Hide
Pierre van Rooden added a comment - 1970-01-01 00:59
 This is a left-over from old behavior of Clusterbuilder and (iirc) MultiRelations.
I suggest to make this a hack and ask for a vote as it changes previous behavior and may break websites that (due to some odd behavior) make use of this feature.
Show
Pierre van Rooden added a comment - 1970-01-01 00:59  This is a left-over from old behavior of Clusterbuilder and (iirc) MultiRelations. I suggest to make this a hack and ask for a vote as it changes previous behavior and may break websites that (due to some odd behavior) make use of this feature.
Hide
Rob van Maris added a comment - 2005-02-03 17:56
Unexpected results from getList when specifying startNodes=-1
When calling the Cloud method getList(), specifying "-1" for the first argument (startNodes), gives the same result as specifying no startNodes at all.
It makes more sense if in this case no results are returned, since there is no node with this nodenumber. This also conforms to the practice that is used in some parts of MMBase to use -1 to denote "no node".
It would be easy to fix this (see Queries.creatQuery()), but in order to do that it needs to be established this has no site-effects. Possibly the special treatment of startNodes "-1" is due to some quick-and-dirty hack, so I want to know how it is motivated.

(Note that negative nodenumbers are sometimes assigned to new nodes that are not committed yet, but that's not relevant here.)

Show
Rob van Maris added a comment - 2005-02-03 17:56 Unexpected results from getList when specifying startNodes=-1 When calling the Cloud method getList(), specifying "-1" for the first argument (startNodes), gives the same result as specifying no startNodes at all. It makes more sense if in this case no results are returned, since there is no node with this nodenumber. This also conforms to the practice that is used in some parts of MMBase to use -1 to denote "no node". It would be easy to fix this (see Queries.creatQuery()), but in order to do that it needs to be established this has no site-effects. Possibly the special treatment of startNodes "-1" is due to some quick-and-dirty hack, so I want to know how it is motivated. (Note that negative nodenumbers are sometimes assigned to new nodes that are not committed yet, but that's not relevant here.)
Hide
Michiel Meeuwissen added a comment - 2007-02-02 20:39
Can easily be fied with 'wontfix'. Otherwise I suggest to fix it in 1.9.
Show
Michiel Meeuwissen added a comment - 2007-02-02 20:39 Can easily be fied with 'wontfix'. Otherwise I suggest to fix it in 1.9.
Hide
Michiel Meeuwissen added a comment - 2008-11-05 13:35
When using the query framework, adding a node to a step will give an exception if the node does not exists (such as -1).

Database often dont' support empy sets.

Unless someone else wants to do something, and reopen, I supose that won'tfix is good solution.

cloud.getList(String, String , Strng, String, String, String, Strng boolean) is quite an confusing method any way.

I suggest to use query-objects, and perhaos use another constraont on node (like number LE 0) if you want to make the query result empty.
Show
Michiel Meeuwissen added a comment - 2008-11-05 13:35 When using the query framework, adding a node to a step will give an exception if the node does not exists (such as -1). Database often dont' support empy sets. Unless someone else wants to do something, and reopen, I supose that won'tfix is good solution. cloud.getList(String, String , Strng, String, String, String, Strng boolean) is quite an confusing method any way. I suggest to use query-objects, and perhaos use another constraont on node (like number LE 0) if you want to make the query result empty.

People

Dates

  • Created:
    2005-02-11 11:12
    Updated:
    2008-11-05 13:35
    Resolved:
    2008-11-05 13:35