pingcap / pingcap/tidb

Create table with encryption option show wrong warning

Open
#59,979 1 comment 0 reactions 0 assignees View on GitHub
affects-9.0 component/parser severity/minor sig/sql-infra type/bug
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Bug Report

Please answer these questions before submitting your issue. Thanks!

### 1. Minimal reproduce step (Required)

```sql

MySQL [test]> CREATE TABLE mytable (id INT, data VARCHAR(255)) ENCRYPTION='Y';
Query OK, 0 rows affected, 1 warning (0.53 sec)

MySQL [test]> show warnings;
+---------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Level | Code | Message |
+---------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Warning | 1064 | You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use line 1 column 63 near ""The ENCRYPTION clause is parsed but ignored by all storage engines. |
+---------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

```

### 2. What did you expect to see? (Required)

```sql

MySQL [test]> CREATE TABLE mytable (id INT, data VARCHAR(255)) ENCRYPTION='Y';
Query OK, 0 rows affected, 1 warning (0.53 sec)

MySQL [test]> show warnings;
+---------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Level | Code | Message |
+---------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Warning | 1064 | The ENCRYPTION clause is parsed but ignored by all storage engines. |
+---------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

```

### 3. What did you see instead (Required)
```sql
MySQL [test]> show warnings;
+---------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Level | Code | Message |
+---------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Warning | 1064 | You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use line 1 column 63 near ""The ENCRYPTION clause is parsed but ignored by all storage engines. |
+---------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```

### 4. What is your TiDB version? (Required)

v8.5.1

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.