Skip to content

Commit 7cedd75

Browse files
Merge branch 'master' into release-2.1
2 parents dde8559 + de772f7 commit 7cedd75

File tree

1,338 files changed

+110248
-36034
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,338 files changed

+110248
-36034
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,6 @@ _test/
6262

6363
# generated protobuf files
6464
/go/vt/.proto.tmp
65+
66+
# Eclipse Java CheckStyle plugin configuration.
67+
/java/*/.checkstyle

.pullapprove.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,6 @@ groups:
2727
- thompsonja-bot
2828
- pivanof
2929
- pivanof-bot
30+
- wangyipei01
31+
- wangyipei01-bot
3032

.travis.yml

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
sudo: false
33
language: go
44
go:
5-
- 1.7
5+
- 1.8
66
addons:
77
apt:
88
sources:
@@ -34,6 +34,7 @@ cache:
3434
# Cache downloaded and extracted MariaDB 10.0 packages.
3535
- $MYSQL_ROOT
3636
# Cache bootstrapped dependencies (e.g. protobuf and gRPC).
37+
- $HOME/gopath/dist/etcd
3738
- $HOME/gopath/dist/grpc/.build_finished
3839
- $HOME/gopath/dist/grpc/usr/local
3940
- $HOME/gopath/dist/py-mock-1.0.1/.build_finished
@@ -44,16 +45,19 @@ cache:
4445
- $HOME/.m2
4546
- $HOME/.phpenv
4647
before_cache:
47-
# Travis CI caching doesn't work with this symlink. Just delete it.
48+
# Travis CI caching doesn't work with these symlinks. Just delete them.
49+
- rm $HOME/gopath/bin/etcd
4850
- rm $HOME/gopath/bin/zksrv.sh
4951
# Delete these files because they keep changing (having the latest timestamp
5052
# of an update) and trigger a lengthy update of the cache (~25 seconds).
51-
- rm $HOME/.m2/repository/com/youtube/vitess/*/maven-metadata-local.xml
52-
- rm $HOME/.m2/repository/com/youtube/vitess/*/*-SNAPSHOT/*-SNAPSHOT.jar
53-
- rm $HOME/.m2/repository/com/youtube/vitess/*/*-SNAPSHOT/_remote.repositories
54-
- rm $HOME/.m2/repository/com/youtube/vitess/*/*-SNAPSHOT/maven-metadata-local.xml
55-
- rm $HOME/.m2/repository/com/youtube/vitess/*/*-SNAPSHOT/resolver-status.properties
53+
- rm $HOME/.m2/repository/io/vitess/*/maven-metadata-local.xml
54+
- rm $HOME/.m2/repository/io/vitess/*/*-SNAPSHOT/*-SNAPSHOT*.jar
55+
- rm $HOME/.m2/repository/io/vitess/*/*-SNAPSHOT/_remote.repositories
56+
- rm $HOME/.m2/repository/io/vitess/*/*-SNAPSHOT/maven-metadata-local.xml
57+
- rm $HOME/.m2/repository/io/vitess/*/*-SNAPSHOT/resolver-status.properties
58+
- rm $HOME/.m2/repository/io/grpc/grpc-core/resolver-status.properties
5659
- rm $HOME/.m2/repository/io/grpc/protoc-gen-grpc-java/*/protoc-gen-grpc-java-*.pom.lastUpdated
60+
- rm $HOME/.m2/repository/io/netty/netty-codec-http2/resolver-status.properties
5761
# Don't cache unnecessary PHP files.
5862
- rm $HOME/.phpenv/versions/*/sbin/*
5963
- rm $HOME/.phpenv/versions/*/bin/php-cgi
@@ -72,8 +76,13 @@ env:
7276
# As of 07/2015 this value works best in a Travis CI container.
7377
- VT_GO_PARALLEL_VALUE=4
7478
- PATH="$HOME/.phpenv/bin:$PATH"
75-
# Add -follow to TEST_FLAGS below to print as the test runs, to diagnose stuck tests.
76-
- TEST_FLAGS="-docker=false -timeout=5m -print-log -remote-stats=http://enisoc.com:15123/travis/stats"
79+
# Note: The per test timeout must always be < 10 minutes because test.go
80+
# does not produce any log output while running and Travis kills a
81+
# build after 10 minutes without log output.
82+
# See: https://docs.travis-ci.com/user/customizing-the-build#Build-Timeouts
83+
# To diagnose stuck tests, add "-follow" to TEST_FLAGS below. Then test.go
84+
# will print the test's output.
85+
- TEST_FLAGS="-docker=false -timeout=8m -print-log -remote-stats=http://enisoc.com:15123/travis/stats"
7786
- CC=gcc-4.8
7887
- CXX=g++-4.8
7988
# TODO: uncomment when php crashing is fixed
@@ -101,11 +110,13 @@ before_script:
101110
- source dev.env
102111
# Travis only tests. Run only on the first shard.
103112
# Part of "before_script" because in "script" the job would not fail immediately if a command fails.
104-
# Webdriver tests are only on the last shard for non PRs. Start Sauce Connect only on this shard.
105113
- |
106114
if [[ $TEST_MATRIX = *"-shard 0"* ]]; then
107115
travis/check_make_proto.sh
108-
elif [[ $TEST_MATRIX = *"-shard 4"* && $TRAVIS_PULL_REQUEST = "false" ]]; then
116+
fi
117+
# Webdriver tests are only on the last shard for non PRs. Start Sauce Connect only on this shard.
118+
- |
119+
if [[ $TEST_MATRIX = *"-shard 4"* && $TRAVIS_PULL_REQUEST = "false" ]]; then
109120
tools/sauce_connect_setup.sh
110121
fi
111122
script:

