Re: Bugs in WorkflowQuery (JIRA-ISSUE WF-150)

"Philipp Hug" <[email protected]>
Newsgroups gmane.comp.java.open-symphony.devel
Message-ID <024401c31942$2185ab10$522210ac@chimera>
A small mistake has been made, when this patch was applied:
right should be "null" and not null;

diff -r1.1.1.2 -r1.3
664c664
< right = null;
---
> right = "null";

--> Jira WF-150
philipp
----- Original Message ----- 
From: "Pat Lightbody" <[email protected]>
To: "Hani Suleiman" <[email protected]>;
<[email protected]>
Sent: Wednesday, April 30, 2003 6:09 PM
Subject: Re: [Opensymphony-developers] Bugs in WorkflowQuery


> Also, the query stuff has been updated from another user and there is a
> patch in JIRA, so when I get around to applying the patch it may resolve
> these issues.
>
> -Pat
>
> ----- Original Message -----
> From: "Hani Suleiman" <[email protected]>
> To: <[email protected]>
> Sent: Wednesday, April 30, 2003 9:02 AM
> Subject: Re: [Opensymphony-developers] Bugs in WorkflowQuery
>
>
> > Your patches look oddly indented. can you file an issue in jira for
> > these? Thanks!
> >
> > On Wednesday, April 30, 2003, at 08:40 AM, Philipp Hug wrote:
> >
> > > I found some problems in WorkflowQuery and JDBCWorkflowStore:
> > >
> > > 1. JDBCWorkflowStore cannot handle queries with null values such as:
> > >     WorkflowQuery(WorkflowQuery.OWNER, WorkflowQuery.CURRENT,
> > > WorkflowQuery.EQUALS, null)
> > > this results in a NPE.
> > >
> > > Patch: JDBCWorkflowStore.java
> > > 661c661,665
> > > <         right = value.toString();
> > > ---
> > >>         if (value != null) {
> > >>             right = "'" + escape(value.toString()) + "'";
> > >>         } else {
> > >>             right = "null";
> > >>         }
> > > 663c667
> > > <         return left + oper + "'" + escape(right) + "'";
> > > ---
> > >>         return left + oper + right;
> > >
> > >
> > > 2. recursive queries are handled incorrectly:
> > > if the root WorkflowQuery object is an AND/OR/XOR query, qtype is set
> > > to
> > > zero.
> > > JDBCWorkflowStore just uses the qtype of the left query:
> > >             if (query.getLeft() != null) {
> > >                 qtype = query.getLeft().getType();
> > > but if this query object is also an AND/OR or XOR query it'll use zero
> > > as
> > > qtype and
> > > it will build a query that searches in the HISTORY_STEPS table.
> > >
> > > Patch:
> > > -> move code from JDBCWorkflStore to WorkflowQuery
> > > -> do recursive search for qtype instead of just going one level down.
> > >
> > > WorkflowQuery
> > > diff -r1.1 -r1.2
> > > 17c17
> > > <  * @version $Revision: 1.1 $
> > > ---
> > >>  * @version $Revision: 1.2 $
> > > 84c84,95
> > > <         return type;
> > > ---
> > >>         int qtype = type;
> > >>
> > >>         if (qtype == 0) { // then not set, so look in sub queries
> > >>                           // todo: not sure if you would have a query
> > >> that
> > > would look in both old and new, if so, i'll have to change this - TR
> > >>                           // but then again, why are there redundant
> > > tables in the first place? the data model should probably change
> > >>
> > >>             if (getLeft() != null) {
> > >>                 qtype = getLeft().getType();
> > >>             }
> > >>         }
> > >>
> > >>         return qtype;
> > >
> > >
> > > philipp
> > >
> > >
> > >
> > > -------------------------------------------------------
> > > This sf.net email is sponsored by:ThinkGeek
> > > Welcome to geek heaven.
> > > http://thinkgeek.com/sf
> > > _______________________________________________
> > > Opensymphony-developers mailing list
> > > [email protected]
> > > https://lists.sourceforge.net/lists/listinfo/opensymphony-developers
> > >
> >
> >
> >
> > -------------------------------------------------------
> > This sf.net email is sponsored by:ThinkGeek
> > Welcome to geek heaven.
> > http://thinkgeek.com/sf
> > _______________________________________________
> > Opensymphony-developers mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/opensymphony-developers
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Opensymphony-developers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/opensymphony-developers
>
>



-------------------------------------------------------
Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara
The only event dedicated to issues related to Linux enterprise solutions
www.enterpriselinuxforum.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.