dynamobi/dynamobi — Issue #738: [FRG-133] Casting from Date, Time, and Timestamp to bigint should give reasonable error message (not TunnelException)
Author: dynamobi-build
Created: 2011-12-30 03:46:16+00:00
State: closed
Labels: FRG, SQL Validator

[reporter="angel", created="Sun, 21 May 2006 23:33:17 -0500 (GMT-05:00)"]
Farrago gives a TunnelException when casting from Date, Time, and Timestamp to bigint.

0: jdbc:farrago:> values cast(current_timestamp as bigint);

Error: org.codehaus.janino.util.TunnelException: org.codehaus.janino.util.TunnelException: File /home/angel/dt/farrago/./classes/net/sf/farrago/dynamic/stmt3791/ExecutableStmt.java, Line 77, Column 33: Cannot compare types "net.sf.farrago.dynamic.stmt3791.ExecutableStmt$Oj_inner_0" and "long" (state=,code=0)

Casting from datetime types to bigint should not be allowed, there should be an error message similar to:

0: jdbc:farrago:> values cast(current_timestamp as integer);

Error: Cast function cannot convert value of type TIMESTAMP(0) to type INTEGER (state=,code=0)