HSQL升级到1.8:... DEFAULT'NaN'更改为... database.script中的DEFAULT 0E0 / 0E0导致HsqlException:HSQL 2.3.2中的意外令牌/

时间:2021-02-27 22:56:43

I have an application using HSQL 1.7.2 that contains table definitions with default values of NaN for some of the DOUBLE columns. After issuing, with 1.7.2,

我有一个使用HSQL 1.7.2的应用程序,它包含一些DOUBLE列的默认值为NaN的表定义。发布后,用1.7.2,

SET SCRIPTFORMAT TEXT
SHUTDOWN SCRIPT

the following appears in the database.script file:

database.Script文件中出现以下内容:

CREATE TABLE ... DOUBLE DEFAULT 'NaN' NOT NULL ...

I'm attempting to upgrade to HSQL 2.3.2, but I first have to upgrade to 1.8. I'm finding that after the upgrade to 1.8, the database.script file has:

我正在尝试升级到HSQL 2.3.2,但我首先要升级到1.8。我发现在升级到1.8之后,database.script文件具有:

CREATE TABLE ... DOUBLE DEFAULT 0E0/0E0 NOT NULL ...

When I open this database with HSQL 2.3.2, I get "SQLException: error in script file line ..." on the line at which "/" first appears. The traceback includes "Caused by: org.hsqldb.HsqlException: unexpected token: /".

当我用HSQL 2.3.2打开这个数据库时,我在“/”首次出现的行上得到“SQLException:脚本文件行中的错误...”。回溯包括“由以下原因引起:org.hsqldb.HsqlException:意外令牌:/”。

I've messed around a lot with double_nan=false, without success.

我用double_nan = false搞砸了很多,没有成功。

Does anybody have any suggestions for me?

有人对我有什么建议吗?

1 个解决方案

#1


1  

Support for NaN as default value was dropped in version 2.x. This will be restored in the next update.

版本2.x中删除了对NaN作为默认值的支持。这将在下次更新时恢复。

For the time being, change the default to NULL and add a TRIGGER on the table to convert NULL entries to NaN.

暂时将默认值更改为NULL并在表上添加TRIGGER以将NULL条目转换为NaN。

The property hsqldb.double_nan=false must be specified or the statement SET DATABASE SQL DOUBLE NAN FALSE executed for the database to accept the NaN data values .

必须指定属性hsqldb.double_nan = false,或者为数据库执行语句SET DATABASE SQL DOUBLE NAN FALSE以接受NaN数据值。

#1


1  

Support for NaN as default value was dropped in version 2.x. This will be restored in the next update.

版本2.x中删除了对NaN作为默认值的支持。这将在下次更新时恢复。

For the time being, change the default to NULL and add a TRIGGER on the table to convert NULL entries to NaN.

暂时将默认值更改为NULL并在表上添加TRIGGER以将NULL条目转换为NaN。

The property hsqldb.double_nan=false must be specified or the statement SET DATABASE SQL DOUBLE NAN FALSE executed for the database to accept the NaN data values .

必须指定属性hsqldb.double_nan = false,或者为数据库执行语句SET DATABASE SQL DOUBLE NAN FALSE以接受NaN数据值。