Bugzilla Version 2.16.7
Bugzilla Bug 1791
  OQL: allow to use constants in comparison expressions with bind values
     Query page      Enter new bug
Bug#: 1791   Platform:   Reporter: martin-fuchs at gmx dot net (Martin Fuchs)
Product:   OS:   Add CC:
Component:   Version:   CC:
Remove selected CCs
Status: CLOSED   Priority:  
Resolution: FIXED   Severity:  
Assigned To: werner dot guttmann at gmx dot net (Werner Guttmann)   Target Milestone:  
URL:
Summary:

Attachment Type Modified Status Actions
proposed patch patch 2004-11-28 15:17 none Edit
test case patch 2004-11-28 15:15 none Edit
updated patch patch 2004-11-28 15:17 none Edit
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 1791 depends on: Show dependency tree
Show dependency graph
Bug 1791 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments:


Leave as CLOSED FIXED
Reopen bug

View Bug Activity   |   Format For Printing

Description: Opened: 2004-11-13 05:25

This patch allows to use constants in comparison expressions with bind values.
Here are some simple examples:

"... where $1 = \"ABC\""
"... where $(int)1 < 4711"

------- Additional Comment #1 From Martin Fuchs 2004-11-13 05:26 -------
Created an attachment (id=770)
proposed patch

------- Additional Comment #2 From Werner Guttmann 2004-11-19 12:30 -------
How does Castor currently deal with below examples ? 

------- Additional Comment #3 From Martin Fuchs 2004-11-19 15:24 -------
Well, it throws exceptions like the following:

org.exolab.castor.jdo.QueryException: Could not get type for comparison.
	at org.exolab.castor.jdo.oql.ParseTreeWalker.getTypeForComparison
(ParseTreeWalker.java:763)
	at org.exolab.castor.jdo.oql.ParseTreeWalker.checkParameter
(ParseTreeWalker.java:733)
	at org.exolab.castor.jdo.oql.ParseTreeWalker.checkWhereClause
(ParseTreeWalker.java:593)
	at org.exolab.castor.jdo.oql.ParseTreeWalker.checkWhereClause
(ParseTreeWalker.java:601)
	at org.exolab.castor.jdo.oql.ParseTreeWalker.checkWhereClause
(ParseTreeWalker.java:601)
	at org.exolab.castor.jdo.oql.ParseTreeWalker.checkErrors
(ParseTreeWalker.java:240)
	at org.exolab.castor.jdo.oql.ParseTreeWalker.<init>
(ParseTreeWalker.java:140)
	at org.exolab.castor.jdo.engine.OQLQueryImpl.create
(OQLQueryImpl.java:254)
	at org.exolab.castor.jdo.engine.DatabaseImpl.getOQLQuery
(DatabaseImpl.java:462)
	at scottTest.DeptEmp.run(DeptEmp.java:89)
	at scottTest.DeptEmp.main(DeptEmp.java:19)

------- Additional Comment #4 From Werner Guttmann 2004-11-22 01:38 -------
Thanks. Can you please attach a JUnit test case, that shows the current
problem(s) and will run successfully once the patch has been applied. Whether or
not this test case finally makes it into the test suite we'll talk about at a
later point of time.

------- Additional Comment #5 From Werner Guttmann 2004-11-26 03:53 -------
Martin ? If you'd like to get this into the RC2, this'd be the perfect time to
expand your patch, wouldn't it? Sorry for being cheeky here ... ,-).

------- Additional Comment #6 From Martin Fuchs 2004-11-28 15:15 -------
Created an attachment (id=793)
test case

This test case is integrated in the already existing OQL tests in OqlTests.java
and shows how to successfully compare an bind variable parameter with a
constant.

------- Additional Comment #7 From Martin Fuchs 2004-11-28 15:17 -------
Created an attachment (id=794)
updated patch

update to the current CVS code

------- Additional Comment #8 From Werner Guttmann 2004-11-29 03:48 -------
Patch applied.

------- Additional Comment #9 From Werner Guttmann 2004-11-29 03:48 -------
Patch applied (once more .. ;-)).

     Query page      Enter new bug
This is Bugzilla: the Mozilla bug system. For more information about what Bugzilla is and what it can do, see bugzilla.org.
Actions: New | Query | bug # | Reports   New Account | Log In