Merge fails for OffsetDateTime when offset is UTC (+00:00)

Lance Java via Hsqldb-user <[email protected]> Fri, 9 Jun 2023 16:42:47 +0100
Newsgroups gmane.comp.java.hsqldb.user
Message-ID <CAN7Z0vSPLz==upCyxYeNmGXh0vNSY8BWykgNRFUy_AbF1rCovg@mail.gmail.com>
--0000000000002f93fa05fdb43951
Content-Type: multipart/alternative; boundary="0000000000002f93f805fdb4394f"

--0000000000002f93f805fdb4394f
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

I=E2=80=99m having an issue with the following merge logic if I use an
OffsetDateTime with offset +00:00



    private static final String MERGE_SQL =3D

            "merge into sample t " +

            "using (select ? as code, ? as updated from dual) val " +

            "on (t.code =3D val.code) " +

            "when matched then update set t.updated =3D val.updated " +

            "when not matched then insert(code, updated) values (val.code,
val.updated)";



    private int merge(String code, OffsetDateTime updated) throws
SQLException {

        try (PreparedStatement statement =3D
connection.prepareStatement(MERGE_SQL)) {

            statement.setString(1, code);

            statement.setObject(2, updated, Types.TIMESTAMP_WITH_TIMEZONE);

            return statement.executeUpdate();

        }

    }



The merge statement works fine for all offsets except UTC (eg offset +01:00
works)

I think this is caused by the fact that toString() of an OffsetDateTime at
UTC has the Z suffix instead of +00:00

It seems that an INSERT statement does not have the same problem as MERGE



As a workaround I can do the following



    private static final DateTimeFormatter FORMATTER =3D new
DateTimeFormatterBuilder()

            .appendPattern("yyyy-MM-dd HH:mm:ss.SSS")

            .appendOffset("+HH:MM", "+00:00")

            .toFormatter();



    private int merge(String code, OffsetDateTime updated) throws
SQLException {

        try (PreparedStatement statement =3D
connection.prepareStatement(MERGE_SQL)) {

            statement.setString(1, code);

            statement.setString(2, FORMATTER.format(updated));

            return statement.executeUpdate();

        }

    }



Failing test attached, output below



=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D



2023-06-09 15:18:15.020 1 INSERT INTO SYSTEM_LOBS.BLOCKS VALUES(:0 ,:1 ,:2
) (0,2147483647,0)

2023-06-09 15:18:15.022 1 COMMIT

2023-06-09 15:18:15.024 2 COMMIT

2023-06-09 15:18:15.025 2 create table sample (code varchar2(50), updated
timestamp with time zone)

2023-06-09 15:18:15.025 2 COMMIT

2023-06-09 15:18:15.040 2 merge into sample t using (select :0  as code,
:1  as updated from dual) val on (t.code =3D val.code) when matched then
update set t.updated =3D val.updated when not matched then insert(code,
updated) values (val.code, val.updated) ('code1','2007-12-03
10:15:30+01:00')

2023-06-09 15:18:15.040 2 COMMIT

2023-06-09 15:18:15.041 2 merge into sample t using (select :0  as code,
:1  as updated from dual) val on (t.code =3D val.code) when matched then
update set t.updated =3D val.updated when not matched then insert(code,
updated) values (val.code, val.updated) ('code2','2007-12-03 10:15:30Z')

2023-06-09 15:18:15.041 2 ROLLBACK

2023-06-09 15:18:15.046 2 ROLLBACK



java.sql.SQLDataException: data exception: invalid datetime format



            at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)

            at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)

            at org.hsqldb.jdbc.JDBCPreparedStatement.fetchResult(Unknown
Source)

            at org.hsqldb.jdbc.JDBCPreparedStatement.executeUpdate(Unknown
Source)

            at
com.sample.DeletemeHsqlBugTest.merge(DeletemeHsqlBugTest.java:79)

            at