Makefile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,17 @@ endif
3030
build_web:
3131
echo $$(date): Building web artifacts
3232
cd web/vtctld2 && ng build -prod
33+
cp -f web/vtctld2/src/{favicon.ico,plotly-latest.min.js,primeui-ng-all.min.css} web/vtctld2/dist/
3334

3435
build:
3536
ifndef NOBANNER
3637
echo $$(date): Building source tree
3738
endif
3839
go install $(VT_GO_PARALLEL) -ldflags "$(tools/build_version_flags.sh)" ./go/...
3940

41+
parser:
42+
make -C go/vt/sqlparser
43+
4044
# To pass extra flags, run test.go manually.
4145
# For example: go run test.go -docker=false -- --extra-flag
4246
# For more info see: go run test.go -help
@@ -69,11 +73,6 @@ unit_test_cover: build
6973
unit_test_race: build
7074
tools/unit_test_race.sh
7175

72-
# Run coverage and upload to coveralls.io.
73-
# Requires the secret COVERALLS_TOKEN env variable to be set.
74-
unit_test_goveralls: build
75-
travis/goveralls.sh
76-
7776
.ONESHELL:
7877
SHELL = /bin/bash
7978

@@ -105,7 +104,7 @@ PROTOC_EXISTS := $(shell type -p $(PROTOC_DIR)/protoc)
105104
ifeq (,$(PROTOC_EXISTS))
106105
PROTOC_BINARY := $(shell which protoc)
107106
ifeq (,$(PROTOC_BINARY))
108-
$(error "Cannot find protoc binary. Did you execute 'source dev.env'?")
107+
$(error "Cannot find protoc binary. Did bootstrap.sh succeed, and did you execute 'source dev.env'?")
109108
endif
110109
PROTOC_DIR := $(dir $(PROTOC_BINARY))
111110
endif
@@ -175,7 +174,7 @@ docker_base:
175174

176175
docker_base_mysql56:
177176
chmod -R o=g *
178-
docker build -f Dockerfile.percona -t vitess/base:mysql56 .
177+
docker build -f Dockerfile.mysql56 -t vitess/base:mysql56 .
179178

180179
docker_base_mariadb:
181180
chmod -R o=g *

bootstrap.sh

