The following sql gives invalid sql after the statement is re-written by H2
version 1.4.187:
select * from (select * from values(0, null, null, null), ( null, 0.11,
null, null), (null, null, 1.11, null), (null, null, null, 0.00));
Invalid value "2" for parameter "scale (precision = 1)"; SQL statement:
SELECT
TABLE.C1,
TABLE.C2,
TABLE.C3,
TABLE.C4
FROM TABLE(C1 INTEGER=(0, NULL, NULL, NULL), C2 DECIMAL(2, 2)=(NULL, 0.11,
NULL, NULL), C3 DECIMAL(3, 2)=(NULL, NULL, 1.11, NULL), C4 DECIMAL(1,
2)=(NULL, NULL, NULL, 0.00)) [90008-187]
<http://192.168.1.22:8082/query.do?jsessionid=ddbac194acd372b19dfc8c1758819605#>
90008/90008 (Help)
<http://h2database.com/javadoc/org/h2/constant/ErrorCode.html#c90008>
Column C4 is giving the error, but column C2 is wrong too - it should be
(3,2). As far as I can tell the re-write is ignoring leading zero in the
values clauses.
The outer select seems to force the inner re-write to a table definition,
which then fails. Although the test case is artificial it accurately
reflects a query pattern used in my product when generating SQL dynamically
from metadata.
Cheers,
Ian.
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.