com.sample.DeletemeHsqlBugTest.testMerge(DeletemeHsqlBugTest.java:58)

            at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)

            =E2=80=A6

Caused by: org.hsqldb.HsqlException: data exception: invalid datetime forma=
t

            at org.hsqldb.error.Error.error(Unknown Source)

            at org.hsqldb.error.Error.error(Unknown Source)

            at
org.hsqldb.types.DateTimeType.convertToDatetimeSpecial(Unknown Source)

            at org.hsqldb.types.DateTimeType.convertToType(Unknown Source)

            at org.hsqldb.ExpressionOp.getValue(Unknown Source)

            at org.hsqldb.StatementDML.getInsertData(Unknown Source)

            at org.hsqldb.StatementDML.executeMergeStatement(Unknown Source=
)

            at org.hsqldb.StatementDML.getResult(Unknown Source)

            at org.hsqldb.StatementDMQL.execute(Unknown Source)

            at org.hsqldb.Session.executeCompiledStatement(Unknown Source)

            at org.hsqldb.Session.execute(Unknown Source)

            ... 73 more

--0000000000002f93f805fdb4394f
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto"><div class=3D"gmail_quote" dir=3D"auto"><div dir=3D"ltr" =
class=3D"gmail_attr"><span style=3D"font-family:Arial,sans-serif;font-size:=
10pt">I=E2=80=99m having an issue with the following merge logic if I use a=
n OffsetDateTime with offset +00:00</span><br></div><div lang=3D"EN-GB" lin=
k=3D"#0563C1" vlink=3D"#954F72" style=3D"word-wrap:break-word"><div class=
=3D"m_-2110861338389721347WordSection1">
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif"><u></u>=C2=A0<u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0 private static final String MERGE_=
SQL =3D<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 &quot;merge into sample t &quot; +<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 &quot;using (select ? as code, ? as updated from dual) val =
&quot; +<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0
</span><span lang=3D"FR" style=3D"font-size:10.0pt;font-family:&quot;Arial&=
quot;,sans-serif">&quot;on (t.code =3D val.code) &quot; +<u></u><u></u></sp=
an></p>
<p class=3D"MsoNormal"><span lang=3D"FR" style=3D"font-size:10.0pt;font-fam=
ily:&quot;Arial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0
</span><span style=3D"font-size:10.0pt;font-family:&quot;Arial&quot;,sans-s=
erif">&quot;when matched then update set t.updated =3D val.updated &quot; +=
<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 &quot;when not matched then insert(code, updated) values (v=
al.code, val.updated)&quot;;<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif"><u></u>=C2=A0<u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0 private int merge(String code, Off=
setDateTime updated) throws SQLException {<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 try (Prepa=
redStatement statement =3D connection.prepareStatement(MERGE_SQL)) {<u></u>=
<u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 statement.setString(1, code);<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 statement.setObject(2, updated, Types.TIMESTAMP_WITH_TIMEZO=
NE);<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 return statement.executeUpdate();<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }<u></u><u=
></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0 }<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif"><u></u>=C2=A0<u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">The merge statement works fine for all offsets except=
 UTC (eg offset +01:00 works)<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">I think this is caused by the fact that toString() of=
 an OffsetDateTime at UTC has the Z suffix instead of +00:00<u></u><u></u><=
