Commit Graph

31 Commits

Author SHA1 Message Date
df2075d745 *: remove the transaction kv count limit (#11141) 2019-08-09 20:35:37 +08:00
8bc63973df executor: move failpoint test case to seq test suite (#11525) 2019-07-30 18:32:05 +08:00
abbca5375e *: add trace support for subquery (#11182)
Test pass, auto merge by Bot
2019-07-24 19:03:47 +08:00
cb23b524ac *: directly save prepare execute args as datums in binary proto (#10884) 2019-07-02 13:49:06 +08:00
f29b36ca1d *: fix malformed SQL statements in test (#10992) 2019-07-01 10:37:35 +08:00
b63a8bfedf meta: make auto increment id can be adjust. (#10978) 2019-06-28 22:26:08 +08:00
0d563f1e2d stats: fix unstable test (#10953) 2019-06-27 13:51:16 +08:00
d244723a5e executor: remove unused structure RecordBatch (#10891) 2019-06-26 15:26:16 +08:00
d126b59fb0 executor: add some missing test suite back (#10602) 2019-05-27 15:48:08 +08:00
1ef1d8ad3e modify desc is compatible with MySQL (#10358) 2019-05-08 09:28:55 +08:00
69b02a3736 *: make config items Performance.*, OOMAction and MemQuotaQuery support hot-reloading (#10295) 2019-04-29 16:38:46 +08:00
e59539505a plan, executor: pre with labels for metrics in plan/executor package (#10231) 2019-04-22 21:50:59 +08:00
27a56180bd *: replace gofail with the new failpoint implementation (#10184) 2019-04-22 13:30:14 +08:00
e5f734e54c *: move the Handle of stats to single package. (#10149) 2019-04-17 13:42:34 +08:00
f723f0b143 table, infoschema, executor: fix Charset/Collation shown in column desc (#10007) 2019-04-09 20:00:13 +08:00
62b209cb80 fix desc table not compatibile with mysql (#10022) 2019-04-04 18:24:30 +08:00
9891b3d546 executor, types: update tests for the description format of type year (#9253) 2019-03-11 15:56:58 +08:00
6136ab14cf *: start replacing logger with zap logger (#9279) 2019-02-15 16:43:47 +08:00
d96ca96941 executor:adjust 'show create table' for mysql compatibility (#9113)
* executor: adjust 'show create table'

show create table should not print the charset of the column
if it is the same with table charset( same with MySQL)

* update:change the test

* update: add test to improve CodeCov

* style: update the variable

* fix test

* Wait for change parser

* just need to test

* change go.mod

* fix invalid pointer access

* Revert "update:change the test"

This reverts commit 64b381b2e95f151a9756d67ba52b60f694573cf9.

* Revert "fix test"

This reverts commit 98e00954064c9f5a6aa4ae1d4fb529e27cfabf4e.

* Revert "update: add test to improve CodeCov"

This reverts commit a32d6e992ca239e893f0615cea988838f3952dd7.

* passed test(need change test data)

*  add judge when show create table

*  fix logic wrong

*  add test

* change variable name

* revert something because complex

* update go.mod

*  update go.mod
2019-02-14 15:49:38 +08:00
5c65128632 ddl: make the leak test stable (#9139) 2019-01-23 13:01:55 +08:00
36176be874 *: improve syntax error code & message compatibility (#9103) 2019-01-23 10:46:29 +08:00
63936cc1fa ddl: resolve the charset by the order: table->database->server (#9105) 2019-01-21 19:56:40 +08:00
15b29dd71a executor: add column character sets when show create table (#8866) 2019-01-14 19:59:47 +08:00
00c4ff4fa9 *: refactor Executor.Next() to receive RecordBatch (#8994) 2019-01-14 15:04:36 +08:00
39e1dfe4c2 parser: better error message #133 (#8950) 2019-01-07 12:14:46 +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
71088815e7 executor: refine HashAgg.Close when unparallelExec (#8810) 2018-12-27 17:14:04 +08:00
93e91b6a37 executor/test: fix data race of executor unit tests (#8807) 2018-12-27 11:28:55 +08:00
7ffdbcad6c executor: add test case for execute prepare_stmt using binary protocol (#8825) 2018-12-26 13:49:03 +08:00
a1a4e8197d Revert "executor/show: show create table return utf8mb4 charset. (#8604) (#8782) 2018-12-26 09:54:50 +08:00
98b96cc769 executor: speedup unit tests by spliting them into separate suites (#8618) 2018-12-24 21:37:12 +08:00