diff --git a/.github/workflows/integration_test_mysql.yaml b/.github/workflows/integration_test_mysql.yaml index a45ba8ba2..d501e9494 100644 --- a/.github/workflows/integration_test_mysql.yaml +++ b/.github/workflows/integration_test_mysql.yaml @@ -116,12 +116,135 @@ jobs: run: | export TICDC_NEWARCH=true && make integration_test CASE=region_merge + # The 12th case in this group + - name: Test safe mode + if: ${{ success() }} + run: | + export TICDC_NEWARCH=true && make integration_test CASE=safe_mode + + # The 13th case in this group + - name: Test savepoint + if: ${{ success() }} + run: | + export TICDC_NEWARCH=true && make integration_test CASE=savepoint + + # The 14th case in this group + - name: Test server config compatibility + if: ${{ success() }} + run: | + export TICDC_NEWARCH=true && make integration_test CASE=server_config_compatibility + + # The 15th case in this group + - name: Test split region + if: ${{ success() }} + run: | + export TICDC_NEWARCH=true && make integration_test CASE=split_region + - name: Upload test logs if: always() uses: ./.github/actions/upload-test-logs with: log-name: e2e_test_group_1 + e2e_test_group_2: + ## Only run ci when PR is not draft + if: github.event.pull_request.draft == false + + runs-on: ubuntu-latest + name: E2E Test Group 2 + steps: + - name: Check out code + uses: actions/checkout@v2 + + - name: Setup Go environment + uses: actions/setup-go@v3 + with: + go-version: '1.23' + + - name: Integration Build + run: | + tests/scripts/download-integration-test-binaries.sh master true + go build -o ./tools/bin/failpoint-ctl github.com/pingcap/failpoint/failpoint-ctl + make integration_test_build + ls -l bin/ && ls -l tools/bin/ + + - name: Test api_v2 + if: ${{ success() }} + run: | + export TICDC_NEWARCH=true && make integration_test CASE=api_v2 + + - name: Test autorandom + if: ${{ success() }} + run: | + export TICDC_NEWARCH=true && make integration_test CASE=autorandom + + - name: Test availability + if: ${{ success() }} + run: | + export TICDC_NEWARCH=true && make integration_test CASE=availability + + - name: Test bank + if: ${{ success() }} + run: | + export TICDC_NEWARCH=true && make integration_test CASE=bank + + - name: Test batch_add_table + if: ${{ success() }} + run: | + export TICDC_NEWARCH=true && make integration_test CASE=batch_add_table + + - name: Test batch_update_to_no_batch + if: ${{ success() }} + run: | + export TICDC_NEWARCH=true && make integration_test CASE=batch_update_to_no_batch + + - name: Test ci_collation_compatibility + if: ${{ success() }} + run: | + export TICDC_NEWARCH=true && make integration_test CASE=ci_collation_compatibility + + - name: Test multi_capture + if: ${{ success() }} + run: | + export TICDC_NEWARCH=true && make integration_test CASE=multi_capture + + - name: Test multi_cdc_cluster + if: ${{ success() }} + run: | + export TICDC_NEWARCH=true && make integration_test CASE=multi_cdc_cluster + + - name: Test multi_rocks + if: ${{ success() }} + run: | + export TICDC_NEWARCH=true && make integration_test CASE=multi_rocks + + - name: Test resourcecontrol + if: ${{ success() }} + run: | + export TICDC_NEWARCH=true && make integration_test CASE=resourcecontrol + + - name: Test row_format + if: ${{ success() }} + run: | + export TICDC_NEWARCH=true && make integration_test CASE=row_format + + - name: Test tiflash + if: ${{ success() }} + run: | + export TICDC_NEWARCH=true && make integration_test CASE=tiflash + + # The 14th case in this group + - name: Test vector + if: ${{ success() }} + run: | + export TICDC_NEWARCH=true && make integration_test CASE=vector + + - name: Upload test logs + if: always() + uses: ./.github/actions/upload-test-logs + with: + log-name: e2e_test_group_2 + failover_e2e_test1: ## Only run ci when PR is not draft diff --git a/pkg/sink/mysql/mysql_writer.go b/pkg/sink/mysql/mysql_writer.go index 0b3e0d4b6..1db82d520 100644 --- a/pkg/sink/mysql/mysql_writer.go +++ b/pkg/sink/mysql/mysql_writer.go @@ -730,7 +730,20 @@ func (w *MysqlWriter) prepareDMLs(events []*commonEvent.DMLEvent) (*preparedDMLs switch row.RowType { case commonEvent.RowTypeUpdate: - query, args, err = buildUpdate(event.TableInfo, row) + if translateToInsert { + query, args, err = buildUpdate(event.TableInfo, row) + } else { + query, args, err = buildDelete(event.TableInfo, row) + if err != nil { + dmlsPool.Put(dmls) // Return to pool on error + return nil, errors.Trace(err) + } + if query != "" { + dmls.sqls = append(dmls.sqls, query) + dmls.values = append(dmls.values, args) + } + query, args, err = buildInsert(event.TableInfo, row, translateToInsert) + } case commonEvent.RowTypeDelete: query, args, err = buildDelete(event.TableInfo, row) case commonEvent.RowTypeInsert: