[reporter="jvs", created="Wed, 22 Mar 2006 12:36:07 -0500 (GMT-05:00)"]
Instead, you have to use cast(x as integer). The reason is that SqlDataType.deriveType relies on SqlTypeName for the list of supported types, which is wrong. It should be relying on the catalog, same as CREATE TABLE. The code we need is in DdlValidator.findSqlDataType. Obviously, SqlDataType can't call to this Farrago code; it will need to call indirectly via a virtual method in SqlValidator instead. However, DdlValidator won't be available while validating a non-DDL statement. So we need to share the lookup method with FarragoPreparingStmt. (As a matter of fact, a bunch of stuff should be shared between DdlValidator and FarragoPreparingStmt, so now might be a good time to set that up.)
[reporter="jvs", created="Wed, 22 Mar 2006 12:36:07 -0500 (GMT-05:00)"] Instead, you have to use cast(x as integer). The reason is that SqlDataType.deriveType relies on SqlTypeName for the list of supported types, which is wrong. It should be relying on the catalog, same as CREATE TABLE. The code we need is in DdlValidator.findSqlDataType. Obviously, SqlDataType can't call to this Farrago code; it will need to call indirectly via a virtual method in SqlValidator instead. However, DdlValidator won't be available while validating a non-DDL statement. So we need to share the lookup method with FarragoPreparingStmt. (As a matter of fact, a bunch of stuff should be shared between DdlValidator and FarragoPreparingStmt, so now might be a good time to set that up.)