Tables contain zero column ID after `CREATE TABLE LIKE`
- 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)
```
mysql> create table t2 like metrics_schema.up;
Query OK, 0 rows affected (0.05 sec)
mysql> insert into t2 values (NULL, 'aa', 'aa', '11');
Query OK, 1 row affected (0.01 sec)
```
```
curl http://127.0.0.1:10080/schema/test/t2
{
"id": 135,
"name": {
"O": "t2",
"L": "t2"
},
"charset": "utf8mb4",
"collate": "utf8mb4_bin",
"cols": [
{
"id": 0,
"name": {
"O": "time",
"L": "time"
},
"offset": 0,
"origin_default": null,
...
```
### 2. What did you expect to see? (Required)
```
mysql> select * from t2;
+------+----------+------+-------+
| time | instance | job | value |
+------+----------+------+-------+
| NULL | aa | aa | 11 |
+------+----------+------+-------+
1 row in set (0.00 sec)
```
### 3. What did you see instead (Required)
```
mysql> table t2;
+------+----------+------+-------+
| time | instance | job | value |
+------+----------+------+-------+
| NULL | NULL | NULL | NULL |
+------+----------+------+-------+
1 row in set (0.00 sec)
```
### 4. What is your TiDB version? (Required)
master (7237eb9cbb)
Contributor guide
Assessment
This issue has not been assessed yet.