Skip to content

shardingcore 在SqlServer 有SCHEMA的情况下有bug。希望尽快升级一下 #151

@x478874x

Description

@x478874x

shardingcore\7.8.1.21\lib\net8.0\ShardingCore.dll

源码:
if (text2.Contains("EXEC sp_addextendedproperty 'MS_Description', @description, 'SCHEMA', @defaultSchema, 'TABLE'"))
{
text2 = text2.Replace("EXEC sp_addextendedproperty 'MS_Description', @description, 'SCHEMA', @defaultSchema, 'TABLE', N'" + absTableName2 + "'", "EXEC sp_addextendedproperty 'MS_Description', @description, 'SCHEMA', @defaultSchema, 'TABLE', N'" + aShardingTable + "'");
}

增加代码:
string defaultSchema = string.Empty;
string schema = operation.GetPropertyValue("Schema") as string;
if (!string.IsNullOrWhiteSpace(schema))
{
defaultSchema = schema;
}

                    if (text2.Contains("EXEC sp_addextendedproperty 'MS_Description', @description, 'SCHEMA', @defaultSchema, 'TABLE'"))
                    {
                        text2 = text2.Replace("EXEC sp_addextendedproperty 'MS_Description', @description, 'SCHEMA', @defaultSchema, 'TABLE', N'" + absTableName2 + "'", "EXEC sp_addextendedproperty 'MS_Description', @description, 'SCHEMA', @defaultSchema, 'TABLE', N'" + aShardingTable + "'");
                    }

//我追加代码
if (text2.Contains($"EXEC sp_addextendedproperty 'MS_Description', @description, 'SCHEMA', N'{defaultSchema}', 'TABLE'"))
{
text2 = text2.Replace($"EXEC sp_addextendedproperty 'MS_Description', @description, 'SCHEMA', N'{defaultSchema}', 'TABLE', N'" + absTableName2 + "'", $"EXEC sp_addextendedproperty 'MS_Description', @description, 'SCHEMA', N'{defaultSchema}', 'TABLE', N'" + aShardingTable + "'");
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions