dynamobi/dynamobi — Issue #328: [EXT-10] convert_date() function takes invalid inputs
Author: dynamobi-build
Created: 2011-12-30 02:31:17+00:00
State: open
Labels: Applib, EXT

[reporter="ksecretan", created="Mon, 6 Jun 2011 15:26:39 -0500 (GMT-05:00)"]
1. Existing version supports month name only if the mask is 'MON-DD-YYYY', not 'MMM-DD-YYYY'

2. Following queries run and return wrapped-around date data

-- non leap years feb 29

values applib.convert_date('02-29-1900', 'MM-DD-YYYY');

values applib.convert_date('02-29-1901', 'MM-DD-YYYY');

-- other invalid dates

values applib.convert_date('01-32-1998', 'MM-DD-YYYY');

values applib.convert_date('02-30-1998', 'MM-DD-YYYY');

values applib.convert_date('04-31-1998', 'MM-DD-YYYY');

-- invalid months

values applib.convert_date('00-29-1900', 'MM-DD-YYYY');

values applib.convert_date('13-29-1900', 'MM-DD-YYYY');

-- invalid years

values applib.convert_date('01-23-0000', 'MM-DD-YYYY');

values applib.convert_date('00-00-0000', 'MM-DD-YYYY');

values applib.convert_date('00-00-00', 'MM-DD-YY');

-- trace:

0: jdbc:luciddb:> -- non leap years feb 29

0: jdbc:luciddb:> values applib.convert_date('02-29-1900', 'MM-DD-YYYY');

+-------------+

| EXPR$0 |

+-------------+

| 1900-03-01 |

+-------------+

1 row selected (1.03 seconds)

0: jdbc:luciddb:> values applib.convert_date('02-29-1901', 'MM-DD-YYYY');

+-------------+

| EXPR$0 |

+-------------+

| 1901-03-01 |

+-------------+

1 row selected (0.365 seconds)

0: jdbc:luciddb:> -- other invalid dates

0: jdbc:luciddb:> values applib.convert_date('01-32-1998', 'MM-DD-YYYY');

+-------------+

| EXPR$0 |

+-------------+

| 1998-02-01 |

+-------------+

1 row selected (0.37 seconds)

0: jdbc:luciddb:> values applib.convert_date('02-30-1998', 'MM-DD-YYYY');

+-------------+

| EXPR$0 |

+-------------+

| 1998-03-02 |

+-------------+

1 row selected (0.361 seconds)

0: jdbc:luciddb:> values applib.convert_date('04-31-1998', 'MM-DD-YYYY');

+-------------+

| EXPR$0 |

+-------------+

| 1998-05-01 |

+-------------+

1 row selected (0.337 seconds)

0: jdbc:luciddb:> -- invalid months

0: jdbc:luciddb:> values applib.convert_date('00-29-1900', 'MM-DD-YYYY');

+-------------+

| EXPR$0 |

+-------------+

| 1899-12-29 |

+-------------+

1 row selected (0.371 seconds)

0: jdbc:luciddb:> values applib.convert_date('13-29-1900', 'MM-DD-YYYY');

+-------------+

| EXPR$0 |

+-------------+

| 1901-01-29 |

+-------------+

1 row selected (0.345 seconds)

0: jdbc:luciddb:> -- invalid years

0: jdbc:luciddb:> values applib.convert_date('01-23-0000', 'MM-DD-YYYY');

+-------------+

| EXPR$0 |

+-------------+

| 0001-01-23 |

+-------------+

1 row selected (0.317 seconds)

0: jdbc:luciddb:>

0: jdbc:luciddb:> values applib.convert_date('00-00-0000', 'MM-DD-YYYY');

+-------------+

| EXPR$0 |

+-------------+

| 0002-11-30 |

+-------------+

1 row selected (0.322 seconds)

0: jdbc:luciddb:> values applib.convert_date('00-00-00', 'MM-DD-YY');

+-------------+

| EXPR$0 |

+-------------+

| 1899-11-30 |

+-------------+

1 row selected (0.301 seconds)