Bug with date conversion
Massimiliano Campagnoli <[email protected]>
| Newsgroups | gmane.lisp.clsql.devel |
|---|---|
| Organization | PAOLO ASTORI SRL |
| Message-ID | <[email protected]> |
CLSQL has a bug in managing date field.
Look at the different behaviour between two queries typed directly via
db2 command line and via CLSQL
On the db2 command line:
1) DB2 SELECT DATE(DATALANCIO) FROM LOTTI WHERE CODICELOTTO=8100
1
----------
31/07/1998
1 record(s) selected.
2) DB2 SELECT CHAR(DATALANCIO,ISO) FROM LOTTI WHERE CODICELOTTO=8100
1
----------
1998-07-31
1 record(s) selected.
Instead, query 1) using CLSQL gives out an error:
* (CLSQL:QUERY "SELECT DATALANCIO FROM LOTTI WHERE CODICELOTTO=8100")
Type-error in KERNEL::OBJECT-NOT-TYPE-ERROR-HANDLER:
98 is not of type (INTEGER 1 31)
[Condition of type TYPE-ERROR]
Restarts:
0: [ABORT] Return to Top-Level.
Debug (type H for help)
(ENCODE-UNIVERSAL-TIME 6 0 0 0 ...)[:EXTERNAL]
Source: Error finding source:
Error in function DEBUG::GET-FILE-TOP-LEVEL-FORM: Source file no longer
exists:
target:code/time.lisp.
0]
But query 2) that cast the date field to ISO format works ok:
* (CLSQL:QUERY "SELECT CHAR(DATALANCIO,ISO) FROM LOTTI WHERE
CODICELOTTO=8100")
(("1998-07-31"))
("1")
*