|
|
OQL: allow to use constants in comparison expressions with bind values |
Query page
Enter new bug
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.
|
|