Commit Graph

450 Commits

Author SHA1 Message Date
c5a157a883 *: revert all of the radix-join-related commits (#10926) 2019-06-24 23:35:15 +08:00
c59028a2b5 *: let baseFuncDesc.typeInfer return error instead of panic (#10910) 2019-06-24 13:09:14 +08:00
f6be085bc6 executor: tiny refactor the Executor interface (#10846)
Introduce a base() method to get the baseExecutor, so we don't need to add
method from baseExecutor to the Executor interface any more

Before:
```
type Executor interface {
	Open(context.Context) error
	Next(ctx context.Context, req *chunk.RecordBatch) error
	Close() error
	Schema() *expression.Schema

	retTypes() []*types.FieldType
	newFirstChunk() *chunk.Chunk
}
```

After:
```
type Executor interface {
        base() *baseExecutor
	Open(context.Context) error
	Next(ctx context.Context, req *chunk.RecordBatch) error
	Close() error
	Schema() *expression.Schema
}
```
2019-06-19 15:55:28 +08:00
cd8c4e6e37 *: add a blacklist to disallow pushing down specific expressions (#10688) 2019-06-12 13:54:33 +08:00
f5bdc26e38 executor: fix split table bug (#10761) 2019-06-11 13:45:58 +08:00
59b5e1d2bf *: add split table syntax to split table region (#10553) 2019-06-10 14:38:56 +08:00
7bf3d69313 *: split index region with lower upper syntax (#10409) 2019-06-06 10:47:24 +08:00
8344801d32 executor,privilege: fix "show grants" result for RBAC (#10571) 2019-05-24 13:18:58 +08:00
9071ab9131 planner, executor: merge window functions with same specification name (#9866) 2019-05-23 16:39:59 +08:00
54899f66f6 parser: support LOAD DATA ... IGNORE/REPLACE (#10336) 2019-05-22 17:03:29 +08:00
8ec79bea50 executor: RANGE frame can have no ORDER BY clause (#10496) 2019-05-17 22:54:17 +08:00
373748adf7 *: support pessimistic transaction (experimental feature) (#10297) 2019-05-11 09:48:45 +08:00
3190ad99f9 planner: tidy up PhysicalApply struct and related methods (#10394) 2019-05-09 10:58:50 +08:00
b0549b7875 stats: incremental analyze for index with feedback updates (#10355) 2019-05-08 13:50:46 +08:00
7ecb3159a6 *: add split index region syntax (#10203) 2019-05-06 17:41:50 +08:00
9d74d6404f planner, executor: index join enhancement (#8471) 2019-04-29 11:07:15 +08:00
4b4fe8b549 stats: incremental analyze for index without feedback updates (#10102) 2019-04-28 15:34:51 +08:00
5fa16a8030 executor: support building stats for fast analyze. (#10258) 2019-04-28 13:49:54 +08:00
862df46fe9 executor: support fast sample for fast analyze (#10214) 2019-04-24 17:04:55 +08:00
a28d8779c1 *: support show analyze status (#10172) 2019-04-24 14:32:19 +08:00
e59539505a plan, executor: pre with labels for metrics in plan/executor package (#10231) 2019-04-22 21:50:59 +08:00
d6396daa77 *: lazy eval explain id and tracker label (#10139) 2019-04-22 14:23:33 +08:00
7cc7323138 plan, privilege: add role support for SHOW GRANT (#10016) 2019-04-21 12:38:28 +08:00
63d720cbfd *: support create global binding (#9846) 2019-04-17 22:12:50 +08:00
5b469e08b3 planner, executor: support fast analyze in planner and executor's builder. (#10040) 2019-04-10 20:13:18 +08:00
8c118cecc2 *: clean code for restore table (#9090) 2019-04-08 15:21:37 +08:00
e9653675dd *: remove errors.Trace in main handle path (#10033) 2019-04-04 14:27:15 +08:00
435a081401 executor: control Chunk size for TableReader&IndexReader&IndexLookup (#9452) 2019-04-01 13:13:39 +08:00
e31e8f1560 *: reduce runtime.growslice by preallocation (#9946) 2019-03-31 10:31:06 +08:00
dd3ca22854 planner, executor: support Change and ChangeExec (#9789)
* support update pump or drainer status
2019-03-21 19:04:08 +08:00
821af9e9f6 executor: control Chunk size for Joiners (#9614) 2019-03-19 21:30:21 +08:00
2b646cb58b planner, executor: handle default frame for window functions (#9544) 2019-03-06 19:37:30 +08:00
fa37762c53 executor: tiny refactor, remove physicalTableID from the three reader (#9511) 2019-03-01 10:36:09 +08:00
9259785455 executor: support window function rank and dense_rank (#9500) 2019-02-28 14:44:08 +08:00
8b84b94c96 *: fix union scan for partitioned table (#8871) 2019-02-28 13:43:45 +08:00
45f9d6a00f statistics: compute and store column order correlation with handle (#9315) 2019-02-27 11:32:00 +08:00
a59a5f41e1 planner, executor: support range framed window functions (#9450) 2019-02-27 10:07:28 +08:00
2f3842a8da executor, planner: refine merge join compare methods to avoid some rare cases (#9390) 2019-02-25 14:19:26 +08:00
042e4100b9 executor: support row framed window functions (#9358) 2019-02-21 15:30:25 +08:00
40fa006cac *: collect coprocessor runtime stats for explain analyze (#9057) 2019-02-19 16:22:00 +08:00
365264cd21 ddl: add restore deleted table (#7937) 2019-01-16 15:37:33 +08:00
3835bef7ae executor: support window func for aggregate without frame clause (#8899) 2019-01-15 15:23:17 +08:00
dca815c1c5 expression: return error when doing ResolveIndices (#8929) 2019-01-15 14:34:06 +08:00
8b4c998815 executor: separate RadixHashJoinExec from HashJoinExec (#8979) 2019-01-10 20:11:43 +08:00
e0b30fe9ba planner,executor: support show create database if not exists syntax (#8926)
<!--
Thank you for contributing to TiDB! Please read TiDB's [CONTRIBUTING](https://github.com/pingcap/tidb/blob/master/CONTRIBUTING.md) document **BEFORE** filing this PR.
-->

### What problem does this PR solve? <!--add issue link with summary if exists-->

https://github.com/pingcap/parser/issues/147
https://github.com/pingcap/parser/pull/148

MySQL compatibility: `show create database if not exists` syntax

See: https://dev.mysql.com/doc/refman/5.7/en/show-create-database.html

MySQL

```
MariaDB [(none)]> show create database b2;
+----------+----------------------------------------------------------------+
| Database | Create Database                                                |
+----------+----------------------------------------------------------------+
| b2       | CREATE DATABASE `b2` /*!40100 DEFAULT CHARACTER SET utf8mb4 */ |
+----------+----------------------------------------------------------------+
1 row in set (0.002 sec)

MariaDB [(none)]> show create database if not exists b2;
+----------+-----------------------------------------------------------------------------------------+
| Database | Create Database                                                                         |
+----------+-----------------------------------------------------------------------------------------+
| b2       | CREATE DATABASE /*!32312 IF NOT EXISTS*/ `b2` /*!40100 DEFAULT CHARACTER SET utf8mb4 */ |
+----------+-----------------------------------------------------------------------------------------+
1 row in set (0.000 sec)
```

TiDB
```
MySQL [b1]> show create batabase b2;
ERROR 1105 (HY000): line 1 column 20 near " b2" (total length 23)
MySQL [b1]> show create database b2;
+----------+-----------------------------------------------------------------+
| Database | Create Database                                                 |
+----------+-----------------------------------------------------------------+
| b2       | CREATE DATABASE `b2` /* !40100 DEFAULT CHARACTER SET utf8mb4 */ |
+----------+-----------------------------------------------------------------+
1 row in set (0.000 sec)

MySQL [b1]> show create database if not exists b2;
ERROR 1105 (HY000): line 1 column 23 near " not exists b2" (total length 37)
```

### What is changed and how it works?

Insert `/*!32312 IF NOT EXISTS*/` before shema name when statement contains `if not exists`

### Check List <!--REMOVE the items that are not applicable-->

Tests <!-- At least one of them must be included. -->

 - Unit test

Code changes

Side effects

Related changes

 - Need to cherry-pick to the release branch

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/pingcap/tidb/8926)
<!-- Reviewable:end -->
2019-01-04 13:31:05 +08:00
243120c473 planner, executor: add post-process after physical plan optimization and move buildProjBelowAgg from executor to planner (#8828) 2019-01-03 16:26:59 +08:00
71088815e7 executor: refine HashAgg.Close when unparallelExec (#8810) 2018-12-27 17:14:04 +08:00
3040788655 *: make errcheck work again (#8795) 2018-12-25 17:16:52 +08:00
98b96cc769 executor: speedup unit tests by spliting them into separate suites (#8618) 2018-12-24 21:37:12 +08:00
a7907ede7a *: remove fail field from TxnState (#8712)
Originally, `fail` is added to simplify error handling, avoiding large changes on
the Txn() interface API. But it turns out that `fail` becomes the root of many bugs.
So this commit remove the `fail` and make an API refactory.
2018-12-20 16:36:12 +08:00