Skip to content

Commit

Permalink
Merge branch 'master' into fix_bug_8700
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewDi authored Jan 4, 2019
2 parents ee90ad0 + 7ee6811 commit 31bac51
Show file tree
Hide file tree
Showing 89 changed files with 2,943 additions and 916 deletions.
12 changes: 10 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,18 @@ language: go
go_import_path: github.com/pingcap/tidb

go:
- "1.11.2"
- "1.11.3"

env:
- TRAVIS_COVERAGE=0
- TRAVIS_COVERAGE=1

# Run coverage tests.
matrix:
fast_finish: true
allow_failures:
- go: "1.11.3"
env: TRAVIS_COVERAGE=1

before_install:
# create /logs/unit-test for unit test.
Expand All @@ -15,4 +23,4 @@ before_install:
# See https://github.com/golang/go/issues/12933
- bash gitcookie.sh
script:
- make dev
- make dev upload-coverage
16 changes: 10 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ export PATH := $(path_to_add):$(PATH)
GO := GO111MODULE=on go
GOBUILD := CGO_ENABLED=0 $(GO) build $(BUILD_FLAG)
GOTEST := CGO_ENABLED=1 $(GO) test -p 3
OVERALLS := CGO_ENABLED=1 overalls
GOVERALLS := goveralls
OVERALLS := CGO_ENABLED=1 GO111MODULE=on overalls

ARCH := "`uname -s`"
LINUX := "Linux"
Expand Down Expand Up @@ -117,6 +116,13 @@ test: checklist checkdep gotest explaintest
explaintest: server
@cd cmd/explaintest && ./run-tests.sh -s ../../bin/tidb-server

