View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0006877 | SymmetricDS | Bug | public | 2025-05-08 20:22 | 2025-06-08 01:07 |
Reporter | emiller | Assigned To | emiller | ||
Priority | normal | ||||
Status | closed | Resolution | fixed | ||
Product Version | 3.13.0 | ||||
Target Version | 3.16.3 | Fixed in Version | 3.16.3 | ||
Summary | 0006877: SQL Server DDL reader can cause default values to become invalid by attempting to unescape single quotes | ||||
Description | After reading a default value from the database metadata for a column with text-based data type, the SQL Server DDL reader unescapes the default value by replacing all instances of 2 consecutive single quotes with 1 single quote. In some cases, this can cause the default value to become invalid. For example, the following default value for a varchar column triggers this bug: coalesce([column_0]+' ','') There are many other DDL readers that run the same code to unescape default values, so this bug is not necessarily limited to the SQL Server DDL reader. | ||||
Steps To Reproduce | Add table with a strange generated column to replication: CREATE TABLE dbo.demo_default_text2 ( [CrossReferenceID] [uniqueidentifier] NOT NULL, [CrossReferenceLegacyID] [uniqueidentifier] NOT NULL, [CrossReferenceUnassignedID] [uniqueidentifier] NOT NULL, [PartNumber] varchar(50) NOT NULL, [CrossPartNumber] varchar(100) NOT NULL, [CrossCPCode] varchar(25) NOT NULL, [CrossCounterParty] varchar(255) NOT NULL, [SourceCPCode] varchar(25) NOT NULL, [SourceCounterParty] varchar(255) NOT NULL, [SourceFile] varchar(255) NULL, [Comments] varchar(max) NOT NULL, [ConfirmedValid] varchar(1) NOT NULL, [OriginalSystemCreatedBy] varchar(225) NOT NULL, [OriginalSystemCreatedOn] [datetime2](7) NOT NULL, [LastModifiedBy] varchar(225) NULL, [LastModifiedOn] [datetime2](7) NULL, [Description] varchar(255) NULL, [TenantID] [uniqueidentifier] NOT NULL, [SortOrder] [int] NOT NULL, [RecordStatus] varchar(50) NOT NULL, [AppCode] varchar(50) NULL, [Created] [datetime2](7) NOT NULL, [CreatedBy] [uniqueidentifier] NOT NULL, [Modified] [datetime2](7) NULL, [ModifiedBy] [uniqueidentifier] NULL, [Completed] [datetime2](7) NULL, [CompletedBy] [uniqueidentifier] NULL, [Deleted] [datetime2](7) NULL, [DeletedBy] [uniqueidentifier] NULL, [DeletedReason] varchar(max) NULL, [SearchKey] AS ((((((coalesce([PartNumber]+' ','')+coalesce([CrossPartNumber]+' ',''))+coalesce([CrossCPCode]+' ',''))+coalesce([CrossCounterParty]+' ',''))+coalesce([SourceCPCode]+' ',''))+coalesce([SourceCounterParty]+' ',''))+coalesce([Description]+' ','')) PERSISTED NOT NULL, [ReversePartNumber] AS (reverse([PartNumber])) PERSISTED, [ReverseCrossPartNumber] AS (reverse([CrossPartNumber])) PERSISTED, CONSTRAINT [PK_Crosslink_CrossReference] PRIMARY KEY CLUSTERED ( [CrossReferenceID] ) ) | ||||
Tags | ddl/schema | ||||
SymmetricDS: 3.16 76f7af74 2025-05-14 16:51:45 evan-miller-jumpmind Committer: GitHub Details Diff |
0006877: Prevented SQL Server DDL reader from attempting to unescape single quotes within default values (0000272) 0006877: Prevented SQL Server DDL reader from attempting to unescape single quotes within default values |
Affected Issues 0006877 |
|
mod - symmetric-jdbc/src/main/java/org/jumpmind/db/platform/mssql/MsSqlDdlReader.java | Diff File | ||
mod - symmetric-jdbc/src/test/java/org/jumpmind/db/platform/mssql/MsSql2008DdlReaderTest.java | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2025-05-08 20:22 | emiller | New Issue | |
2025-05-08 20:22 | emiller | Status | new => assigned |
2025-05-08 20:22 | emiller | Assigned To | => emiller |
2025-05-08 20:22 | emiller | Tag Attached: ddl/schema | |
2025-05-08 20:57 | emiller | Note Added: 0002949 | |
2025-05-14 13:29 | pbelov | Steps to Reproduce Updated | View Revisions |
2025-05-14 16:51 | pbelov | Status | assigned => resolved |
2025-05-14 16:51 | pbelov | Resolution | open => fixed |
2025-05-14 16:51 | pbelov | Fixed in Version | => 3.16.3 |
2025-05-14 17:00 | Changeset attached | => SymmetricDS 3.16 76f7af74 | |
2025-06-08 01:07 | pbelov | Note Added: 0003031 | |
2025-06-08 01:07 | pbelov | Status | resolved => closed |