
|
If you were logged in you would be able to see more operations.
|
|
|
|
File Attachments:
|
|
|
Environment:
|
java5, tomcat 5.5.17
|
|
| Resolution Date: |
14/Jul/06 03:59 AM
|
|
Hello all,
there is a bug in Criteria.andDate: the call to the method getTime() is missing while it is present in Criteria.addDate
To exploit it use a code like
calendar.setTime(new Date());
crit.addDate(GpsLocationPeer.LAST_UPDATE, calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH), Criteria.GREATER_EQUAL);
calendar.add(Calendar.DAY_OF_MONTH, 1);
crit.andDate(GpsLocationPeer.LAST_UPDATE, calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH), Criteria.LESS_THAN);
This leads to a SQLException due to incorrect sql query creation.
That is easy to see with Criteria.toString()
Adding the missing method call solves the problem
Please, check the attached patch. Thank you
|
|
Description
|
Hello all,
there is a bug in Criteria.andDate: the call to the method getTime() is missing while it is present in Criteria.addDate
To exploit it use a code like
calendar.setTime(new Date());
crit.addDate(GpsLocationPeer.LAST_UPDATE, calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH), Criteria.GREATER_EQUAL);
calendar.add(Calendar.DAY_OF_MONTH, 1);
crit.andDate(GpsLocationPeer.LAST_UPDATE, calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH), Criteria.LESS_THAN);
This leads to a SQLException due to incorrect sql query creation.
That is easy to see with Criteria.toString()
Adding the missing method call solves the problem
Please, check the attached patch. Thank you |
Show » |
made changes - 12/Jul/06 06:30 PM
| Field |
Original Value |
New Value |
|
Attachment
|
|
Criteria-3.2.patch
[ 12336727
]
|
made changes - 14/Jul/06 03:58 AM
|
Assignee
|
|
Thomas Vandahl
[ tv
]
|
made changes - 14/Jul/06 03:59 AM
|
Fix Version/s
|
|
3.2.1
[ 12310991
]
|
|
Status
|
Open
[ 1
]
|
Resolved
[ 5
]
|
|
Fix Version/s
|
3.2
[ 12310881
]
|
|
|
Resolution
|
|
Fixed
[ 1
]
|
made changes - 26/Nov/06 06:23 PM
|
Status
|
Resolved
[ 5
]
|
Closed
[ 6
]
|
|