Commit Graph

8026 Commits

Author SHA1 Message Date
68ddb7f0e6 *: fix the lower bound when converting numbers less than 0 to unsigned integers (#8544) 2019-01-10 16:04:07 +08:00
858b200e9a variable: remove tidb_ddl_reorg_worker_cnt and tidb_ddl_reorg_batch_size session level. (#8941) 2019-01-10 15:12:22 +08:00
3b40b14dc3 infoschema: move perfschema to infoschema directory, tiny refactor (#8982) 2019-01-10 13:58:32 +08:00
0bc0f7d95b expression: throw "too big precision" error for CAST(AS TIME) (#8907) 2019-01-09 19:44:35 +08:00
bb2d56ab73 parser: add SHOW CREATE USER syntax (#8970) 2019-01-09 11:21:30 +08:00
f209843184 stats: fix histogram bound overflow error (#8984) 2019-01-09 10:57:55 +08:00
692693a1ff server, tidb-server: improve unix socket handling (#8836) 2019-01-09 09:51:26 +08:00
c68ee73183 gomod: update tidb-tools version (#8945) 2019-01-08 20:33:36 +08:00
74b2c1477d ddl: modify cancel drop column ddl test (#8897)
* modify cancel drop column ddl test
2019-01-08 20:06:48 +08:00
da31a461e7 ddl: fix cancel rename index ddl error (#8610) 2019-01-08 19:29:47 +08:00
ddda6b460a session: upgrade tidb_max_chunk_size to new low bound value (#8969) 2019-01-08 18:52:12 +08:00
abf00fc346 sessionctx/variable: fix select variable return wrong result when variable is only global scope variable (#8968) 2019-01-08 16:18:05 +08:00
021f7538bb sessionctx/variable: fix select variable return wrong result when variable is only global scope variable (#8968) 2019-01-08 15:46:53 +08:00
a81e312fbc executor: support parallel building hash table for radixHashJoin (#8927) 2019-01-08 14:59:44 +08:00
971629b947 parser: update parser version (#8973) 2019-01-08 13:39:34 +08:00
76de7f1cee README: change release icon always show the latest tag (#8974) 2019-01-08 13:31:46 +08:00
884db0ab3d types: fix the incorrect behavior of "%y"/"%Y" for STR_TO_DATE() (#8517) 2019-01-08 12:37:30 +08:00
106bc7efc6 executor: return error if autoid overflows shard bits. (#8936) 2019-01-08 12:19:35 +08:00
8468e7ec51 CONTRIBUTING: '/' -> '/' (#8954) 2019-01-07 19:50:43 +08:00
9b02455874 Makefile: build gofail to tools/bin (#8952) 2019-01-07 19:20:08 +08:00
aeb68f23a6 ddl: fix rename table compatibility (#8960) 2019-01-07 19:03:14 +08:00
23c1946d21 planner/core: support named window (#8937) 2019-01-07 15:35:57 +08:00
39e1dfe4c2 parser: better error message #133 (#8950) 2019-01-07 12:14:46 +08:00
084aa5a030 config: add initChunkSize config item, make chunk start with 32 (#8480) 2019-01-07 11:14:47 +08:00
243d611cc4 Revert "gcworker: let gofail in gcworker run serially, make ci happy" (#8944) 2019-01-07 11:01:06 +08:00
78a51a4626 executor: support "show columns from" for view (#8863) 2019-01-05 21:32:32 +08:00
081a2c5ccc planner, privilege: check user priv on SET GLOBAL (#8837)
* planner, privilege: check user priv on SET GLOBAL
2019-01-04 19:32:10 -07:00
cfff96555e Handling insertion issue when the dropping column's flag is not null and its state is 'WriteOnly' (#8791) 2019-01-05 09:28:44 +08:00
0c75c43010 fix typo (#8943) 2019-01-05 09:05:52 +08:00
7ee6811d97 planner: added support for error in visitInfo (#8855) 2019-01-04 15:15:18 +08:00
3708a8306c expression: constraint propagate for '>' and monotonous function (#8640) 2019-01-04 14:06:51 +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
cef6e75be8 infoschema: add initial support for views (#8892) 2019-01-04 12:32:48 +08:00
6d098d4ff6 gcworker: let gofail in gcworker run serially, make ci happy (#8912) 2019-01-04 12:18:12 +08:00
e646276f4b planner,executor: basic support for DROP_VIEW (#8758) 2019-01-04 10:53:02 +08:00
6a9ad3fe25 travis: enable code coverage test using codecov (#8910) 2019-01-03 23:08:06 +08:00
0147e0cece ddl: refine cancel/rollback ddl job code. (#8858) 2019-01-03 17:11:14 +08:00
91cdbf2f54 planner: support window function (#8630) 2019-01-03 16:56:06 +08:00
41ad62696c session: add a doNotCommit flag to transaction when StmtCommit fail (#8918) 2019-01-03 16:38:59 +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
235d04c5e9 docs: add comments about why update statement using writable columns. (#8913) 2019-01-03 14:55:14 +08:00
32cfaf1dcc builder: use empty db should return NoDB error (#8908) 2019-01-03 13:39:36 +08:00
18d75a30ae executor: support parallel partition for HashJoinExec (#7911) 2019-01-03 13:17:45 +08:00
386f8e3b7a planner: update generated column inside a transaction should return error (#8909) 2019-01-03 11:01:02 +08:00
1232db5590 planner/core: add DefaultExpr support for expressionRewriter (#8540) 2019-01-02 23:36:36 +08:00
b8b3a7fc78 ddl: fix can't cancel a job when add index meets panic (#8621) 2019-01-02 17:38:44 +08:00
4616e8ca82 ddl: update comments (#8845) 2019-01-02 16:40:46 +08:00
b3698f6670 executor: fix panic and update error data when table has column in write only state (#8792) 2019-01-02 15:49:39 +08:00
477e252b35 expression: handle empty input and improve compatibility for format (#8797) 2019-01-02 14:13:08 +08:00
e06c87d3c1 add an option for AddRecord and Create (#8884) 2019-01-02 11:30:53 +08:00