View Issue Details

IDProjectCategoryView StatusLast Update
0006347SymmetricDSBugpublic2024-04-22 21:00
Reporterotaburiaux Assigned Toelong  
Prioritynormal 
Status resolvedResolutionfixed 
Product Version3.15.2 
Target Version3.15.6Fixed in Version3.15.6 
Summary0006347: Support SQLServer float positive negative infinity value
DescriptionFloat positive negative infinity value throw an exception while being loaded into an SQLServer DB.

- Workaround by using column transform:
insert into sym_transform_column
(transform_id, include_on, target_column_name, source_column_name, pk,
transform_type, transform_expression,
transform_order, last_update_time, create_time)
values('XXX', '*', 'Speed', 'Speed', 0,
'bsh', 'if (Double.parseDouble(currentValue) == Double.POSITIVE_INFINITY) {
    return 1.7976931348623157E+308;
} else if (Double.parseDouble(currentValue) == Double.NEGATIVE_INFINITY) {
    return -1.7976931348623157E+308;
} else if (Float.parseFloat(currentValue) == Float.POSITIVE_INFINITY) {
    return 3.4028234663852886E+38;
} else if (Float.parseFloat(currentValue) == Float.NEGATIVE_INFINITY) {
    return -3.4028234663852886E+38;
} else {
    return currentValue;
}',
0, current_timestamp, current_timestamp
);



- Exception using JTDS: data truncation
- Exception using Microsoft mssql-jdbc: Arithmetic overflow error converting expression to data type float.

[region-101] - DefaultDatabaseWriter - Failed to process insert event in batch 000-248 on channel 'reload'.
Failed sql was: insert into "region-101"."dbo"."XXX" ("Id", "Speed") values ('473D0733-2B3D-DC86-AA1B-011DC4B7349B','1.797693134862316e+308')
Failed raw sql was: insert into "region-101"."dbo"."XXX" ("Id", "Speed") values (?,?)
Failed sql parameters: ['473D0733-2B3D-DC86-AA1B-011DC4B7349B', '1.797693134862316e+308']
Failed sql parameters types: [CHAR, VARCHAR]
Failed sql state and code: S0002 (8115)
Failed row data was: "473D0733-2B3D-DC86-AA1B-011DC4B7349B","1.797693134862316e+308"
org.jumpmind.db.sql.SqlException: Arithmetic overflow error converting expression to data type float.
        at org.jumpmind.db.sql.AbstractSqlTemplate.translate(AbstractSqlTemplate.java:308)
        at org.jumpmind.db.sql.AbstractSqlTemplate.translate(AbstractSqlTemplate.java:297)
        at org.jumpmind.db.sql.JdbcSqlTransaction.addRow(JdbcSqlTransaction.java:443)
        at org.jumpmind.symmetric.io.data.writer.DefaultDatabaseWriter.execute(DefaultDatabaseWriter.java:1183)
        at org.jumpmind.symmetric.io.data.writer.DefaultDatabaseWriter.insert(DefaultDatabaseWriter.java:265)
        at org.jumpmind.symmetric.io.data.writer.AbstractDatabaseWriter.write(AbstractDatabaseWriter.java:185)
        at org.jumpmind.symmetric.io.data.writer.NestedDataWriter.write(NestedDataWriter.java:62)
        at org.jumpmind.symmetric.model.ProcessInfoDataWriter.write(ProcessInfoDataWriter.java:84)
        at org.jumpmind.symmetric.io.data.writer.NestedDataWriter.write(NestedDataWriter.java:62)
        at org.jumpmind.symmetric.io.data.writer.TransformWriter.write(TransformWriter.java:186)
        at org.jumpmind.symmetric.io.data.DataProcessor.forEachDataInTable(DataProcessor.java:194)
        at org.jumpmind.symmetric.io.data.DataProcessor.forEachTableInBatch(DataProcessor.java:160)
        at org.jumpmind.symmetric.io.data.DataProcessor.process(DataProcessor.java:108)
        at org.jumpmind.symmetric.service.impl.DataLoaderService$LoadIntoDatabaseOnArrivalListener$2.call(DataLoaderService.java:1072)
        at org.jumpmind.symmetric.service.impl.DataLoaderService$LoadIntoDatabaseOnArrivalListener$2.call(DataLoaderService.java:1048)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Arithmetic overflow error converting expression to data type float.
        at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:265)
        at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1676)
        at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:615)
        at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:537)
        at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7785)
        at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:3793)
        at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:268)
        at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:242)
        at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeUpdate(SQLServerPreparedStatement.java:483)
        at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:136)
        at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:136)
        at org.jumpmind.db.sql.JdbcSqlTransaction.executePreparedUpdate(JdbcSqlTransaction.java:462)
        at org.jumpmind.db.sql.JdbcSqlTransaction.addRow(JdbcSqlTransaction.java:440)
        ... 16 more
Tagsdata type, dialect: sql-server

Relationships

related to 0002644 closedchenson Large float values fail to load on Sql Server 

Activities

There are no notes attached to this issue.

Related Changesets

SymmetricDS: 3.15 1ef1dc20

2024-04-22 20:19:12

admin

Details Diff
0006347: Support SQLServer float positive negative infinity value Affected Issues
0006347
mod - symmetric-client/src/main/java/org/jumpmind/symmetric/db/mssql/MsSql2016TriggerTemplate.java Diff File
mod - symmetric-client/src/main/java/org/jumpmind/symmetric/db/mssql/MsSqlTriggerTemplate.java Diff File
mod - symmetric-db/src/main/java/org/jumpmind/db/platform/mssql/MsSqlDmlStatement.java Diff File

Issue History

Date Modified Username Field Change
2024-04-16 12:30 otaburiaux New Issue
2024-04-16 12:30 otaburiaux Tag Attached: data type
2024-04-16 12:30 otaburiaux Tag Attached: dialect: sql-server
2024-04-22 20:10 elong Relationship added related to 0002644
2024-04-22 20:10 elong Assigned To => elong
2024-04-22 20:10 elong Status new => assigned
2024-04-22 20:10 elong Target Version => 3.15.6
2024-04-22 20:19 elong Status assigned => resolved
2024-04-22 20:19 elong Resolution open => fixed
2024-04-22 20:19 elong Fixed in Version => 3.15.6
2024-04-22 21:00 admin Changeset attached => SymmetricDS 3.15 1ef1dc20