View Revisions: Issue #6877

Summary 0006877: SQL Server DDL reader can cause default values to become invalid by attempting to unescape single quotes
Revision 2025-05-08 20:22 by emiller
Steps To Reproduce
Revision 2025-05-14 13:29 by pbelov
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] )
 )