You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Sylvain Lebresne (JIRA)" <ji...@apache.org> on 2012/07/16 19:05:36 UTC
[jira] [Created] (CASSANDRA-4441) Fix validation of dates
Sylvain Lebresne created CASSANDRA-4441:
-------------------------------------------
Summary: Fix validation of dates
Key: CASSANDRA-4441
URL: https://issues.apache.org/jira/browse/CASSANDRA-4441
Project: Cassandra
Issue Type: Bug
Reporter: Sylvain Lebresne
Assignee: Sylvain Lebresne
Priority: Minor
Fix For: 1.1.3
Our date validation (timestamp type) doesn't validate that the date is correct, i.e. it allows dates like 2011-42-42, because DateUtils.parseDate() doesn't do the validation (don't ask me how it can generate a timestamp from bogus date, apparently it can).
The easy fix is to use DateUtils.parseDateStrictly(), which does the validation. This does require to update commons-lang to >= 2.5 (we have 2.4).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CASSANDRA-4441) Fix validation of dates
Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-4441?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13415404#comment-13415404 ]
Jonathan Ellis commented on CASSANDRA-4441:
-------------------------------------------
+1, but I'd rather push this to 1.2 only, since DateType has behaved this way since 0.8.
> Fix validation of dates
> -----------------------
>
> Key: CASSANDRA-4441
> URL: https://issues.apache.org/jira/browse/CASSANDRA-4441
> Project: Cassandra
> Issue Type: Bug
> Affects Versions: 1.1.2
> Reporter: Sylvain Lebresne
> Assignee: Sylvain Lebresne
> Priority: Minor
> Fix For: 1.1.3
>
> Attachments: 4441.txt
>
>
> Our date validation (timestamp type) doesn't validate that the date is correct, i.e. it allows dates like 2011-42-42, because DateUtils.parseDate() doesn't do the validation (don't ask me how it can generate a timestamp from bogus date, apparently it can).
> The easy fix is to use DateUtils.parseDateStrictly(), which does the validation. This does require to update commons-lang to >= 2.5 (we have 2.4).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CASSANDRA-4441) Fix validation of dates
Posted by "Sylvain Lebresne (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CASSANDRA-4441?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sylvain Lebresne updated CASSANDRA-4441:
----------------------------------------
Attachment: 4441.txt
Attached trivial patch. As said this require commons-lang 2.6 (which I'll add when committing)
> Fix validation of dates
> -----------------------
>
> Key: CASSANDRA-4441
> URL: https://issues.apache.org/jira/browse/CASSANDRA-4441
> Project: Cassandra
> Issue Type: Bug
> Affects Versions: 1.1.2
> Reporter: Sylvain Lebresne
> Assignee: Sylvain Lebresne
> Priority: Minor
> Fix For: 1.1.3
>
> Attachments: 4441.txt
>
>
> Our date validation (timestamp type) doesn't validate that the date is correct, i.e. it allows dates like 2011-42-42, because DateUtils.parseDate() doesn't do the validation (don't ask me how it can generate a timestamp from bogus date, apparently it can).
> The easy fix is to use DateUtils.parseDateStrictly(), which does the validation. This does require to update commons-lang to >= 2.5 (we have 2.4).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira