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

server: fix potential goroutine leak when kill connection (#13051) #13250

Closed
wants to merge 384 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
384 commits
Select commit Hold shift + click to select a range
6baed7d
*: refine text protocol multiple query response (#11290)
sre-bot Jul 17, 2019
b9b6c97
*: fix microseconds behaviour in DATE_ADD() (#11280) (#11288)
sre-bot Jul 18, 2019
bbfb4ec
metrics: add missing TiKVTxnCmdCounter (#11292) (#11316)
sre-bot Jul 18, 2019
07120a1
CHANGELOG: add release notes for v3.0.1 (#11282)
winkyao Jul 18, 2019
7ef017f
planner: fix NAME_CONST function compatibility (#11241) (#11268)
sre-bot Jul 18, 2019
3d7da06
plugin: add "exec start-time" to GeneralEvent (#11293) (#11322)
sre-bot Jul 18, 2019
13aa832
expression: fix getIntervalFromDecimal in DATE_ADD() (#11297) (#11325)
sre-bot Jul 18, 2019
a52cfff
owner: improve unit tests code coverage (#10792) (#11030)
zimulala Jul 18, 2019
ffe55b8
ddl: refine error messages in unsupported column options (#110… (#11274)
tangenta Jul 19, 2019
2348c75
expression, types: fix Mod(%), Multiple(*), Minus(-) operators… (#11354)
SunRunAway Jul 22, 2019
8dd4a27
store/tikv: refine streaming client re-create log and use a sm… (#11370)
tiancaiamao Jul 22, 2019
5847d3a
store/tikv: reduce the lock contend between sending message an… (#11372)
tiancaiamao Jul 23, 2019
e8d254a
expression: add max_allowed_packet check in concat/concat_ws (… (#11275)
sre-bot Jul 23, 2019
f8662a2
ddl: fix the parallel problem of "set default value" and other… (#11346)
sre-bot Jul 23, 2019
db533f5
planner: fix bugs related to TIDB_INLJ hint (#11253) (#11362)
sre-bot Jul 23, 2019
91ae309
expression: let `testEvaluatorSuite` run serially to avoid aff… (#11366)
qw4990 Jul 23, 2019
8de0fd6
planner: correct the generation of the field name (#11324) (#11379)
sre-bot Jul 23, 2019
e6372f5
Function SUBTIME ADDTIME should return NULL with a warning if… (#11337)
sre-bot Jul 23, 2019
aa4b386
CONVERT_TZ should return NULL if its arguments are invalid. (#… (#11359)
SunRunAway Jul 23, 2019
02527cf
infoschema: fix compatibility of auto_increment column value o… (#11413)
sre-bot Jul 24, 2019
5d5dfcd
ddl: add check for max index key length when alter modify/change col…
sre-bot Jul 24, 2019
68acdce
planner: reject invalid conversion from like to = (#11320) (#11411)
sre-bot Jul 24, 2019
cfcd4db
infochema, server: export region_id in hot_region table (#1098… (#11350)
lysu Jul 25, 2019
da97861
executor: show operators' memory consumption in results of `EXPLAIN A…
qw4990 Jul 25, 2019
37cf597
executor: show `CARTESIAN Join` explicitly in the results of `… (#11429)
qw4990 Jul 25, 2019
f375c91
*: add succ filed to slow log and fix shallow copy problem when pars…
crazycs520 Jul 25, 2019
a79a86e
store/helper: remove timeout for fetch diagnose from info pd (#11383)
sre-bot Jul 25, 2019
709ee4f
fix a coding mistake (#11400)
sre-bot Jul 25, 2019
fdaee60
types: fix uint64 overflow bug in `ConvertJSONToFloat` (#11355) (#11433)
sre-bot Jul 25, 2019
5bb3c06
executor: fix autoid doesn't handle float, double type and tiny clean…
lzmhhh123 Jul 26, 2019
0dd6760
planner: support subquery in `SHOW` statement (#10942) (#11459)
eurekaka Jul 26, 2019
e743395
stats: fix panic when dump pseudo columns (#11460)
sre-bot Jul 26, 2019
ece299d
expression, session: handle `CASE WHEN` specially when folding… (#11441)
lovewin99 Jul 26, 2019
1124627
ddl: disallow dropping index on auto_increment column (#11360) (#11399)
tangenta Jul 26, 2019
8497868
types: floatStrToIntStr will failed in some case such as the p… (#11473)
H-ZeX Jul 27, 2019
2902a08
server: handle partitioned table in some http APIs (#11463) (#11466)
sre-bot Jul 27, 2019
6766735
expression: handle builtin add_date/sub_date func overflow (#1… (#11476)
sre-bot Jul 27, 2019
384be78
types: fix string to integer cast (#11295) (#11469)
amyangfei Jul 29, 2019
58aae12
metrics: add metrics for bind info (#10921) (#11467)
sre-bot Jul 29, 2019
aede000
planner: fix bugs and make it more effective in outer join eliminatio…
lzmhhh123 Jul 29, 2019
9155e55
kvcache: fix unit test by avoiding lru OOM. (#10768) (#11490)
sre-bot Jul 29, 2019
69727fd
fix http handler ut (#11495)
sre-bot Jul 29, 2019
133bb08
expression: make `regex binary` and `rlike binary` be case sen… (#11504)
sre-bot Jul 29, 2019
29210b9
DDL: fix a bug in column charset and collate when create table… (#11492)
AilinKid Jul 29, 2019
0d2ea4b
executor, privilege: fix some two bug of RBAC (#11273) (#11356)
sre-bot Jul 30, 2019
40ef5e1
http: fix scatter table (#11281) (#11298)
sre-bot Jul 30, 2019
aeeeb15
tikv: invalidate store's regions when send store fail (#11344) (#11498)
lysu Jul 30, 2019
761ba58
stats: handle feedback updates for topn items (#11507)
sre-bot Jul 30, 2019
c71adf9
expression: improve the compatibility with mysql when datatime… (#11447)
sre-bot Jul 30, 2019
b96aa43
tikv: stabilize a test case (#11465) (#11522)
jackysp Jul 30, 2019
a93a97a
planner: add table info into context in fast plan case (#11446) (#11457)
sre-bot Jul 30, 2019
39b4cf0
executor/split: return split result when do split region and r… (#11484)
crazycs520 Jul 31, 2019
16a81b6
planner: fix compatibility bug for window function (#11488) (#11543)
lzmhhh123 Jul 31, 2019
46246b3
planner: function name in `ErrWindowInvalidWindowFuncUse` shou… (#11535)
sre-bot Aug 1, 2019
64bf9ad
executor: move failpoint test case to seq test suite (#11525) (#11529)
jackysp Aug 1, 2019
5e27d4f
tikv: make region_request_test stable (#11541) (#11558)
lysu Aug 1, 2019
b90f0dd
fix error in ConvertJSONToInt error msg (#11493) (#11534)
sre-bot Aug 1, 2019
e0d3ea6
expression: improve UT coverage of `expression` package to 80% (#11560)
qw4990 Aug 1, 2019
d523d65
expression: handle builtin time getInterval from Decimal\Real (#11479…
sre-bot Aug 1, 2019
ea52ef5
http: add region-id when getting mvcc by handle (#11436) (#11557)
sre-bot Aug 1, 2019
c15e199
stats: fix estimation for time equal conditions (#11511) (#11512)
sre-bot Aug 1, 2019
2ba7832
*: add trace support for subquery (#11182) (#11458)
tiancaiamao Aug 1, 2019
67a532f
store/tikv, config: increase pessimistic ttl (#11521)
coocood Aug 2, 2019
4cbe840
store/tikv: make test stable by running `TestPanicInRecvLoop` unparal…
sre-bot Aug 2, 2019
540dd06
tikv: forbid to try to get a connection forever (#11391) (#11531)
hicqu Aug 2, 2019
234a610
tikv: invalidate store's regions when store be removed in kv (#11567)…
lysu Aug 2, 2019
9cb903e
planner: fix bug that window function do not check ignore null… (#11593)
sre-bot Aug 5, 2019
785cb24
*: speed up the operation of "admin check table" (#8572) (#11547)
zimulala Aug 5, 2019
9d15c8d
infoschema: fix load drop database schema bug and refine db-table api…
crazycs520 Aug 5, 2019
0cdaee0
server: remove the error stack in logs when connection reset by clien…
sre-bot Aug 5, 2019
5d6bda6
executor: fix baseExecutor'children may not close (#11576)
sre-bot Aug 5, 2019
a91e3a4
ddl: fix invalid index on multi-layer virtual columns (#11260) (#11475)
tangenta Aug 5, 2019
bcf1aac
executor, infoschema: fix display of on update CURRENT_TIMESTAMP with…
sre-bot Aug 5, 2019
2e0d32f
fix ConvertJSONToInt unsigned bug (#11483) (#11551)
sre-bot Aug 5, 2019
b6643fe
expression: fix date_add func in SECOND INTERVAL (#11312) (#11615)
sre-bot Aug 5, 2019
7d1e3e7
ranger: BuildColumnRange should merge ranges when column has p… (#11565)
sre-bot Aug 5, 2019
abf8cea
ddl: fix a bug that adding range partition meets error when va… (#11581)
tiancaiamao Aug 5, 2019
94498e7
executor, expression: fix current_timestamp/now not consistent… (#11394)
cfzjywxk Aug 5, 2019
df0d8c7
expression: deduce result type for multi-argument functions li… (#11621)
sre-bot Aug 5, 2019
1adf63e
stats: fix unstable test (#10953) (#11623)
alivxxx Aug 5, 2019
25c8215
[3.0] ddl: error or skip unsupported partition-related DDLs (#10672)…
kennytm Aug 5, 2019
4fb7f3f
expression: the quote function should treat null expr as NULL literal…
sre-bot Aug 5, 2019
8642e9b
planner/core: give the full schema information when group by fields n…
sre-bot Aug 6, 2019
eca09b1
*: add opt_rule_blacklist in mysql tables. (#11096) (#11658)
lzmhhh123 Aug 7, 2019
b066cba
*: rename tidb_back_off_weight (#11655) (#11665)
jackysp Aug 8, 2019
00801a7
expression: remove the NotNullFlag for aggregation func MAX/MIN when …
SunRunAway Aug 8, 2019
24380b6
executor: make TestShowAnalyzeStatus more stable (#11090) (#11684)
alivxxx Aug 9, 2019
eb6f46a
expression: fix a bug in when comparing bit with string (#11660)
sre-bot Aug 9, 2019
b9a894e
distsql: control the sending rate of copIteratorTaskSender if… (#11679)
SunRunAway Aug 9, 2019
5547dee
expression: remove `fmt.Println` in `constant.EvalJSON` (#11698)
sre-bot Aug 9, 2019
21c5e45
ddl : Fix generated column can refer only to generated columns define…
AilinKid Aug 12, 2019
bfead96
build: use `make testSuite` to ensure all testSuites enabled (#11627)…
sre-bot Aug 12, 2019
5f95ee5
executor: fix auto retry when transaction has select for update state…
sre-bot Aug 12, 2019
59184ca
fix field type error (#11716)
sre-bot Aug 12, 2019
66daa9f
util: update the minimum version of tikv information (#11608) (#11618)
sre-bot Aug 13, 2019
ae8d2f2
expression: remove unnecessary convertIntToUint. fix error in err msg…
sre-bot Aug 13, 2019
c7ee0dd
bindinfo: fix the bind fields with quotes or slashes (#11671) (#11726)
sre-bot Aug 13, 2019
09e10fa
planner/core: check the window func arg first before checking window …
sre-bot Aug 13, 2019
afa2a12
planner: "for update" should not work in a single autocommit s… (#11736)
sre-bot Aug 15, 2019
5dab5e7
metric, tikv: record duration for each backoff type (#11710) (#11728)
sre-bot Aug 16, 2019
43aaf9a
planner: fix uncorrect behavior of index join (#11724) (#11759)
winoros Aug 16, 2019
c3e13a8
CHANGELOG: add release notes for v3.0.2 (#11748)
bb7133 Aug 19, 2019
ec24062
planner/core: fix the 'for update' condition for the point get query …
sre-bot Aug 19, 2019
10ea06a
planner: early break loop if the condition is satisfied (#11768)
sre-bot Aug 20, 2019
7f15d28
expression: fix DIV with decimal type (#11804) (#11813)
sre-bot Aug 21, 2019
48a3574
executor, privileges: fix privileges check fail for `SET DEFAULT ROLE…
Aug 21, 2019
e044829
executor: fix error check in EvalSubquery (#11802) (#11810)
sre-bot Aug 21, 2019
2fcfc73
executor: copy row data instead of refereeing chunk... (#11678) (#11823)
sre-bot Aug 22, 2019
bcd1d44
executor: fix wrong partition boundary for window functions (#11637) …
SunRunAway Aug 22, 2019
1cf66d7
executor: fix panic when execute change pump state (#11827)
WangXiangUSTC Aug 22, 2019
c74c261
executor, privileges: fix privilege check fail for `CREATE USER` and …
Aug 25, 2019
571bfed
tikv: fix TxnSize to be the number of involved keys in the region (#1…
sticnarf Aug 25, 2019
3601f21
tikv: fix wasted sleep and return error in last backoff (#11788) (#11…
lysu Aug 25, 2019
e37d5f9
main : check --config-check should has --config flag specified first.…
AilinKid Aug 27, 2019
2488203
server: fix start ts in slow log when transaction retrying (#11851) (…
jackysp Aug 27, 2019
dfcd94c
sessionctx/variable: change add index variable default value (#11786)…
crazycs520 Aug 27, 2019
af2d78d
types: convert EOF error to ErrTruncate when parse duration (#11865) …
sre-bot Aug 28, 2019
0519992
executor: set the correct stmtCtx for explain statement (#11186) (#11…
XuHuaiyu Aug 28, 2019
7e5b9a7
session: fix log slow log succ field (#11867) (#11887)
sre-bot Aug 28, 2019
836982c
expression: improve length and decimal size when a base type add/minu…
lzmhhh123 Aug 28, 2019
8d865a0
ddl: refine pre-split region logic (#11796)
sre-bot Aug 29, 2019
443cc81
stats: limit the number of top-n items (#11906) (#11914)
alivxxx Aug 29, 2019
c706745
ddl: don't rely on `expression.Column.ColName` (#11255) (#11954)
winoros Aug 30, 2019
1f87310
ddl: fix add unique index on partitioned table (by RANGE COLUMNS) fai…
sre-bot Aug 30, 2019
8b0a453
infoschema,store: fix the inconsitent defination of StoreStatus betwe…
sre-bot Sep 2, 2019
6377a58
executor: split a separate region for index when split table region (…
crazycs520 Sep 2, 2019
2b99cdd
executor: refine the usage of expression blacklist (#11940) (#11975)
XuHuaiyu Sep 2, 2019
ddf2411
expression: fix type infer of unaryMinus which should return ETDecima…
sre-bot Sep 2, 2019
6ba9084
*: add region read/write bytes info and approximate size/keys in show…
crazycs520 Sep 3, 2019
704c451
fix load data rowCount should added first before call colsToRow(). (#…
AilinKid Sep 3, 2019
6e03e1c
*: add release notes for v3.0.3 (#12007)
zimulala Sep 3, 2019
50ded87
dml : fix last insert id when autoid specified by user in first row. …
AilinKid Sep 4, 2019
ff58c3c
*: replace pessimistic default config option with global variable (#1…
coocood Sep 6, 2019
8938907
*: record index name in the slow log instead of index id (#11795) (#1…
crazycs520 Sep 9, 2019
2ebecd4
config: add split-region-max-num in config to control the maximum spl…
crazycs520 Sep 9, 2019
eb62dae
tikvclient: add metrics for gRPC connection transient failure (#12084…
lonng Sep 9, 2019
7f41ed3
config: disable local latch by default (#12095)
sre-bot Sep 9, 2019
24c2ad7
planner: choose TableScan when use an empty index hint (#12100)
francis0407 Sep 10, 2019
7f1f66e
type: add db prefix to function name for not exist error messa… (#12111)
zz-jason Sep 10, 2019
78ed282
planner: generate index path as candidate when it is a single scan (#…
francis0407 Sep 10, 2019
652c2db
planner: don't prune sleep function in LogicalProjection (#11927) (#1…
sre-bot Sep 10, 2019
247f10b
ddl: fix the `modify column` operation on the `bit` column (#12008) (…
sre-bot Sep 10, 2019
34ad8c0
*: change the query start time to the parsing time (#11159) (#12109)
zz-jason Sep 10, 2019
cdf4566
sessionctx/binloginfo: fix uncomment pre_split_regions ddl-querys in …
crazycs520 Sep 10, 2019
820206e
types/json: fix an over-quoted bug in `BinaryJSON.Unquote` function (…
sre-bot Sep 11, 2019
c9346c4
conn: fix lost connection when insert from select panic cause by out …
crazycs520 Sep 11, 2019
da3ed88
parser: update parser for add where for show table region syntax (#12…
crazycs520 Sep 11, 2019
3261e37
sessionctx/variable: refine slow log output by not print useless info…
sre-bot Sep 11, 2019
8a79382
*: record query start time to session variables (#11822) (#12137)
zz-jason Sep 11, 2019
842c81c
ddl: disallow dropping auto_increment column attribute (#12107) (#12145)
tangenta Sep 12, 2019
299da1b
stats: support display invalid key in stats buckets (#12064) (#12094)
sre-bot Sep 12, 2019
ff955ac
*: refactoring the code of batchChecker #12108 (#12141)
tiancaiamao Sep 12, 2019
2a33209
*: record previous statement when commit is slow (#11908) (#12180)
jackysp Sep 12, 2019
1d489fb
stats: do not split excluded lower value ranges (#12009) (#12170)
alivxxx Sep 16, 2019
33db335
meta/autoid : fix the issue that MaxUint64 and MaxInt64 autoID is inc…
sre-bot Sep 16, 2019
2a4ecf9
expression,planner/core: support unix_timestamp() function in partiti…
tiancaiamao Sep 17, 2019
45d7da0
server: add sql to com_exec/com_fetch dispatch error log (#12174) (#1…
sre-bot Sep 17, 2019
a3e1d01
infoschema, session: support for events_statements_summary_by_digest …
djshow832 Sep 23, 2019
f33c908
session, executor: support setting tidb_enable_stmt_summary in sessio…
djshow832 Sep 23, 2019
790b5d5
session: annotate the previous statement to the error when transactio…
jackysp Sep 24, 2019
7e876e1
types: fix a bug of `FromGoTime` when handling rounding (#12258)
tiancaiamao Sep 24, 2019
fb637ba
expression: fix wrong `Flen` when processing `Decimal` and `In… (#12313)
sre-bot Sep 24, 2019
97eec5a
executor: fix unordered trace events in row format (#12314) (#12333)
lucklove Sep 24, 2019
99bc1a3
planner: support PointGet plan when table has alias name (#1270) (#1…
lysu Sep 24, 2019
0106711
tikv: refine commit backoff slow log (#11757) (#12335)
lysu Sep 24, 2019
0511598
executor: record prepared stmt in `handle_query_duration` (#11753) (#…
lysu Sep 24, 2019
0b11559
*: wrap the previous statement for performance (#12283) (#12325)
jackysp Sep 24, 2019
73d5896
planner/core: fix point-get db privilege check (#12268) (#12340)
lysu Sep 24, 2019
54ddd2c
planner/core: fix resolve rule for group by expression (#12307) (#12351)
sre-bot Sep 24, 2019
d013b31
ddl: fix drop index failed when index contain auto_increment column a…
sre-bot Sep 24, 2019
4120985
*: support a region divided into multiple regions and fix scatter reg…
zimulala Sep 25, 2019
7c48202
executor: record slow-log when log use error level (#12359) (#12377)
sre-bot Sep 25, 2019
3716ac5
planner, executor: push limit down into IndexLookUpReader exec… (#12378)
eurekaka Sep 25, 2019
67cf1a3
planner: set windowClause only in WindowFuncExpr #(19956) (#12384)
wjhuang2016 Sep 25, 2019
ca80b7b
*: log each `com_stmt_fetch` separately (#11987) (#12392)
sre-bot Sep 25, 2019
1f7ba4c
tikvclient: adjust log level in store/tikv/client_batch.go (#12302) (…
hicqu Sep 25, 2019
c5fdec7
executor: do not use batchChecker in 'insert ignore into ...' (#12122…
tiancaiamao Sep 25, 2019
b736230
types/data: the bit data type should be treat as uint64 (#1195… (#12423)
sre-bot Sep 27, 2019
694e086
planner: update's select should not change the output columns (#12476…
winoros Sep 29, 2019
b12c4bc
*: implement the TxnHeartBeat API for the large transaction (#11979) …
tiancaiamao Sep 30, 2019
a046953
ddl: fix the set's default value where `create table` (#12267) (#12452)
zimulala Sep 30, 2019
cd579dd
*: adjust delta schema count and add metrics (#11625) (#12502)
zimulala Oct 8, 2019
9807e0a
CHANGELOG: add release notes for v3.0.4 (#12531)
lonng Oct 8, 2019
f0d4985
util, planner: split test data from test cases (#12444)
alivxxx Oct 8, 2019
54b2bfa
*: fix `go mod tidy` in Go1.13 (12055) (#12560)
tiancaiamao Oct 9, 2019
33f76c9
store: update kvrpc.Cleanup proto and change its behaviour #12212 (#1…
tiancaiamao Oct 9, 2019
efc7e50
*: fix panic when check null rejection for `from_unixtime` (#12413) (…
zz-jason Oct 10, 2019
0aa2fd4
ddl: fix incorrect origin default bit value in ColumnInfo (#12168) (#…
sre-bot Oct 10, 2019
96dc595
*: add metrics for tps (#12505)
sre-bot Oct 10, 2019
8a93d6b
executor,sessionctx: add correctness for system variables (#12311) (#…
Oct 10, 2019
32bd4a7
planner: fix unexpected behavior of UPDATE (#12597)
winoros Oct 10, 2019
79bd90d
infoschema: handle partition table for `tables` (#12591) (#12631)
alivxxx Oct 12, 2019
bb644d1
store/tikv: implement a `ttlManager` to update the TTL of a transacti…
tiancaiamao Oct 12, 2019
eb3ee25
Makefile: add `-trim-path` flag for build command (#12653)
zyxbest Oct 12, 2019
95aac16
ddl: allow multiple `unique` attributes in a column (#12165) (#12463)
sre-bot Oct 13, 2019
21b49ac
log: move autocommit varable value into connection info (#12310) (#12…
Oct 13, 2019
4fdfdf8
planner: fix some window specific check bug for window function. (#12…
lzmhhh123 Oct 13, 2019
6596890
* : Multiple rows insert in a statement should have consecutive autoI…
AilinKid Oct 13, 2019
6f8e1ab
util/admin: fix the error of "invalid list index" when cancel ddl job…
sre-bot Oct 13, 2019
6724378
executor: do not return first row until the frame is completed. (#124…
SunRunAway Oct 14, 2019
4956268
planner: handle single partition in IndexJoin correctly (#1258… (#12712)
eurekaka Oct 15, 2019
c39b38e
fix the STR_TO_DATE incompatible between MySQL and TiDB (#12623) (#12…
sre-bot Oct 16, 2019
8d1dfa1
planner: reset NotNull flag for schema of Apply and MaxOneRow properl…
eurekaka Oct 16, 2019
b0ccf68
store/tikv: make cache ttl configurable (#12683)
disksing Oct 16, 2019
8485ccd
Fix forever hanging when HashAgg is called by apply (#12760) (#12766)
SunRunAway Oct 17, 2019
150dd34
executor: revert mostly changes in #11678 (#12481) (#12770)
sre-bot Oct 17, 2019
3cd6e83
planner, expression: fix simplify outer join with cast (#12701) (#12790)
eurekaka Oct 17, 2019
f45c29b
ddl: fix create table check for range columns partition #12622 (#12718)
tiancaiamao Oct 18, 2019
7749430
tikv: non-blocking establish superbatch connection with timeout (#127…
lysu Oct 18, 2019
268d5ae
*: record and print the plan in slow log. (#12179) (#12808)
crazycs520 Oct 18, 2019
399c105
ddl: fix bug that range columns partition table add partitions failed…
crazycs520 Oct 18, 2019
a663cc9
planner: fix constant propagation for AntiSemiJoin (#12728) (#12799)
eurekaka Oct 18, 2019
c6bbf0f
stats: fix shallow copy bugs (#12691) (#12817)
sre-bot Oct 18, 2019
b11578f
*: add a column describing memory usage for table information_schema.…
SunRunAway Oct 18, 2019
93f8151
expression: fix incorrect result of logical operators (#12173) (#12811)
SunRunAway Oct 18, 2019
14097d8
ddl: check column and partition value have same type for range column…
tiancaiamao Oct 18, 2019
67d8fbf
planner: support foreign key choose parent schema as default in Creat…
sre-bot Oct 18, 2019
e1d9f7e
store/tikv: fix data race on idle (#12164) (#12824) (#12846)
sre-bot Oct 21, 2019
dbd61c9
metrics: add index speed metric (#12374) (#12390)
sre-bot Oct 21, 2019
c9000ab
store,kv: snapshot doesn't cache the non-exists kv entries lead to po…
tiancaiamao Oct 23, 2019
8c28d73
make auto id step larger (#12893)
sre-bot Oct 23, 2019
b9632c4
planner/core: do not change window ast when building plan (#12… (#12933)
XuHuaiyu Oct 25, 2019
1019012
planner: unfold the wildcard when creating view (#11818) (#12912)
XuHuaiyu Oct 28, 2019
e69972d
planner, executor: support create view on union (#12595) (#12955)
XuHuaiyu Oct 28, 2019
36d9730
tikv: make requests fail-fast for dial timeouted (#12819) (#12926)
lysu Oct 28, 2019
6e0d18f
planner: stream agg should not be pushed to double read (#12443) (#12…
winoros Oct 28, 2019
e48693b
executor: wait all `fetchChildData` exiting in `HashAggExec.Close` (#…
sre-bot Oct 29, 2019
bdc59e6
store/tikv: tiny refactoring, change `twoPhaseCommitAction` to interf…
tiancaiamao Oct 30, 2019
1211d61
perfschema: support query cpu/memory/mutex/block/allocs/goroutines fl…
lonng Oct 30, 2019
55dbfd6
*: fix bug that the kill command doesn't work when the killed session…
tiancaiamao Oct 30, 2019
fd1953b
main: add `make server_coverage` build option (#11844)(#12152) (#13013)
bb7133 Oct 30, 2019
8d55be9
docker: update go version to 1.13 (#13030)
sre-bot Oct 30, 2019
864213f
executor: fix data race in `GetDirtyTable()` (#12767) (#12901)
lzmhhh123 Oct 30, 2019
5cb5162
tikv: eliminate unnecessary pessimistic rollback (#12561) (#12707)
sre-bot Oct 30, 2019
399e03f
types: invalid year should be 0 (#12715) (#12745)
sre-bot Oct 30, 2019
199d9e3
privileges: refine infoschema privilege check (#13006) (#13028)
sre-bot Oct 30, 2019
8a19ab5
*: add release notes for v3.0.5 (#13038)
zimulala Nov 4, 2019
7939e6f
tikv: fix out-of-index in split-region (#12265) (#13092)
lysu Nov 4, 2019
aa54342
store/tikv: do not backoff when PessimisticLock return locked error (…
tiancaiamao Nov 4, 2019
cdcb4ae
executor: reuse chunk row for insert on duplicate update (#12847) (#1…
jackysp Nov 5, 2019
4809367
tikv: fix init batch client cherry-pick 3.0(#12819) (#13101)
lysu Nov 5, 2019
de39012
config: correct the explanation of status and metrics. (#13024) (#13108)
sre-bot Nov 5, 2019
fa90d57
infoschema/slow_query: add more field in slow_query table (#13007) (#…
sre-bot Nov 5, 2019
16a0358
expression: add builtin function json_valid (#13133)
Reminiscent Nov 5, 2019
c99e6b2
bindinfo: correctly handle quotes for bindings sql (#13115) (#13117)
alivxxx Nov 5, 2019
5df9ff5
ddl : fix column collate should use table's if it has when create tab…
sre-bot Nov 6, 2019
c7b4ae6
Makefile: fix export log_level for gotest (#13197) (#13200)
sre-bot Nov 6, 2019
f0740e3
perfschema: rename TIDB_GOROUTINES to TIDB_PROFILE_GOROUTINES (#13178…
sre-bot Nov 6, 2019
536e259
util/admin: support admin check table on partition table (#12796) (#1…
crazycs520 Nov 7, 2019
c14e8a8
server: fix potential goroutine leak when kill connection (#13051)
SunRunAway Nov 7, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
495 changes: 489 additions & 6 deletions CHANGELOG.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Builder image
FROM golang:1.12-alpine as builder
FROM golang:1.13-alpine as builder

RUN apk add --no-cache \
wget \
Expand Down Expand Up @@ -34,4 +34,4 @@ WORKDIR /

EXPOSE 4000

ENTRYPOINT ["/usr/local/bin/dumb-init", "/tidb-server"]
ENTRYPOINT ["/usr/local/bin/dumb-init", "/tidb-server"]
19 changes: 16 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ path_to_add := $(addsuffix /bin,$(subst :,/bin:,$(GOPATH))):$(PWD)/tools/bin
export PATH := $(path_to_add):$(PATH)

GO := GO111MODULE=on go
GOBUILD := CGO_ENABLED=1 $(GO) build $(BUILD_FLAG)
GOBUILD := CGO_ENABLED=1 $(GO) build $(BUILD_FLAG) -trimpath
GOBUILDCOVERAGE := GOPATH=$(GOPATH) CGO_ENABLED=1 cd tidb-server; $(GO) test -coverpkg="../..." -c .
GOTEST := CGO_ENABLED=1 $(GO) test -p 4
OVERALLS := CGO_ENABLED=1 GO111MODULE=on overalls

Expand All @@ -34,6 +35,7 @@ LDFLAGS += -X "github.com/pingcap/tidb/util/printer.TiDBGitBranch=$(shell git re
LDFLAGS += -X "github.com/pingcap/tidb/util/printer.GoVersion=$(shell go version)"

TEST_LDFLAGS = -X "github.com/pingcap/tidb/config.checkBeforeDropLDFlag=1"
COVERAGE_SERVER_LDFLAGS = -X "github.com/pingcap/tidb/tidb-server.isCoverageServer=1"

CHECK_LDFLAGS += $(LDFLAGS) ${TEST_LDFLAGS}

Expand Down Expand Up @@ -61,7 +63,7 @@ build:
# Install the check tools.
check-setup:tools/bin/revive tools/bin/goword tools/bin/gometalinter tools/bin/gosec

check: fmt errcheck lint tidy check-static vet
check: fmt errcheck lint tidy testSuite check-static vet

# These need to be fixed before they can be ran regularly
check-fail: goword check-slow
Expand Down Expand Up @@ -106,6 +108,10 @@ tidy:
@echo "go mod tidy"
./tools/check/check-tidy.sh

testSuite:
@echo "testSuite"
./tools/check/check_testSuite.sh

clean:
$(GO) clean -i ./...
rm -rf *.out
Expand All @@ -129,8 +135,8 @@ endif
gotest: failpoint-enable
ifeq ("$(TRAVIS_COVERAGE)", "1")
@echo "Running in TRAVIS_COVERAGE mode."
@export log_level=error; \
$(GO) get github.com/go-playground/overalls
@export log_level=error; \
$(OVERALLS) -project=github.com/pingcap/tidb \
-covermode=count \
-ignore='.git,vendor,cmd,docs,LICENSES' \
Expand Down Expand Up @@ -183,6 +189,13 @@ else
$(GOBUILD) $(RACE_FLAG) -ldflags '$(CHECK_LDFLAGS)' -o '$(TARGET)' tidb-server/main.go
endif

server_coverage:
ifeq ($(TARGET), "")
$(GOBUILDCOVERAGE) $(RACE_FLAG) -ldflags '$(LDFLAGS) $(COVERAGE_SERVER_LDFLAGS) $(CHECK_FLAG)' -o ../bin/tidb-server-coverage
else
$(GOBUILDCOVERAGE) $(RACE_FLAG) -ldflags '$(LDFLAGS) $(COVERAGE_SERVER_LDFLAGS) $(CHECK_FLAG)' -o '$(TARGET)'
endif

benchkv:
$(GOBUILD) -ldflags '$(LDFLAGS)' -o bin/benchkv cmd/benchkv/main.go

Expand Down
55 changes: 46 additions & 9 deletions bindinfo/bind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,22 @@ import (
"fmt"
"os"
"testing"
"time"

. "github.com/pingcap/check"
"github.com/pingcap/parser"
"github.com/pingcap/tidb/bindinfo"
"github.com/pingcap/tidb/domain"
"github.com/pingcap/tidb/kv"
"github.com/pingcap/tidb/meta/autoid"
"github.com/pingcap/tidb/metrics"
"github.com/pingcap/tidb/session"
"github.com/pingcap/tidb/store/mockstore"
"github.com/pingcap/tidb/store/mockstore/mocktikv"
"github.com/pingcap/tidb/util/logutil"
"github.com/pingcap/tidb/util/mock"
"github.com/pingcap/tidb/util/testkit"
"github.com/pingcap/tidb/util/testleak"
dto "github.com/prometheus/client_model/go"
)

func TestT(t *testing.T) {
Expand Down Expand Up @@ -73,7 +74,7 @@ func (s *testSuite) SetUpSuite(c *C) {
c.Assert(err, IsNil)
s.store = store
session.SetSchemaLease(0)
session.SetStatsLease(0)
session.DisableStats4Test()
}
d, err := session.BootstrapSession(s.store)
c.Assert(err, IsNil)
Expand Down Expand Up @@ -133,6 +134,11 @@ func (s *testSuite) TestBindParse(c *C) {
c.Check(bindData.Collation, Equals, "utf8mb4_bin")
c.Check(bindData.CreateTime, NotNil)
c.Check(bindData.UpdateTime, NotNil)

// Test fields with quotes or slashes.
sql = `CREATE GLOBAL BINDING FOR select * from t where a BETWEEN "a" and "b" USING select * from t use index(idx) where a BETWEEN "a\nb\rc\td\0e" and 'x'`
tk.MustExec(sql)
tk.MustExec(`DROP global binding for select * from t use index(idx) where a BETWEEN "a\nb\rc\td\0e" and "x"`)
}

func (s *testSuite) TestGlobalBinding(c *C) {
Expand All @@ -145,13 +151,21 @@ func (s *testSuite) TestGlobalBinding(c *C) {
tk.MustExec("create table t1(i int, s varchar(20))")
tk.MustExec("create index index_t on t(i,s)")

metrics.BindTotalGauge.Reset()
metrics.BindMemoryUsage.Reset()

_, err := tk.Exec("create global binding for select * from t where i>100 using select * from t use index(index_t) where i>100")
c.Assert(err, IsNil, Commentf("err %v", err))

time.Sleep(time.Second * 1)
_, err = tk.Exec("create global binding for select * from t where i>99 using select * from t use index(index_t) where i>99")
c.Assert(err, IsNil)

pb := &dto.Metric{}
metrics.BindTotalGauge.WithLabelValues(metrics.ScopeGlobal, bindinfo.Using).Write(pb)
c.Assert(pb.GetGauge().GetValue(), Equals, float64(1))
metrics.BindMemoryUsage.WithLabelValues(metrics.ScopeGlobal, bindinfo.Using).Write(pb)
c.Assert(pb.GetGauge().GetValue(), Equals, float64(161))

sql, hash := parser.NormalizeDigest("select * from t where i > ?")

bindData := s.domain.BindHandle().GetBindRecord(hash, sql, "test")
Expand All @@ -167,7 +181,7 @@ func (s *testSuite) TestGlobalBinding(c *C) {

rs, err := tk.Exec("show global bindings")
c.Assert(err, IsNil)
chk := rs.NewRecordBatch()
chk := rs.NewChunk()
err = rs.Next(context.TODO(), chk)
c.Check(err, IsNil)
c.Check(chk.NumRows(), Equals, 1)
Expand Down Expand Up @@ -202,6 +216,12 @@ func (s *testSuite) TestGlobalBinding(c *C) {
bindData = s.domain.BindHandle().GetBindRecord(hash, sql, "test")
c.Check(bindData, IsNil)

metrics.BindTotalGauge.WithLabelValues(metrics.ScopeGlobal, bindinfo.Using).Write(pb)
c.Assert(pb.GetGauge().GetValue(), Equals, float64(0))
metrics.BindMemoryUsage.WithLabelValues(metrics.ScopeGlobal, bindinfo.Using).Write(pb)
// From newly created global bind handle.
c.Assert(pb.GetGauge().GetValue(), Equals, float64(161))

bindHandle = bindinfo.NewBindHandle(tk.Se)
err = bindHandle.Update(true)
c.Check(err, IsNil)
Expand All @@ -212,7 +232,7 @@ func (s *testSuite) TestGlobalBinding(c *C) {

rs, err = tk.Exec("show global bindings")
c.Assert(err, IsNil)
chk = rs.NewRecordBatch()
chk = rs.NewChunk()
err = rs.Next(context.TODO(), chk)
c.Check(err, IsNil)
c.Check(chk.NumRows(), Equals, 0)
Expand All @@ -234,13 +254,21 @@ func (s *testSuite) TestSessionBinding(c *C) {
tk.MustExec("create table t1(i int, s varchar(20))")
tk.MustExec("create index index_t on t(i,s)")

metrics.BindTotalGauge.Reset()
metrics.BindMemoryUsage.Reset()

_, err := tk.Exec("create session binding for select * from t where i>100 using select * from t use index(index_t) where i>100")
c.Assert(err, IsNil, Commentf("err %v", err))

time.Sleep(time.Second * 1)
_, err = tk.Exec("create session binding for select * from t where i>99 using select * from t use index(index_t) where i>99")
c.Assert(err, IsNil)

pb := &dto.Metric{}
metrics.BindTotalGauge.WithLabelValues(metrics.ScopeSession, bindinfo.Using).Write(pb)
c.Assert(pb.GetGauge().GetValue(), Equals, float64(1))
metrics.BindMemoryUsage.WithLabelValues(metrics.ScopeSession, bindinfo.Using).Write(pb)
c.Assert(pb.GetGauge().GetValue(), Equals, float64(161))

handle := tk.Se.Value(bindinfo.SessionBindInfoKeyType).(*bindinfo.SessionHandle)
bindData := handle.GetBindRecord("select * from t where i > ?", "test")
c.Check(bindData, NotNil)
Expand All @@ -255,14 +283,14 @@ func (s *testSuite) TestSessionBinding(c *C) {

rs, err := tk.Exec("show global bindings")
c.Assert(err, IsNil)
chk := rs.NewRecordBatch()
chk := rs.NewChunk()
err = rs.Next(context.TODO(), chk)
c.Check(err, IsNil)
c.Check(chk.NumRows(), Equals, 0)

rs, err = tk.Exec("show session bindings")
c.Assert(err, IsNil)
chk = rs.NewRecordBatch()
chk = rs.NewChunk()
err = rs.Next(context.TODO(), chk)
c.Check(err, IsNil)
c.Check(chk.NumRows(), Equals, 1)
Expand All @@ -282,6 +310,11 @@ func (s *testSuite) TestSessionBinding(c *C) {
c.Check(bindData, NotNil)
c.Check(bindData.OriginalSQL, Equals, "select * from t where i > ?")
c.Check(bindData.Status, Equals, "deleted")

metrics.BindTotalGauge.WithLabelValues(metrics.ScopeSession, bindinfo.Using).Write(pb)
c.Assert(pb.GetGauge().GetValue(), Equals, float64(0))
metrics.BindMemoryUsage.WithLabelValues(metrics.ScopeSession, bindinfo.Using).Write(pb)
c.Assert(pb.GetGauge().GetValue(), Equals, float64(0))
}

func (s *testSuite) TestGlobalAndSessionBindingBothExist(c *C) {
Expand Down Expand Up @@ -317,6 +350,7 @@ func (s *testSuite) TestGlobalAndSessionBindingBothExist(c *C) {

tk.MustExec("create global binding for SELECT * from t1,t2 where t1.id = t2.id using SELECT /*+ TIDB_SMJ(t1, t2) */ * from t1,t2 where t1.id = t2.id")

metrics.BindUsageCounter.Reset()
tk.MustQuery("explain SELECT * from t1,t2 where t1.id = t2.id").Check(testkit.Rows(
"MergeJoin_7 12487.50 root inner join, left key:test.t1.id, right key:test.t2.id",
"├─Sort_11 9990.00 root test.t1.id:asc",
Expand All @@ -328,6 +362,9 @@ func (s *testSuite) TestGlobalAndSessionBindingBothExist(c *C) {
" └─Selection_13 9990.00 cop not(isnull(test.t2.id))",
" └─TableScan_12 10000.00 cop table:t2, range:[-inf,+inf], keep order:false, stats:pseudo",
))
pb := &dto.Metric{}
metrics.BindUsageCounter.WithLabelValues(metrics.ScopeGlobal).Write(pb)
c.Assert(pb.GetCounter().GetValue(), Equals, float64(1))

tk.MustExec("drop global binding for SELECT * from t1,t2 where t1.id = t2.id")

Expand Down Expand Up @@ -423,7 +460,7 @@ func (s *testSuite) TestErrorBind(c *C) {

rs, err := tk.Exec("show global bindings")
c.Assert(err, IsNil)
chk := rs.NewRecordBatch()
chk := rs.NewChunk()
err = rs.Next(context.TODO(), chk)
c.Check(err, IsNil)
c.Check(chk.NumRows(), Equals, 0)
Expand Down
19 changes: 19 additions & 0 deletions bindinfo/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
package bindinfo

import (
"unsafe"

"github.com/pingcap/parser/ast"
"github.com/pingcap/tidb/metrics"
"github.com/pingcap/tidb/types"
"github.com/pingcap/tidb/util/chunk"
)
Expand Down Expand Up @@ -64,3 +67,19 @@ func newBindRecord(row chunk.Row) *BindRecord {
Collation: row.GetString(7),
}
}

// size calculates the memory size of a bind meta.
func (m *BindRecord) size() float64 {
res := len(m.OriginalSQL) + len(m.BindSQL) + len(m.Db) + len(m.Status) + 2*int(unsafe.Sizeof(m.CreateTime)) + len(m.Charset) + len(m.Collation)
return float64(res)
}

func (m *BindRecord) updateMetrics(scope string, inc bool) {
if inc {
metrics.BindMemoryUsage.WithLabelValues(scope, m.Status).Add(float64(m.size()))
metrics.BindTotalGauge.WithLabelValues(scope, m.Status).Inc()
} else {
metrics.BindMemoryUsage.WithLabelValues(scope, m.Status).Sub(float64(m.size()))
metrics.BindTotalGauge.WithLabelValues(scope, m.Status).Dec()
}
}
Loading