View Issue Details

IDProjectCategoryView StatusLast Update
0002530SymmetricDSBugpublic2023-10-03 23:00
Reportertregnago Assigned ToJishLong  
Priorityhigh 
Status closedResolutionfixed 
Product Version3.7.15 
Target Version3.15.0Fixed in Version3.15.0 
Summary0002530: postgresql infinity timestamp
DescriptionPostgresql triggers, using infinity timestamp values, produces null row_data and old_data.
Plpgsql code used in triggers concatenates strings by pipes. Starting with PostgreSQL 9.1 if one element is NULL the entire string returned is NULL.
This happens when the to_char function with an infinite timestamp value returns NULL.

For example:
...
case when new."datanascita" is null then '' else '"' || to_char(new."datanascita", 'YYYY-MM-DD HH24:MI:SS.US') || '"' end||','||
...

If new."datanascita" is infinite to_char() returns NULL so the entire string becomes NULL.
Steps To Reproducetry this simple query:
select to_char('infinity'::timestamp, 'YYYY-MM-DD HH24:MI:SS.US')||','
Tagsdata type, dialect: postgresql

Relationships

related to 0001132 closed Support Postgres Special Floating Point Values Infinity, -Infinity, NaN 

Activities

danishoji

2016-04-04 15:20

reporter   ~0000774

Last edited: 2016-04-04 15:29

View 4 revisions

Iam having the same issue in last version 3.7.31
With this bug i cant use Symmetricds.

Steps To Reproduce

CREATE TABLE test
(
  cod integer primary key,
  datestart timestamp without time zone
);

INSERT INTO test(cod , datestart)
Values (1, '-infinity');

2016-04-04 12:25:32,732 ERROR [Servidor] [DataExtractorService] [qtp7053484-13] Failed to extract batch 001-9
java.lang.NullPointerException
    at org.jumpmind.symmetric.io.data.writer.StagingDataWriter.print(StagingDataWriter.java:111)
    at org.jumpmind.symmetric.io.data.writer.AbstractProtocolDataWriter.println(AbstractProtocolDataWriter.java:252)
    at org.jumpmind.symmetric.io.data.writer.AbstractProtocolDataWriter.write(AbstractProtocolDataWriter.java:161)
    at org.jumpmind.symmetric.io.data.writer.NestedDataWriter.write(NestedDataWriter.java:64)
    at org.jumpmind.symmetric.model.ProcessInfoDataWriter.write(ProcessInfoDataWriter.java:65)
    at org.jumpmind.symmetric.io.data.writer.NestedDataWriter.write(NestedDataWriter.java:64)
    at org.jumpmind.symmetric.io.data.writer.TransformWriter.write(TransformWriter.java:204)
    at org.jumpmind.symmetric.io.data.DataProcessor.forEachDataInTable(DataProcessor.java:200)
    at org.jumpmind.symmetric.io.data.DataProcessor.forEachTableInBatch(DataProcessor.java:170)
    at org.jumpmind.symmetric.io.data.DataProcessor.process(DataProcessor.java:116)
    at org.jumpmind.symmetric.service.impl.DataExtractorService.extractOutgoingBatch(DataExtractorService.java:747)
    at org.jumpmind.symmetric.service.impl.DataExtractorService.extract(DataExtractorService.java:545)
    at org.jumpmind.symmetric.service.impl.DataExtractorService.extract(DataExtractorService.java:455)
    at org.jumpmind.symmetric.web.PullUriHandler.pull(PullUriHandler.java:121)
    at org.jumpmind.symmetric.web.PullUriHandler.handleWithCompression(PullUriHandler.java:92)
    at org.jumpmind.symmetric.web.AbstractCompressionUriHandler.handle(AbstractCompressionUriHandler.java:84)
    at org.jumpmind.symmetric.web.SymmetricServlet.service(SymmetricServlet.java:103)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:808)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
    at org.eclipse.jetty.server.Server.handle(Server.java:499)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
    at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
    at java.lang.Thread.run(Unknown Source)


select * from sym_data where table_name = 'test'

"data_id";"table_name";"event_type";"row_data";"pk_data";"old_data";"trigger_hist_id";"channel_id";"transaction_id";"source_node_id";"external_data";"node_list";"create_time"
8;"test";"I";"";"";"";52;"gaic_channel";"288071";"";"";"";"2016-04-04 12:11:51.521"

Related Changesets

SymmetricDS: 3.15 335d6b80

2023-05-31 18:55:17

JishLong

Details Diff
0002530: postgresql infinity timestamp Affected Issues
0002530
mod - symmetric-client/src/main/java/org/jumpmind/symmetric/db/postgresql/PostgreSqlTriggerTemplate.java Diff File
mod - symmetric-core/src/main/java/org/jumpmind/symmetric/common/ParameterConstants.java Diff File
mod - symmetric-core/src/main/resources/symmetric-default.properties Diff File
mod - symmetric-db/src/main/java/org/jumpmind/db/platform/AbstractDatabasePlatform.java Diff File
mod - symmetric-db/src/main/java/org/jumpmind/db/platform/DatabaseInfo.java Diff File
mod - symmetric-db/src/main/java/org/jumpmind/db/sql/SqlConstants.java Diff File
mod - symmetric-jdbc/src/main/java/org/jumpmind/db/platform/postgresql/PostgreSqlDatabasePlatform.java Diff File

Issue History

Date Modified Username Field Change
2016-03-22 15:28 tregnago New Issue
2016-04-04 15:20 danishoji Note Added: 0000774
2016-04-04 15:28 danishoji Note Edited: 0000774 View Revisions
2016-04-04 15:29 danishoji Note Edited: 0000774 View Revisions
2016-04-04 15:29 danishoji Note Edited: 0000774 View Revisions
2016-04-04 18:09 danishoji Tag Attached: postgresql
2019-04-23 20:50 admin Tag Renamed postgresql => dialect: postgresql
2019-04-23 23:37 elong Tag Attached: data type
2023-05-30 15:36 elong Assigned To => JishLong
2023-05-30 15:36 elong Status new => assigned
2023-05-30 15:36 elong Target Version => 3.15.0
2023-05-31 18:57 JishLong Status assigned => resolved
2023-05-31 18:57 JishLong Resolution open => fixed
2023-06-20 20:10 elong Relationship added related to 0001132
2023-10-01 23:46 admin Status resolved => closed
2023-10-03 23:00 JishLong Changeset attached => SymmetricDS 3.15 335d6b80