/span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">It seems that an INSERT statement does not have the s=
ame problem as MERGE<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif"><u></u>=C2=A0<u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">As a workaround I can do the following<u></u><u></u><=
/span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif"><u></u>=C2=A0<u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0 private static final DateTimeForma=
tter FORMATTER =3D new DateTimeFormatterBuilder()<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 .appendPattern(&quot;yyyy-MM-dd HH:mm:ss.SSS&quot;)<u></u><=
u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 .appendOffset(&quot;+HH:MM&quot;, &quot;+00:00&quot;)<u></u=
><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 .toFormatter();<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif"><u></u>=C2=A0<u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0 private int merge(String code, Off=
setDateTime updated) throws SQLException {<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 try (Prepa=
redStatement statement =3D connection.prepareStatement(MERGE_SQL)) {<u></u>=
<u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 statement.setString(1, code);<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 statement.setString(2, FORMATTER.format(updated));<u></u><u=
></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 return statement.executeUpdate();<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }<u></u><u=
></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0 }<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif"><u></u>=C2=A0<u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">Failing test attached, output below<u></u><u></u></sp=
an></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif"><u></u>=C2=A0<u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif"><u></u>=C2=A0<u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">2023-06-09 15:18:15.020 1 INSERT INTO SYSTEM_LOBS.BLO=
CKS VALUES(:0 ,:1 ,:2 ) (0,2147483647,0)<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">2023-06-09 15:18:15.022 1 COMMIT
<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">2023-06-09 15:18:15.024 2 COMMIT
<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">2023-06-09 15:18:15.025 2 create table sample (code v=
archar2(50), updated timestamp with time zone)
<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">2023-06-09 15:18:15.025 2 COMMIT
<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">2023-06-09 15:18:15.040 2 merge into sample t using (=
select :0=C2=A0 as code, :1=C2=A0 as updated from dual) val on (t.code =3D =
val.code) when matched then update set t.updated =3D val.updated
 when not matched then insert(code, updated) values (val.code, val.updated)=
 (&#39;code1&#39;,&#39;2007-12-03 10:15:30+01:00&#39;)<u></u><u></u></span>=
</p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">2023-06-09 15:18:15.040 2 COMMIT
<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">2023-06-09 15:18:15.041 2 merge into sample t using (=
select :0=C2=A0 as code, :1=C2=A0 as updated from dual) val on (t.code =3D =
val.code) when matched then update set t.updated =3D val.updated
 when not matched then insert(code, updated) values (val.code, val.updated)=
 (&#39;code2&#39;,&#39;2007-12-03 10:15:30Z&#39;)<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">2023-06-09 15:18:15.041 2 ROLLBACK
<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">2023-06-09 15:18:15.046 2 ROLLBACK
<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif"><u></u>=C2=A0<u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">java.sql.SQLDataException: data exception: invalid da=
tetime format<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif"><u></u>=C2=A0<u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)<u>=
</u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)<u>=
</u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 at org.hsqldb.jdbc.JDBCPreparedStatement.fetchResult(Unknow=
n Source)<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 at org.hsqldb.jdbc.JDBCPreparedStatement.executeUpdate(Unkn=
own Source)<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 at com.sample.DeletemeHsqlBugTest.merge(DeletemeHsqlBugTest=
.java:79)<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 at com.sample.DeletemeHsqlBugTest.testMerge(DeletemeHsqlBug=
Test.java:58)<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.=
invoke0(Native Method)<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 =E2=80=A6</span><span style=3D"font-size:10.0pt;font-family=
:&quot;Arial&quot;,sans-serif"><u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">Caused by: org.hsqldb.HsqlException: data exception: =
invalid datetime format<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 at org.hsqldb.error.Error.error(Unknown Source)<u></u><u></=
u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 at org.hsqldb.error.Error.error(Unknown Source)<u></u><u></=
u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 at org.hsqldb.types.DateTimeType.convertToDatetimeSpecial(U=
nknown Source)<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 at org.hsqldb.types.DateTimeType.convertToType(Unknown Sour=
ce)<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 at org.hsqldb.ExpressionOp.getValue(Unknown Source)<u></u><=
u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 at org.hsqldb.StatementDML.getInsertData(Unknown Source)<u>=
</u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 at org.hsqldb.StatementDML.executeMergeStatement(Unknown So=
urce)<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 at org.hsqldb.StatementDML.getResult(Unknown Source)<u></u>=
<u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 at org.hsqldb.StatementDMQL.execute(Unknown Source)<u></u><=
u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 at org.hsqldb.Session.executeCompiledStatement(Unknown Sour=
ce)<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 at org.hsqldb.Session.execute(Unknown Source)<u></u><u></u>=
</span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif">=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 ... 73 more<u></u><u></u></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:&quot;Ar=
ial&quot;,sans-serif"><u></u>=C2=A0<u></u></span></p>
</div>

