View Issue Details

IDProjectCategoryView StatusLast Update
0005593SymmetricDSBugpublic2023-01-31 13:42
Reportercquamme Assigned Tocquamme  
Prioritynormal 
Status closedResolutionfixed 
Product Version3.14.3 
Target Version3.14.5Fixed in Version3.14.5 
Summary0005593: Incorrect Logic in various DDLBuilders for Processing Changes
DescriptionIn the DDLBuilders for Firebird, Oracle, Postgres, and Tibero, there is some incorrect logic when determining processing of changes that occur in the database, that results in attempting to allow primary keys to be made null, which results in a SQL error in the log.

2023-01-25 10:54:58,083 INFO [client-pg] [PostgreSql95DatabasePlatform] [client-pg-dataloader-7] Running alter sql:
ALTER TABLE "public"."customer"
     ALTER COLUMN "_id" DROP NOT NULL ;

2023-01-25 10:54:58,085 WARN [client-pg] [JdbcSqlTemplate] [client-pg-dataloader-7] ERROR: column "_id" is in a primary key. Failed to execute: ALTER TABLE "public"."customer"
     ALTER COLUMN "_id" DROP NOT NULL
2023-01-25 10:54:58,109 ERROR [client-pg] [ManageIncomingBatchListener] [client-pg-dataloader-7] Failed to load batch mngo-30 org.jumpmind.db.sql.SqlException: ERROR: column "_id" is in a primary key
    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.JdbcSqlTemplate.execute(JdbcSqlTemplate.java:494)
    at org.jumpmind.db.sql.JdbcSqlTemplate.update(JdbcSqlTemplate.java:405)
    at org.jumpmind.db.sql.SqlScript.execute(SqlScript.java:108)
    at org.jumpmind.db.platform.AbstractDatabasePlatform.alterTables(AbstractDatabasePlatform.java:253)
    at org.jumpmind.db.platform.AbstractDatabasePlatform.alterDatabase(AbstractDatabasePlatform.java:221)
    at org.jumpmind.symmetric.io.data.writer.DefaultDatabaseWriter.create(DefaultDatabaseWriter.java:630)
    at org.jumpmind.symmetric.io.data.writer.DefaultDatabaseWriter.create(DefaultDatabaseWriter.java:640)
    at org.jumpmind.symmetric.io.data.writer.DefaultDatabaseWriter.create(DefaultDatabaseWriter.java:605)
    at org.jumpmind.symmetric.io.data.writer.AbstractDatabaseWriter.write(AbstractDatabaseWriter.java:197)
    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:1046)
    at org.jumpmind.symmetric.service.impl.DataLoaderService$LoadIntoDatabaseOnArrivalListener$2.call(DataLoaderService.java:1)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:750)
Caused by: org.postgresql.util.PSQLException: ERROR: column "_id" is in a primary key
    at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2676)
    at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2366)
    at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:356)
    at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:496)
    at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:413)
    at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:333)
    at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:319)
    at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:295)
    at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:290)
    at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:193)
    at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:193)
    at org.jumpmind.db.sql.JdbcSqlTemplate$6.execute(JdbcSqlTemplate.java:420)
    at org.jumpmind.db.sql.JdbcSqlTemplate$6.execute(JdbcSqlTemplate.java:1)
    at org.jumpmind.db.sql.JdbcSqlTemplate.execute(JdbcSqlTemplate.java:492)
    ... 21 more
Steps To Reproduce1. Setup MongoDB as a server node.
2. Set up Postgres as a client node.
3. Setup customer table on Mongo node.
4. Configure table to run bidirectionally
5. Run an initial load with a create table.
6. Error will show up in log and initial load will error.
TagsNo tags attached.

Relationships

related to 0005664 closedemiller SymmetricDS Tables are altered incorrectly on some platforms when their columns need to be made required or non-required 
related to 0005670 closedcquamme SymmetricDS Pro Incorrect logic in MongoDB DDL Reader causes alter SQL to try and drop primary key 

Activities

There are no notes attached to this issue.

Related Changesets

SymmetricDS: 3.14 ab2fe7e8

2022-11-21 18:06:01

cquamme

Details Diff
0005593: Incorrect Logic in various DDLBuilders for Processing Changes Affected Issues
0005593
mod - symmetric-db/src/main/java/org/jumpmind/db/platform/firebird/FirebirdDdlBuilder.java Diff File

SymmetricDS: 3.14 78084731

2022-11-21 18:06:40

cquamme

Details Diff
0005593: Incorrect Logic in various DDLBuilders for Processing Changes Affected Issues
0005593
mod - symmetric-db/src/main/java/org/jumpmind/db/platform/oracle/OracleDdlBuilder.java Diff File
mod - symmetric-db/src/main/java/org/jumpmind/db/platform/postgresql/PostgreSqlDdlBuilder.java Diff File
mod - symmetric-db/src/main/java/org/jumpmind/db/platform/tibero/TiberoDdlBuilder.java Diff File

Issue History

Date Modified Username Field Change
2022-11-21 18:04 cquamme New Issue
2022-11-21 18:04 cquamme Status new => assigned
2022-11-21 18:04 cquamme Assigned To => cquamme
2022-11-21 18:04 cquamme Product Version 3.3.0 =>
2022-11-21 18:05 cquamme Summary Incorrect Logic in Firebird, Oracle, Postgres, and Tibero DDLBuilders => Incorrect Logic in various DDLBuilders for Processing Changes
2022-11-21 19:00 cquamme Changeset attached => SymmetricDS 3.14 78084731
2022-11-21 19:00 cquamme Changeset attached => SymmetricDS 3.14 ab2fe7e8
2023-01-24 20:33 emiller Relationship added related to 0005664
2023-01-24 20:34 cquamme Status assigned => resolved
2023-01-25 15:45 cquamme Status resolved => assigned
2023-01-25 15:56 cquamme Description Updated View Revisions
2023-01-25 15:56 cquamme Steps to Reproduce Updated View Revisions
2023-01-25 16:06 cquamme Steps to Reproduce Updated View Revisions
2023-01-25 16:19 cquamme Steps to Reproduce Updated View Revisions
2023-01-26 19:55 cquamme Steps to Reproduce Updated View Revisions
2023-01-30 13:33 cquamme Status assigned => resolved
2023-01-30 13:48 cquamme Relationship added related to 0005670
2023-01-31 13:42 cquamme Resolution open => fixed
2023-01-31 13:42 cquamme Product Version => 3.14.3
2023-01-31 13:42 cquamme Fixed in Version => 3.14.5
2023-01-31 13:42 cquamme Target Version => 3.14.5
2023-02-15 20:26 admin Status resolved => closed