ibatis-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Butler (JIRA)" <ibatis-...@incubator.apache.org>
Subject [jira] Commented: (IBATIS-282) truncation of date property values in the presence of dynamic sql
Date Fri, 02 Jun 2006 01:53:33 GMT
    [ http://issues.apache.org/jira/browse/IBATIS-282?page=comments#action_12414338 ] 

Jeff Butler commented on IBATIS-282:
------------------------------------

I can't get this to fail in any combination of java.util.Date and java.sql.Date.  Are you
actually experiencing an error, or just wierdness in the driver logging?  Maybe you called
it in the first case with java.util.Date and in the second case with java.sql.Date?  That
would explain it.

If you experiencing an error, please provide more details:

- What database and driver
- SQL Map
- DDL for the table you are accessing
- Java code for the parameter object, result object, and the code that executes the select
statement


> truncation of date property values in the presence of dynamic sql
> -----------------------------------------------------------------
>
>          Key: IBATIS-282
>          URL: http://issues.apache.org/jira/browse/IBATIS-282
>      Project: iBatis for Java
>         Type: Bug

>   Components: SQL Maps
>     Versions: 2.1.7
>  Environment: linux, mysql, java 1.5
>     Reporter: z. zhong
>  Attachments: test.zip
>
> strange interaction between Java.util.Date parameters and dynamic sql.
> query 1:
>     select
>         ...
>     where
>          ...
>          and rd.event_time       &lt;= #endTime#
> the generated SQL is
>         ...
>         and rd.event_time       <= '2006-03-30 18:33:46'
>         
> so far so good.
> query 2:
> just add an extra dynamic sql at the end:
>     select
>         ...
>     where
>          ...
>                  and rd.event_time       &lt;= #endTime#
>                   <iterate prepend="and" property="done" open=" rd.is_complete in
(" conjunction="," close = ")">#done[]#</iterate>
>         
> and the SQL becomes
>         ...
>         and rd.event_time       <= '2006-03-30'
>         and ...
> The date value has been truncated.
> Notes:
> * i've tried other dynamic sql elements: isNotEmpty, etc., and got the same problem.
> * insert seems to work.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message