Bug 34378 - Date math on select with mysql jstl SQL tags not converted correctl
Summary: Date math on select with mysql jstl SQL tags not converted correctl
Status: RESOLVED INVALID
Alias: None
Product: Taglibs
Classification: Unclassified
Component: Standard Taglib (show other bugs)
Version: 1.2.0
Hardware: Other other
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL: http://dax.shecora.com:8080/CanopySta...
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-08 22:22 UTC by Darryl Wagoner
Modified: 2006-12-27 16:57 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Darryl Wagoner 2005-04-08 22:22:55 UTC
Not sure if this is the correct location for this bug.

The sql command is:

select ap,name,date_format(dtg,'%c/%d %h %p') as hr, 
max(session_cnt)- min(session_cnt) as scnt,
max(reg_cnt)- min(reg_cnt) as rcnt, 
max(re_reg_cnt)- min(re_reg_cnt) as recnt 
from reading
where mac = '0a-00-3e-90-22-0d' group by name,hr order by hr desc

which create output like:
     <tr>
        <td>Hilltop AP</td>
	<td> Hoffman Family</td>

	<td align="left">[B@4e8edc</td>
	<td align="right">0</td>
	<td align="right">0</td>
	<td align="right">0</td>
     </tr>
   
     <tr>
        <td>Hilltop AP</td>

	<td> Hoffman Family</td>
	<td align="left">[B@1854b38</td>
	<td align="right">0</td>
	<td align="right">0</td>
	<td align="right">0</td>
     </tr>
Comment 1 Rahul Akolkar 2005-09-24 17:40:20 UTC
Seems the component was incorrectly marked as DBTags (instead of Standard).
Comment 2 Henri Yandell 2006-12-27 16:57:57 UTC
I don't understand the date_format(..) giving a [B@4e8edc here. That function
turns a date into a varchar in the db, and I don't get why it's not being mapped
happily to a String.

I've tested it using the latest JDBC driver from mysql.com and the version of
mysql on my dev box and it works fine for me.

Regardless, that doesn't seem to mesh with the bug report which talks about
'Date math' not being converted correctly. I don't know if that's talking about
the various max(session_cnt) - min(session_cnt) bits.  Seems odd as I'd have
presumed '_cnt' meant a count of some kind.

If I use a select statement of:

select max(dt) - min(dt) from Bug34378;

on a datetime column, the answer comes back in terms of years. So if this report
is concerning the various max minus min statements, a 0 just means it's less
than a year.

Closing this as INVALID (unless someone supplies more information).