Lines changed: 53 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ if [ -f $zk_dist/.build_finished ]; then
4545
else
4646
rm -rf $zk_dist
4747
(cd $VTROOT/dist && \
48-
wget http://archive.apache.org/dist/zookeeper/zookeeper-$zk_ver/zookeeper-$zk_ver.tar.gz && \
48+
wget http://apache.org/dist/zookeeper/zookeeper-$zk_ver/zookeeper-$zk_ver.tar.gz && \
4949
tar -xzf zookeeper-$zk_ver.tar.gz && \
5050
mkdir -p $zk_dist/lib && \
5151
cp zookeeper-$zk_ver/contrib/fatjar/zookeeper-$zk_ver-fatjar.jar $zk_dist/lib && \
@@ -54,6 +54,42 @@ else
5454
touch $zk_dist/.build_finished
5555
fi
5656

57+
# Download and install etcd, link etcd binary into our root.
58+
etcd_version=v3.1.0-rc.1
59+
etcd_dist=$VTROOT/dist/etcd
60+
etcd_version_file=$etcd_dist/version
61+
if [[ -f $etcd_version_file && "$(cat $etcd_version_file)" == "$etcd_version" ]]; then
62+
echo "skipping etcd install. remove $etcd_version_file to force re-install."
63+
else
64+
rm -rf $etcd_dist
65+
mkdir -p $etcd_dist
66+
download_url=https://github.com/coreos/etcd/releases/download
67+
(cd $etcd_dist && \
68+
wget ${download_url}/${etcd_version}/etcd-${etcd_version}-linux-amd64.tar.gz && \
69+
tar xzf etcd-${etcd_version}-linux-amd64.tar.gz)
70+
[ $? -eq 0 ] || fail "etcd download failed"
71+
echo "$etcd_version" > $etcd_version_file
72+
fi
73+
ln -snf $etcd_dist/etcd-${etcd_version}-linux-amd64/etcd $VTROOT/bin/etcd
74+
75+
# Download and install consul, link consul binary into our root.
76+
consul_version=0.7.2
77+
consul_dist=$VTROOT/dist/consul
78+
consul_version_file=$consul_dist/version
79+
if [[ -f $consul_version_file && "$(cat $consul_version_file)" == "$consul_version" ]]; then
80+
echo "skipping consul install. remove $consul_version_file to force re-install."
81+
else
82+
rm -rf $consul_dist
83+
mkdir -p $consul_dist
84+
download_url=https://releases.hashicorp.com/consul
85+
(cd $consul_dist && \
86+
wget ${download_url}/${consul_version}/consul_${consul_version}_linux_amd64.zip && \
87+
unzip consul_${consul_version}_linux_amd64.zip)
88+
[ $? -eq 0 ] || fail "consul download failed"
89+
echo "$consul_version" > $consul_version_file
90+
fi
91+
ln -snf $consul_dist/consul $VTROOT/bin/consul
92+
5793
# install gRPC C++ base, so we can install the python adapters.
5894
# this also installs protobufs
5995
grpc_dist=$VTROOT/dist/grpc
@@ -93,16 +129,17 @@ fi
93129
#
94130
# DO NOT ADD LIBRARY DEPENDENCIES HERE. Instead use govendor as described below.
95131
#
132+
# Note: We explicitly do not vendor the tools below because a) we want to stay
133+
# their latest version and b) it's easier to "go install" them this way.
96134
gotools=" \
97135
github.com/golang/lint/golint \
98136
github.com/golang/mock/mockgen \
99137
github.com/kardianos/govendor \
100138
golang.org/x/tools/cmd/goimports \
101-
honnef.co/go/unused/cmd/unused \
139+
golang.org/x/tools/cmd/goyacc \
140+
honnef.co/go/tools/cmd/unused \
102141
"
103142

104-
# Tools for uploading code coverage to coveralls.io (used by Travis CI).
105-
gotools+=" github.com/modocache/gover github.com/mattn/goveralls"
106143
# The cover tool needs to be installed into the Go toolchain, so it will fail
107144
# if Go is installed somewhere that requires root access.
108145
source tools/shell_functions.inc
@@ -135,6 +172,8 @@ ln -snf $VTTOP/data $VTROOT/data
135172
ln -snf $VTTOP/py $VTROOT/py-vtdb
136173
ln -snf $VTTOP/go/zk/zkctl/zksrv.sh $VTROOT/bin/zksrv.sh
137174
ln -snf $VTTOP/test/vthook-test.sh $VTROOT/vthook/test.sh
175+
ln -snf $VTTOP/test/vthook-test_backup_error $VTROOT/vthook/test_backup_error
176+
ln -snf $VTTOP/test/vthook-test_backup_transform $VTROOT/vthook/test_backup_transform
138177

139178
# find mysql and prepare to use libmysqlclient
140179
if [ -z "$MYSQL_FLAVOR" ]; then
@@ -197,25 +236,29 @@ else
197236
cd $VTTOP/third_party/py && \
198237
tar -xzf mock-1.0.1.tar.gz && \
199238
cd mock-1.0.1 && \
200-
python ./setup.py install --prefix=$mock_dist && \
239+
$PYTHON ./setup.py install --prefix=$mock_dist && \
201240
touch $mock_dist/.build_finished && \
202241
cd .. && \
203242
rm -r mock-1.0.1
204243
fi
205244

206-
# create pre-commit hooks
207-
echo "creating git pre-commit hooks"
245+
# Create the Git hooks.
246+
echo "creating git hooks"
208247
mkdir -p $VTTOP/.git/hooks
209248
ln -sf $VTTOP/misc/git/pre-commit $VTTOP/.git/hooks/pre-commit
249+
ln -sf $VTTOP/misc/git/prepare-commit-msg.bugnumber $VTTOP/.git/hooks/prepare-commit-msg
250+
ln -sf $VTTOP/misc/git/commit-msg.bugnumber $VTTOP/.git/hooks/commit-msg
251+
(cd $VTTOP && git config core.hooksPath $VTTOP/.git/hooks)
210252

211253
# Download chromedriver
212254
echo "Installing selenium and chromedriver"
213255
selenium_dist=$VTROOT/dist/selenium
214256
mkdir -p $selenium_dist
215-
virtualenv $selenium_dist
216-
$selenium_dist/bin/pip install selenium
257+
$VIRTUALENV $selenium_dist
258+
PIP=$selenium_dist/bin/pip
259+
$PIP install selenium
217260
mkdir -p $VTROOT/dist/chromedriver
218-
curl -sL http://chromedriver.storage.googleapis.com/2.24/chromedriver_linux64.zip > chromedriver_linux64.zip
261+
curl -sL http://chromedriver.storage.googleapis.com/2.25/chromedriver_linux64.zip > chromedriver_linux64.zip
219262
unzip -o -q chromedriver_linux64.zip -d $VTROOT/dist/chromedriver
220263
rm chromedriver_linux64.zip
221264

config/mycnf/rbr.cnf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
binlog-format=row
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"LdapServer": "ldap.example.com:386",
3+
"LdapCert": "path/to/ldap-client-cert.pem",
4+
"LdapKey": "path/to/ldap-client-key.pem",
5+
"LdapCA": "path/to/ldap-client-ca.pem",
6+
"User": "uid=vitessROuser,ou=users,ou=people,dc=example,dc=com",
7+
"Password": "sUpErSeCuRe1",
8+
"GroupQuery": "ou=groups,ou=people,dc=example,dc=com",
9+
"UserDnPattern": "uid=%s,ou=users,ou=people,dc=example,dc=com",
10+
"RefreshSeconds": 300
11+
}

