From 3db875a0bf5341dfc81d14d23b98ce906204b1df Mon Sep 17 00:00:00 2001 From: dongmen <414110582@qq.com> Date: Mon, 4 Jul 2022 12:40:55 +0800 Subject: [PATCH] fix error --- .vscode/configurationCache.log | 1 + .vscode/dryrun.log | 23 ++ .vscode/settings.json | 3 + .vscode/targets.log | 428 +++++++++++++++++++++++++++++++++ pkg/binlog-filter/filter.go | 4 +- 5 files changed, 457 insertions(+), 2 deletions(-) create mode 100644 .vscode/configurationCache.log create mode 100644 .vscode/dryrun.log create mode 100644 .vscode/settings.json create mode 100644 .vscode/targets.log diff --git a/.vscode/configurationCache.log b/.vscode/configurationCache.log new file mode 100644 index 000000000..2de8cd81a --- /dev/null +++ b/.vscode/configurationCache.log @@ -0,0 +1 @@ +{"buildTargets":["build","check","clean","ddl_checker","deps","dump_region","failpoint-disable","failpoint-enable","finish","fmt","importer","integration_test","prepare","sync_diff_inspector","test","tidy","tools","version"],"launchTargets":[],"customConfigurationProvider":{"workspaceBrowse":{"browsePath":[],"compilerArgs":[]},"fileIndex":[]}} \ No newline at end of file diff --git a/.vscode/dryrun.log b/.vscode/dryrun.log new file mode 100644 index 000000000..b8bae2385 --- /dev/null +++ b/.vscode/dryrun.log @@ -0,0 +1,23 @@ +make: Entering directory `/Users/dongmen/dongmen/works/tidb-tools' +cp go.mod1 go.mod +cp go.sum1 go.sum +GO111MODULE=on go version +echo "gofmt (simplify)" +gofmt -s -l -w $(find . -name '*.go' -type f | grep -vE 'vendor') 2>&1 | awk '{print} END{if(NR>0) {exit 1}}' +#go get github.com/golang/lint/golint +echo "vet" +GO111MODULE=on go vet -composites=false $(go list ./...) +GO111MODULE=on go vet -vettool=/Users/dongmen/dongmen/works/tidb-tools/bin/shadow $(go list ./...) || true +#@echo "golint" +#@ golint ./... 2>&1 | grep -vE '\.pb\.go' | grep -vE 'vendor' | awk '{print} END{if(NR>0) {exit 1}}' + +GO111MODULE=on go build -ldflags '-X "github.com/pingcap/tidb-tools/pkg/utils.Version=v5.3.2" -X "github.com/pingcap/tidb-tools/pkg/utils.BuildTS=2022-07-04 02:17:04" -X "github.com/pingcap/tidb-tools/pkg/utils.GitHash=cf6b7a8ae4b5849a6155634352b3712059defb48" -X "github.com/pingcap/tidb-tools/pkg/utils.GitBranch=master"' -o bin/importer ./importer + +GO111MODULE=on go build -ldflags '-X "github.com/pingcap/tidb-tools/pkg/utils.Version=v5.3.2" -X "github.com/pingcap/tidb-tools/pkg/utils.BuildTS=2022-07-04 02:17:04" -X "github.com/pingcap/tidb-tools/pkg/utils.GitHash=cf6b7a8ae4b5849a6155634352b3712059defb48" -X "github.com/pingcap/tidb-tools/pkg/utils.GitBranch=master"' -o bin/sync_diff_inspector ./sync_diff_inspector + +GO111MODULE=on go build -ldflags '-X "github.com/pingcap/tidb-tools/pkg/utils.Version=v5.3.2" -X "github.com/pingcap/tidb-tools/pkg/utils.BuildTS=2022-07-04 02:17:04" -X "github.com/pingcap/tidb-tools/pkg/utils.GitHash=cf6b7a8ae4b5849a6155634352b3712059defb48" -X "github.com/pingcap/tidb-tools/pkg/utils.GitBranch=master"' -o bin/ddl_checker ./ddl_checker + +cp go.mod go.mod1 +cp go.sum go.sum1 +make: Leaving directory `/Users/dongmen/dongmen/works/tidb-tools' + diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..65e1ec078 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "makefile.extensionOutputFolder": "./.vscode" +} \ No newline at end of file diff --git a/.vscode/targets.log b/.vscode/targets.log new file mode 100644 index 000000000..226bdcdc0 --- /dev/null +++ b/.vscode/targets.log @@ -0,0 +1,428 @@ +make all --print-data-base --no-builtin-variables --no-builtin-rules --question +# GNU Make 3.81 +# Copyright (C) 2006 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. +# There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# This program built for i386-apple-darwin11.3.0 + +make: *** No rule to make target `all'. Stop. + + +# Make data base, printed on Mon Jul 4 10:17:04 2022 + +# Variables + +# automatic +/dev/null || echo /Developer)/Makefiles +# environment +VSCODE_CODE_CACHE_PATH = /Users/dongmen/Library/Application Support/Code/CachedData/30d9c6cd9483b2cc586687151bcbcd635f373630 +# environment +LOGNAME = dongmen +# environment +APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL = 1 +# environment +ZSH = /Users/dongmen/.oh-my-zsh +# environment +VSCODE_HANDLES_UNCAUGHT_ERRORS = true +# automatic +^D = $(patsubst %/,%,$(dir $^)) +# environment +XPC_FLAGS = 0x0 +# default +MAKE = $(MAKE_COMMAND) +# default +MAKECMDGOALS := all +# environment +SHLVL = 1 +# makefile (from `Makefile', line 10) +path_to_add := /Users/dongmen/go/bin +# default +MAKE_VERSION := 3.81 +# environment +USER = dongmen +# makefile +.DEFAULT_GOAL := build +# environment +LESS = -R +# automatic +%D = $(patsubst %/,%,$(dir $%)) +# default +MAKE_COMMAND := /Library/Developer/CommandLineTools/usr/bin/make +# default +.VARIABLES := +# environment +TMPDIR = /var/folders/xc/96cndgxx60z_pmg99yb2bw1c0000gn/T/ +# automatic +*F = $(notdir $*) +# environment +VSCODE_IPC_HOOK = /Users/dongmen/Library/Application Support/Code/1.68.1-main.sock +# makefile +MAKEFLAGS = Rrqp +# environment +MFLAGS = -Rrqp +# automatic +*D = $(patsubst %/,%,$(dir $*)) +# environment +XPC_SERVICE_NAME = application.com.microsoft.VSCode.31646790.31646796 +# environment +HOMEBREW_PREFIX = /opt/homebrew +# automatic ++D = $(patsubst %/,%,$(dir $+)) +# automatic ++F = $(notdir $+) +# makefile (from `Makefile', line 26) +PACKAGES := $$(go list ./...) +# environment +HOMEBREW_REPOSITORY = /opt/homebrew +# makefile (from `Makefile', line 21) + +GOTEST := CGO_ENABLED=1 GO111MODULE=on go test -p 3 +# environment +__CF_USER_TEXT_ENCODING = 0x1F5:0x0:0x0 +# environment +COMMAND_MODE = unix2003 +# default +MAKEFILES := +# automatic + 0) { exit 1 } }' +# automatic +^F = $(notdir $^) +# default +SUFFIXES := +# environment +MAKELEVEL := 0 +# environment +AUTOJUMP_ERROR_PATH = /Users/dongmen/Library/autojump/errors.log +# environment +LANG = C +# environment +VSCODE_PID = 2251 +# makefile (from `Makefile', line 29) +define run_unit_test + @echo "running unit test for packages:" $(1) + @make failpoint-enable + @export log_level=error; $(GOTEST) -cover $(1) || { @make failpoint-disable; exit 1; } + @make failpoint-disable +endef +# makefile (from `Makefile', line 23) +FILES := $$(find . -name '*.go' -type f | grep -vE 'vendor') +# variable set hash-table stats: +# Load=85/1024=8%, Rehash=0, Collisions=2/129=2% + +# Pattern-specific Variable Values + +# No pattern-specific variable values. + +# Directories + +# . (device 16777234, inode 32394051): 21 files, no impossibilities. + +# 21 files, no impossibilities in 1 directories. + +# Implicit Rules + +# No implicit rules. + +# Files + +# Not a target: +all: +# Command-line target. +# Implicit rule search has been done. +# File does not exist. +# File has not been updated. +# variable set hash-table stats: +# Load=0/32=0%, Rehash=0, Collisions=0/0=0% + +.PHONY: build importer dump_region sync_diff_inspector ddl_checker test check deps version tools +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +deps: +# Phony target (prerequisite of .PHONY). +# Implicit rule search has not been done. +# File does not exist. +# File has not been updated. + +# Not a target: +.SUFFIXES: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +# Not a target: +Makefile: +# Implicit rule search has been done. +# Last modified 2022-07-04 10:14:10 +# File has been updated. +# Successfully updated. +# variable set hash-table stats: +# Load=0/32=0%, Rehash=0, Collisions=0/0=0% + +test: version +# Phony target (prerequisite of .PHONY). +# Implicit rule search has not been done. +# File does not exist. +# File has not been updated. +# commands to execute (from `Makefile', line 71): + rm -rf /tmp/output + $(call run_unit_test,$(PACKAGES)) + + +build: prepare version check importer sync_diff_inspector ddl_checker finish +# Phony target (prerequisite of .PHONY). +# Implicit rule search has not been done. +# File does not exist. +# File has not been updated. + +prepare: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. +# commands to execute (from `Makefile', line 55): + cp go.mod1 go.mod + cp go.sum1 go.sum + + +dump_region: +# Phony target (prerequisite of .PHONY). +# Implicit rule search has not been done. +# File does not exist. +# File has not been updated. +# commands to execute (from `Makefile', line 62): + $(GO) build -ldflags '$(LDFLAGS)' -o bin/dump_region ./dump_region + + +importer: +# Phony target (prerequisite of .PHONY). +# Implicit rule search has not been done. +# File does not exist. +# File has not been updated. +# commands to execute (from `Makefile', line 59): + $(GO) build -ldflags '$(LDFLAGS)' -o bin/importer ./importer + + +failpoint-enable: tools +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. +# commands to execute (from `Makefile', line 42): + tools/bin/failpoint-ctl enable + + +version: +# Phony target (prerequisite of .PHONY). +# Implicit rule search has not been done. +# File does not exist. +# File has not been updated. +# commands to execute (from `Makefile', line 52): + $(GO) version + + +# Not a target: +.DEFAULT: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +failpoint-disable: tools +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. +# commands to execute (from `Makefile', line 45): + tools/bin/failpoint-ctl disable + + +sync_diff_inspector: +# Phony target (prerequisite of .PHONY). +# Implicit rule search has not been done. +# File does not exist. +# File has not been updated. +# commands to execute (from `Makefile', line 65): + $(GO) build -ldflags '$(LDFLAGS)' -o bin/sync_diff_inspector ./sync_diff_inspector + + +finish: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. +# commands to execute (from `Makefile', line 106): + cp go.mod go.mod1 + cp go.sum go.sum1 + + +clean: prepare tidy finish +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. + +tidy: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. +# commands to execute (from `Makefile', line 97): + cp go.mod1 go.mod + cp go.sum1 go.sum + @$(GO) mod tidy + cp go.mod go.mod1 + cp go.sum go.sum1 + + +fmt: +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. +# commands to execute (from `Makefile', line 85): + @echo "gofmt (simplify)" + @ gofmt -s -l -w $(FILES) 2>&1 | awk '{print} END{if(NR>0) {exit 1}}' + + +check: fmt +# Phony target (prerequisite of .PHONY). +# Implicit rule search has not been done. +# File does not exist. +# File has not been updated. +# commands to execute (from `Makefile', line 89): + #go get github.com/golang/lint/golint + @echo "vet" + @$(GO) vet -composites=false $(PACKAGES) + @$(GO) vet -vettool=$(CURDIR)/bin/shadow $(PACKAGES) || true + #@echo "golint" + #@ golint ./... 2>&1 | grep -vE '\.pb\.go' | grep -vE 'vendor' | awk '{print} END{if(NR>0) {exit 1}}' + + +integration_test: prepare failpoint-enable importer sync_diff_inspector ddl_checker failpoint-disable finish +# Implicit rule search has not been done. +# Modification time never checked. +# File has not been updated. +# commands to execute (from `Makefile', line 75): + @which bin/tidb-server + @which bin/tikv-server + @which bin/pd-server + @which bin/sync_diff_inspector + @which bin/mydumper + @which bin/loader + @which bin/importer + tests/run.sh + + +ddl_checker: +# Phony target (prerequisite of .PHONY). +# Implicit rule search has not been done. +# File does not exist. +# File has not been updated. +# commands to execute (from `Makefile', line 68): + $(GO) build -ldflags '$(LDFLAGS)' -o bin/ddl_checker ./ddl_checker + + +tools: +# Phony target (prerequisite of .PHONY). +# Implicit rule search has not been done. +# File does not exist. +# File has not been updated. +# commands to execute (from `Makefile', line 48): + @echo "install tools..." + @cd tools && make + + +# files hash-table stats: +# Load=23/1024=2%, Rehash=0, Collisions=0/66=0% +# VPATH Search Paths + +# No `vpath' search paths. + +# No general (`VPATH' variable) search path. + +# # of strings in strcache: 1 +# # of strcache buffers: 1 +# strcache size: total = 4096 / max = 4096 / min = 4096 / avg = 4096 +# strcache free: total = 4087 / max = 4087 / min = 4087 / avg = 4087 + +# Finished Make data base on Mon Jul 4 10:17:04 2022 + + diff --git a/pkg/binlog-filter/filter.go b/pkg/binlog-filter/filter.go index f487f4746..baa797651 100644 --- a/pkg/binlog-filter/filter.go +++ b/pkg/binlog-filter/filter.go @@ -112,7 +112,7 @@ func ClassifyEvent(event EventType) (EventType, error) { ShardRowID, ModifyTableComment, RenameIndex, AddTablePartition, DropTablePartition, TruncateTablePartition, ModifyTableCharsetAndCollate, ModifySchemaCharsetAndCollate, RecoverTable, LockTable, UnlockTable, RepairTable, SetTiFlashReplica, - UpdateTiFlashReplica, AddPrimaryKey, DropPrimaryKey, CreateSequence, + UpdateTiFlashReplicaStatus, AddPrimaryKey, DropPrimaryKey, CreateSequence, AlterSequence, DropSequence, CreateSchema, DropSchema, AddIndex: return ddl, nil case NullEvent: @@ -183,7 +183,7 @@ func (b *BinlogEventRule) toEvent(es string) (EventType, error) { AddTablePartition, DropTablePartition, TruncateTablePartition, ModifyTableCharsetAndCollate, ModifySchemaCharsetAndCollate, RecoverTable, LockTable, UnlockTable, RepairTable, - SetTiFlashReplica, UpdateTiFlashReplica, AddPrimaryKey, DropPrimaryKey, + SetTiFlashReplica, UpdateTiFlashReplicaStatus, AddPrimaryKey, DropPrimaryKey, CreateSequence, AlterSequence, DropSequence: return event, nil case CreateSchema: // alias of CreateDatabase