upload-coverage: SHELL:=/bin/bash
upload-coverage:
ifeq ("$(TRAVIS_COVERAGE)", "1")
mv overalls.coverprofile coverage.txt
bash <(curl -s https://codecov.io/bash)
endif

gotest:
@rm -rf $GOPATH/bin/gofail
$(GO) get github.com/pingcap/gofail
Expand All @@ -125,10 +131,8 @@ gotest:
ifeq ("$(TRAVIS_COVERAGE)", "1")
@echo "Running in TRAVIS_COVERAGE mode."
@export log_level=error; \
go get github.com/go-playground/overalls
go get github.com/mattn/goveralls
$(OVERALLS) -project=github.com/pingcap/tidb -covermode=count -ignore='.git,vendor,cmd,docs,LICENSES' || { $(GOFAIL_DISABLE); exit 1; }
$(GOVERALLS) -service=travis-ci -coverprofile=overalls.coverprofile || { $(GOFAIL_DISABLE); exit 1; }
$(GO) get github.com/go-playground/overalls
$(OVERALLS) -project=github.com/pingcap/tidb -covermode=count -ignore='.git,vendor,cmd,docs,LICENSES' -concurrency=1 || { $(GOFAIL_DISABLE); exit 1; }
else
@echo "Running in native mode."
@export log_level=error; \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Go Report Card](https://goreportcard.com/badge/github.com/pingcap/tidb)](https://goreportcard.com/report/github.com/pingcap/tidb)
![GitHub release](https://img.shields.io/github/release/pingcap/tidb.svg)
[![CircleCI Status](https://circleci.com/gh/pingcap/tidb.svg?style=shield)](https://circleci.com/gh/pingcap/tidb)
[![Coverage Status](https://coveralls.io/repos/github/pingcap/tidb/badge.svg?branch=master)](https://coveralls.io/github/pingcap/tidb?branch=master)
[![Coverage Status](https://codecov.io/gh/pingcap/tidb/branch/master/graph/badge.svg)](https://codecov.io/gh/pingcap/tidb)

## What is TiDB?

Expand Down
44 changes: 24 additions & 20 deletions cmd/explaintest/r/explain_complex.result
Original file line number Diff line number Diff line change
Expand Up @@ -179,23 +179,27 @@ CREATE TABLE `tbl_008` (`a` int, `b` int);
CREATE TABLE `tbl_009` (`a` int, `b` int);
explain select sum(a) from (select * from tbl_001 union all select * from tbl_002 union all select * from tbl_003 union all select * from tbl_004 union all select * from tbl_005 union all select * from tbl_006 union all select * from tbl_007 union all select * from tbl_008 union all select * from tbl_009) x group by b;
id count task operator info
HashAgg_34 72000.00 root group by:x.b, funcs:sum(x.a)
└─Union_35 90000.00 root
├─TableReader_38 10000.00 root data:TableScan_37
│ └─TableScan_37 10000.00 cop table:tbl_001, range:[-inf,+inf], keep order:false, stats:pseudo
├─TableReader_41 10000.00 root data:TableScan_40
│ └─TableScan_40 10000.00 cop table:tbl_002, range:[-inf,+inf], keep order:false, stats:pseudo
├─TableReader_44 10000.00 root data:TableScan_43
│ └─TableScan_43 10000.00 cop table:tbl_003, range:[-inf,+inf], keep order:false, stats:pseudo
├─TableReader_47 10000.00 root data:TableScan_46
│ └─TableScan_46 10000.00 cop table:tbl_004, range:[-inf,+inf], keep order:false, stats:pseudo
├─TableReader_50 10000.00 root data:TableScan_49
│ └─TableScan_49 10000.00 cop table:tbl_005, range:[-inf,+inf], keep order:false, stats:pseudo
├─TableReader_53 10000.00 root data:TableScan_52
│ └─TableScan_52 10000.00 cop table:tbl_006, range:[-inf,+inf], keep order:false, stats:pseudo
├─TableReader_56 10000.00 root data:TableScan_55
│ └─TableScan_55 10000.00 cop table:tbl_007, range:[-inf,+inf], keep order:false, stats:pseudo
├─TableReader_59 10000.00 root data:TableScan_58
│ └─TableScan_58 10000.00 cop table:tbl_008, range:[-inf,+inf], keep order:false, stats:pseudo
└─TableReader_62 10000.00 root data:TableScan_61
└─TableScan_61 10000.00 cop table:tbl_009, range:[-inf,+inf], keep order:false, stats:pseudo
HashAgg_34 72000.00 root group by:col_1, funcs:sum(col_0)
└─Projection_63 90000.00 root cast(x.a), x.b
└─Union_35 90000.00 root
├─TableReader_38 10000.00 root data:TableScan_37
│ └─TableScan_37 10000.00 cop table:tbl_001, range:[-inf,+inf], keep order:false, stats:pseudo
├─TableReader_41 10000.00 root data:TableScan_40
│ └─TableScan_40 10000.00 cop table:tbl_002, range:[-inf,+inf], keep order:false, stats:pseudo
├─TableReader_44 10000.00 root data:TableScan_43
│ └─TableScan_43 10000.00 cop table:tbl_003, range:[-inf,+inf], keep order:false, stats:pseudo
├─TableReader_47 10000.00 root data:TableScan_46
│ └─TableScan_46 10000.00 cop table:tbl_004, range:[-inf,+inf], keep order:false, stats:pseudo
├─TableReader_50 10000.00 root data:TableScan_49
│ └─TableScan_49 10000.00 cop table:tbl_005, range:[-inf,+inf], keep order:false, stats:pseudo
├─TableReader_53 10000.00 root data:TableScan_52
│ └─TableScan_52 10000.00 cop table:tbl_006, range:[-inf,+inf], keep order:false, stats:pseudo
├─TableReader_56 10000.00 root data:TableScan_55
│ └─TableScan_55 10000.00 cop table:tbl_007, range:[-inf,+inf], keep order:false, stats:pseudo
├─TableReader_59 10000.00 root data:TableScan_58
│ └─TableScan_58 10000.00 cop table:tbl_008, range:[-inf,+inf], keep order:false, stats:pseudo
└─TableReader_62 10000.00 root data:TableScan_61
└─TableScan_61 10000.00 cop table:tbl_009, range:[-inf,+inf], keep order:false, stats:pseudo



44 changes: 24 additions & 20 deletions cmd/explaintest/r/explain_complex_stats.result
Original file line number Diff line number Diff line change
Expand Up @@ -205,23 +205,27 @@ CREATE TABLE tbl_009 (a int, b int);
load stats 's/explain_complex_stats_tbl_009.json';
explain select sum(a) from (select * from tbl_001 union all select * from tbl_002 union all select * from tbl_003 union all select * from tbl_004 union all select * from tbl_005 union all select * from tbl_006 union all select * from tbl_007 union all select * from tbl_008 union all select * from tbl_009) x group by b;
id count task operator info
HashAgg_34 18000.00 root group by:x.b, funcs:sum(x.a)
└─Union_35 18000.00 root
├─TableReader_38 2000.00 root data:TableScan_37
│ └─TableScan_37 2000.00 cop table:tbl_001, range:[-inf,+inf], keep order:false
├─TableReader_41 2000.00 root data:TableScan_40
│ └─TableScan_40 2000.00 cop table:tbl_002, range:[-inf,+inf], keep order:false
├─TableReader_44 2000.00 root data:TableScan_43
│ └─TableScan_43 2000.00 cop table:tbl_003, range:[-inf,+inf], keep order:false
├─TableReader_47 2000.00 root data:TableScan_46
│ └─TableScan_46 2000.00 cop table:tbl_004, range:[-inf,+inf], keep order:false
├─TableReader_50 2000.00 root data:TableScan_49
│ └─TableScan_49 2000.00 cop table:tbl_005, range:[-inf,+inf], keep order:false
├─TableReader_53 2000.00 root data:TableScan_52
│ └─TableScan_52 2000.00 cop table:tbl_006, range:[-inf,+inf], keep order:false
├─TableReader_56 2000.00 root data:TableScan_55
│ └─TableScan_55 2000.00 cop table:tbl_007, range:[-inf,+inf], keep order:false
├─TableReader_59 2000.00 root data:TableScan_58
│ └─TableScan_58 2000.00 cop table:tbl_008, range:[-inf,+inf], keep order:false
└─TableReader_62 2000.00 root data:TableScan_61
└─TableScan_61 2000.00 cop table:tbl_009, range:[-inf,+inf], keep order:false
HashAgg_34 18000.00 root group by:col_1, funcs:sum(col_0)
└─Projection_63 18000.00 root cast(x.a), x.b
└─Union_35 18000.00 root
├─TableReader_38 2000.00 root data:TableScan_37
│ └─TableScan_37 2000.00 cop table:tbl_001, range:[-inf,+inf], keep order:false
├─TableReader_41 2000.00 root data:TableScan_40
│ └─TableScan_40 2000.00 cop table:tbl_002, range:[-inf,+inf], keep order:false
├─TableReader_44 2000.00 root data:TableScan_43
│ └─TableScan_43 2000.00 cop table:tbl_003, range:[-inf,+inf], keep order:false
├─TableReader_47 2000.00 root data:TableScan_46
│ └─TableScan_46 2000.00 cop table:tbl_004, range:[-inf,+inf], keep order:false
├─TableReader_50 2000.00 root data:TableScan_49
│ └─TableScan_49 2000.00 cop table:tbl_005, range:[-inf,+inf], keep order:false
├─TableReader_53 2000.00 root data:TableScan_52
│ └─TableScan_52 2000.00 cop table:tbl_006, range:[-inf,+inf], keep order:false
├─TableReader_56 2000.00 root data:TableScan_55
│ └─TableScan_55 2000.00 cop table:tbl_007, range:[-inf,+inf], keep order:false
├─TableReader_59 2000.00 root data:TableScan_58
│ └─TableScan_58 2000.00 cop table:tbl_008, range:[-inf,+inf], keep order:false
└─TableReader_62 2000.00 root data:TableScan_61
└─TableScan_61 2000.00 cop table:tbl_009, range:[-inf,+inf], keep order:false



44 changes: 24 additions & 20 deletions cmd/explaintest/r/explain_easy.result
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,13 @@ TableReader_7 0.33 root data:Selection_6
└─TableScan_5 1.00 cop table:t1, range:[1,1], keep order:false, stats:pseudo
explain select sum(t1.c1 in (select c1 from t2)) from t1;
id count task operator info
StreamAgg_12 1.00 root funcs:sum(5_aux_0)
└─MergeJoin_28 10000.00 root left outer semi join, left key:test.t1.c1, right key:test.t2.c1
├─TableReader_19 10000.00 root data:TableScan_18
│ └─TableScan_18 10000.00 cop table:t1, range:[-inf,+inf], keep order:true, stats:pseudo
└─IndexReader_23 10000.00 root index:IndexScan_22
└─IndexScan_22 10000.00 cop table:t2, index:c1, range:[NULL,+inf], keep order:true, stats:pseudo
StreamAgg_12 1.00 root funcs:sum(col_0)
└─Projection_35 10000.00 root cast(5_aux_0)
└─MergeJoin_28 10000.00 root left outer semi join, left key:test.t1.c1, right key:test.t2.c1
├─TableReader_19 10000.00 root data:TableScan_18
│ └─TableScan_18 10000.00 cop table:t1, range:[-inf,+inf], keep order:true, stats:pseudo
└─IndexReader_23 10000.00 root index:IndexScan_22
└─IndexScan_22 10000.00 cop table:t2, index:c1, range:[NULL,+inf], keep order:true, stats:pseudo
explain select c1 from t1 where c1 in (select c2 from t2);
id count task operator info
Projection_9 10000.00 root test.t1.c1
Expand Down Expand Up @@ -190,12 +191,13 @@ HashAgg_18 24000.00 root group by:c1, funcs:firstrow(join_agg_0)
set @@session.tidb_opt_insubq_to_join_and_agg=0;
explain select sum(t1.c1 in (select c1 from t2)) from t1;
id count task operator info
StreamAgg_12 1.00 root funcs:sum(5_aux_0)
└─MergeJoin_28 10000.00 root left outer semi join, left key:test.t1.c1, right key:test.t2.c1
├─TableReader_19 10000.00 root data:TableScan_18
│ └─TableScan_18 10000.00 cop table:t1, range:[-inf,+inf], keep order:true, stats:pseudo
└─IndexReader_23 10000.00 root index:IndexScan_22
└─IndexScan_22 10000.00 cop table:t2, index:c1, range:[NULL,+inf], keep order:true, stats:pseudo
StreamAgg_12 1.00 root funcs:sum(col_0)
└─Projection_35 10000.00 root cast(5_aux_0)
└─MergeJoin_28 10000.00 root left outer semi join, left key:test.t1.c1, right key:test.t2.c1
├─TableReader_19 10000.00 root data:TableScan_18
│ └─TableScan_18 10000.00 cop table:t1, range:[-inf,+inf], keep order:true, stats:pseudo
└─IndexReader_23 10000.00 root index:IndexScan_22
└─IndexScan_22 10000.00 cop table:t2, index:c1, range:[NULL,+inf], keep order:true, stats:pseudo
explain select 1 in (select c2 from t2) from t1;
id count task operator info
Projection_6 10000.00 root 5_aux_0
Expand All @@ -207,13 +209,14 @@ Projection_6 10000.00 root 5_aux_0
└─TableScan_10 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo
explain select sum(6 in (select c2 from t2)) from t1;
id count task operator info
StreamAgg_12 1.00 root funcs:sum(5_aux_0)
└─HashLeftJoin_19 10000.00 root left outer semi join, inner:TableReader_18
├─TableReader_21 10000.00 root data:TableScan_20
│ └─TableScan_20 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo
└─TableReader_18 10.00 root data:Selection_17
└─Selection_17 10.00 cop eq(6, test.t2.c2)
└─TableScan_16 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo
StreamAgg_12 1.00 root funcs:sum(col_0)
└─Projection_22 10000.00 root cast(5_aux_0)
└─HashLeftJoin_19 10000.00 root left outer semi join, inner:TableReader_18
├─TableReader_21 10000.00 root data:TableScan_20
│ └─TableScan_20 10000.00 cop table:t1, range:[-inf,+inf], keep order:false, stats:pseudo
└─TableReader_18 10.00 root data:Selection_17
└─Selection_17 10.00 cop eq(6, test.t2.c2)
└─TableScan_16 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo
explain format="dot" select sum(t1.c1 in (select c1 from t2)) from t1;
dot contents

Expand All @@ -222,7 +225,8 @@ subgraph cluster12{
node [style=filled, color=lightgrey]
color=black
label = "root"
"StreamAgg_12" -> "MergeJoin_28"
"StreamAgg_12" -> "Projection_35"
"Projection_35" -> "MergeJoin_28"
"MergeJoin_28" -> "TableReader_19"
"MergeJoin_28" -> "IndexReader_23"
}
Expand Down
Loading

0 comments on commit 31bac51

Please sign in to comment.