See [https://godoc.org/github.com/pingcap/parser](https://godoc.org/github.com/pingcap/parser)
## How to update parser for TiDB
## How to update parser for TiDB
Assuming that you want to file a PR (pull request) to TiDB, and your PR includes a change in the parser, follow these steps to update the parser in TiDB.
Assuming that you want to file a PR (pull request) to TiDB, and your PR includes a change in the parser, follow these steps to update the parser in TiDB.
...
@@ -21,25 +25,13 @@ Suppose the forked repository is `https://github.com/your-repo/parser`.
...
@@ -21,25 +25,13 @@ Suppose the forked repository is `https://github.com/your-repo/parser`.
### Step 2: Make your parser changes take effect in TiDB and run CI
### Step 2: Make your parser changes take effect in TiDB and run CI
1. In your TiDB repository, modify the `go.mod` file, remove `github.com/pingcap/parser` from the `require` instruction, and add a new line at the end of the file like this:
1. In your TiDB repository, execute the `replace` instruction to make your parser changes take effect:
GO111MODULE=on go mod edit -replace github.com/pingcap/parser=github.com/${CIRCLE_PR_USERNAME:-$CIRCLE_PROJECT_USERNAME}/${CIRCLE_PR_REPONAME:-$CIRCLE_PROJECT_REPONAME}@$CIRCLE_SHA1
name:"Verifyparser.goisup-to-date"
make test
command:|
mv parser.go parser.go.committed
make parser
diff -u parser.go.committed parser.go
-run:
name:"Checkcodeformat"
command:make fmt
-run:
name:"Build"
command:make
-run:
name:"IntegrationTest"
command:|
cd /go/src/github.com/pingcap/
git clone git@github.com:pingcap/tidb.git
cd tidb
rm go.sum
GO111MODULE=on go mod edit -replace github.com/pingcap/parser=github.com/${CIRCLE_PR_USERNAME:-$CIRCLE_PROJECT_USERNAME}/${CIRCLE_PR_REPONAME:-$CIRCLE_PROJECT_REPONAME}@$CIRCLE_SHA1