data/test/tabletserver/ddl_cases.txt

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
"Action": "drop", "TableName": "b"
99
}
1010

11+
"drop table b.c"
12+
{
13+
"Action": "drop", "TableName": "b.c"
14+
}
15+
1116
"alter table c alter foo"
1217
{
1318
"Action": "alter", "TableName": "c", "NewTable": "c"
@@ -18,16 +23,31 @@
1823
"Action": "alter", "TableName": "c", "NewTable": "c"
1924
}
2025

26+
"alter table b.c comment 'aa'"
27+
{
28+
"Action": "alter", "TableName": "b.c", "NewTable": "b.c"
29+
}
30+
2131
"drop index a on b"
2232
{
2333
"Action": "alter", "TableName": "b", "NewName": "b"
2434
}
2535

36+
"drop index a on b.c"
37+
{
38+
"Action": "alter", "TableName": "b.c", "NewName": "b.c"
39+
}
40+
2641
"rename table a to b"
2742
{
2843
"Action": "rename", "TableName": "a", "NewTable": "b"
2944
}
3045

46+
"rename table c.a to c.b"
47+
{
48+
"Action": "rename", "TableName": "c.a", "NewTable": "c.b"
49+
}
50+
3151
"alter table a rename b"
3252
{
3353
"Action": "rename", "TableName": "a", "NewTable": "b"
@@ -38,12 +58,17 @@
3858
"Action": "rename", "TableName": "a", "NewTable": "b"
3959
}
4060

61+
"alter table c.a rename to c.b"
62+
{
63+
"Action": "rename", "TableName": "c.a", "NewTable": "c.b"
64+
}
65+
4166
"create view a asdasd"
4267
{
4368
"Action": "create", "NewName": "a"
4469
}
4570

46-
"alter view c alter foo"
71+
"alter view c as foo"
4772
{
4873
"Action": "alter", "TableName": "c", "NewTable": "c"
4974
}

0 commit comments

Comments
 (0)