Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go-binlog: add the field of ddl_schema_state (#156) (#157) #158

Merged
merged 4 commits into from
Dec 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
version: 2
jobs:
go:
docker:
- image: circleci/golang:stretch
environment:
PROTOC_VERSION: "3.5.1"
working_directory: /go/src/github.com/pingcap/tipb
steps:
- checkout
- run:
name: Download dependence
# Define variables that need interpolation
# As CircleCI's each `run` declaration starts a new shell, we need to persist them to $BASH_ENV
command: |
echo 'export PATH=$HOME/.local/bin:$PATH' >> $BASH_ENV
curl -OL https://github.com/google/protobuf/releases/download/v$PROTOC_VERSION/protoc-$PROTOC_VERSION-linux-x86_64.zip
unzip protoc-$PROTOC_VERSION-linux-x86_64.zip -d $HOME/.local
rm protoc-$PROTOC_VERSION-linux-x86_64.zip
go get -u github.com/gogo/protobuf/protoc-gen-gofast
cd $GOPATH/src/github.com/gogo/protobuf
git checkout v0.5
rm $GOPATH/bin/protoc-gen-gofast
go get github.com/gogo/protobuf/protoc-gen-gofast
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does version matter?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file copy from v3.1

go get golang.org/x/tools/cmd/goimports
- run:
name: Test Golang
command: make go binlog && git diff --exit-code
no_output_timeout: 1800s

rust:
docker:
- image: circleci/rust:stretch
environment:
RUST_TEST_THREADS: "1"
RUST_BACKTRACE: "1"
RUSTFLAGS: "-Dwarnings"
steps:
- checkout
# TODO: Run make rust and check whether it generates different contents.
- run:
name: Test Rust
command: cargo check && cargo check --no-default-features
no_output_timeout: 1800s

workflows:
version: 2
ci-test:
jobs:
- go
- rust
2 changes: 2 additions & 0 deletions generate-go.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/bash

source _help.sh

# check gogo protobuf's existence and version
Expand Down
4 changes: 3 additions & 1 deletion generate-rust.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ GOGO_ROOT=${GOPATH}/src/github.com/gogo/protobuf
protoc -I.:${GOGO_ROOT}:${GOGO_ROOT}/protobuf --rust_out ../src *.proto || ret=$?


echo "extern crate protobuf;" > ../src/lib.rs
echo "#![allow(unknown_lints)]" > ../src/lib.rs
echo "#![allow(bare_trait_objects)]" >> ../src/lib.rs
echo "extern crate protobuf;" >> ../src/lib.rs
for file in `ls *.proto`
do
base_name=$(basename $file ".proto")
Expand Down
103 changes: 68 additions & 35 deletions go-binlog/binlog.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions proto/binlog/binlog.proto
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,7 @@ message Binlog {
// If PreDDL has matching PostDDL with the same job_id, we can execute the DDL right away, otherwise,
// we can use the job_id to check if the ddl statement has been successfully added to DDL job list.
optional int64 ddl_job_id = 7 [(gogoproto.nullable) = false];

// ddl_schema_state is used for DDL Binlog.
optional int32 ddl_schema_state = 8 [(gogoproto.nullable) = false];
}
Loading