<p><br></p>

</div>

</div></div>

--0000000000002f93f805fdb4394f--
--0000000000002f93fa05fdb43951
Content-Type: application/ms-java; name="DeletemeHsqlBugTest.java"
Content-Disposition: attachment; filename="DeletemeHsqlBugTest.java"
Content-Transfer-Encoding: base64
Content-ID: <188a0d2575a2e7514331>
X-Attachment-Id: 188a0d2575a2e7514331

cGFja2FnZSBjb20uc2FtcGxlOw0KDQppbXBvcnQgb3JnLmp1bml0Lmp1cGl0ZXIuYXBpLkFmdGVy
RWFjaDsNCmltcG9ydCBvcmcuanVuaXQuanVwaXRlci5hcGkuQmVmb3JlRWFjaDsNCmltcG9ydCBv
cmcuanVuaXQuanVwaXRlci5hcGkuVGVzdDsNCg0KaW1wb3J0IGphdmEuc3FsLio7DQppbXBvcnQg
amF2YS50aW1lLk9mZnNldERhdGVUaW1lOw0KaW1wb3J0IGphdmEudXRpbC5BcnJheUxpc3Q7DQpp
bXBvcnQgamF2YS51dGlsLkxpc3Q7DQoNCmltcG9ydCBzdGF0aWMgb3JnLmFzc2VydGouY29yZS5h
cGkuQXNzZXJ0aW9ucy5hc3NlcnRUaGF0Ow0KDQpwdWJsaWMgY2xhc3MgRGVsZXRlbWVIc3FsQnVn
VGVzdCB7DQogICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgU3RyaW5nIENSRUFURV9UQUJMRV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0U3RyaW5nKCJjb2RlIiksIHJzLmdldE9iamVjdCgidXBkYXRl
ZCIsIE9mZnNldERhdGVUaW1lLmNsYXNzKSkpOw0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAg
cmV0dXJuIHJvd3M7DQogICAgICAgIH0NCiAgICB9DQoNCiAgICBwdWJsaWMgc3RhdGljIGNsYXNz
IFNhbXBsZSB7DQogICAgICAgIHByaXZhdGUgU3RyaW5nIGNvZGU7DQogICAgICAgIHByaXZhdGUg
T2Zmc2V0RGF0ZVRpbWUgdXBkYXRlZDsNCg0KICAgICAgICBwdWJsaWMgU2FtcGxlKFN0cmluZyBj
b2RlLCBPZmZzZXREYXRlVGltZSB1cGRhdGVkKSB7DQogICAgICAgICAgICB0aGlzLmNvZGUgPSBj
b2RlOw0KICAgICAgICAgICAgdGhpcy51cGRhdGVkID0gdXBkYXRlZDsNCiAgICAgICAgfQ0KDQog
ICAgICAgIHB1YmxpYyBTdHJpbmcgZ2V0Q29kZSgpIHsNCiAgICAgICAgICAgIHJldHVybiBjb2Rl
Ow0KICAgICAgICB9DQoNCiAgICAgICAgcHVibGljIE9mZnNldERhdGVUaW1lIGdldFVwZGF0ZWQo
KSB7DQogICAgICAgICAgICByZXR1cm4gdXBkYXRlZDsNCiAgICAgICAgfQ0KICAgIH0NCn0NCg==
--0000000000002f93fa05fdb43951
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--0000000000002f93fa05fdb43951
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Hsqldb-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hsqldb-user

--0000000000002f93fa05fdb43951--