apiVersion: api/v1
kind: Case
name: dm_sharding_pessimistic_special_schema
features: [dm]
summary: 测试悲观模式合库合表
steps: |
    1. 使用dmctl operate create source.yaml添加source
    2. 使用dmctl task-start task.yaml with
      with is-sharding: true,
      shard-mode: "pessimistic"
    3. 分别向上游插入特殊的ddl
    4. check downstream status and check the consistency.
expectedResult: |
    步骤1. 创建source成功
    步骤2. 创建悲观合库合表任务成功
    步骤3. 使用dmctl query-status task-name查看任务
    步骤4. 5min之后，上下游对比一致
priority: P1
supportedVersions: [">5.4.0"]
tags: [dm]
designer: xujianxu@pingcap.com
automation: AUTOMATED
active: true
framework:
    generic:
        command:
            [
                "/bin/sh",
                "-c",
                "/dm_test_infra --workload testcases/dm_sharding_pessimistic_special_schema/workload.yaml --path testcases/dm_sharding_pessimistic_special_schema/path.yaml",
            ]
        workingDir: "/"
        env: null
        image: hub-new.pingcap.net/dm/test-infra:dm_sharding_pessimistic_special_schema
        imagePullPolicy: Always
parameters:
    - type: RESOURCE
      name: upstream1
      default: upstream1
    - type: RESOURCE
      name: upstream2
      default: upstream2
    - type: RESOURCE
      name: downstream
      default: downstream
    - type: RESOURCE
      name: dm
      default: dm
    - type: RESOURCE
      name: workload
      default: workload
    - type: RESOURCE
      name: syncdiff
      default: syncdiff
    - type: STRING
      name: executeSql
      default: |
          'create table dm_sharding_pessimistic_special_schema.t(a int not null, b int not null, c int not null, d int not null, e int not null, index (a), index(b), index(c));'
    - type: STRING
      name: executeSql1
      default: |
          'alter table dm_sharding_pessimistic_special_schema.t add unique(d); | alter table dm_sharding_pessimistic_special_schema.t add unique(e); | insert into dm_sharding_pessimistic_special_schema.t values(1,1,1,1,1);'
    - type: STRING
      name: executeSql2
      default: |
          'alter table dm_sharding_pessimistic_special_schema.t add unique(d); | alter table dm_sharding_pessimistic_special_schema.t add unique(e); | insert into dm_sharding_pessimistic_special_schema.t values(2,2,2,2,2);'
