Unnamed: 0,id,type,created_at,repo,repo_url,action,title,labels,body,index,text_combine,label,text,binary_label
8678,10605803336.0,IssuesEvent,2019-10-10 21:21:08,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,SQL_BIG_RESULT syntax support.,type/compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```
CREATE TABLE t1 (
spID int(10) unsigned,
userID int(10) unsigned,
score smallint(5) unsigned,
key (spid),
key (score)
);
select sql_big_result spid,sum(userid) from t1 group by spid;
```
2. What did you expect to see?
```
mysql> select sql_big_result spid,sum(userid) from t1 group by spid;
Empty set (0.00 sec)
```
3. What did you see instead?
```
mysql> select sql_big_result spid,sum(userid) from t1 group by spid;
ERROR 1054 (42S22): Unknown column 'sql_big_result' in 'field list'
mysql> select spid,sum(userid) from t1 group by spid;
Empty set (0.01 sec)
```
4. What version of TiDB are you using (`tidb-server -V`)?
```
Release Version: 0.9.0
Git Commit Hash: a7aaa64c76b5a1e5bb66caf94b888515cc334cf1
Git Branch: master
UTC Build Time: 2017-10-10 08:44:43
```
",True,"SQL_BIG_RESULT syntax support. - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```
CREATE TABLE t1 (
spID int(10) unsigned,
userID int(10) unsigned,
score smallint(5) unsigned,
key (spid),
key (score)
);
select sql_big_result spid,sum(userid) from t1 group by spid;
```
2. What did you expect to see?
```
mysql> select sql_big_result spid,sum(userid) from t1 group by spid;
Empty set (0.00 sec)
```
3. What did you see instead?
```
mysql> select sql_big_result spid,sum(userid) from t1 group by spid;
ERROR 1054 (42S22): Unknown column 'sql_big_result' in 'field list'
mysql> select spid,sum(userid) from t1 group by spid;
Empty set (0.01 sec)
```
4. What version of TiDB are you using (`tidb-server -V`)?
```
Release Version: 0.9.0
Git Commit Hash: a7aaa64c76b5a1e5bb66caf94b888515cc334cf1
Git Branch: master
UTC Build Time: 2017-10-10 08:44:43
```
",1,sql big result syntax support please answer these questions before submitting your issue thanks what did you do create table spid int unsigned userid int unsigned score smallint unsigned key spid key score select sql big result spid sum userid from group by spid what did you expect to see mysql select sql big result spid sum userid from group by spid empty set sec what did you see instead mysql select sql big result spid sum userid from group by spid error unknown column sql big result in field list mysql select spid sum userid from group by spid empty set sec what version of tidb are you using tidb server v release version git commit hash git branch master utc build time ,1
7853,10062951627.0,IssuesEvent,2019-07-23 03:29:31,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,alter database syntax support.,type/compatibility,"TiDB:
```
mysql> alter database test1 character set utf8 COLLATE uft8_general_ci;
ERROR 1105 (HY000): line 0 column 14 near "" test1 character set utf8 COLLATE uft8_general_ci"" (total length 63)
mysql> alter database test1 character set utf8 COLLATE uft8_general_ci;
ERROR 1105 (HY000): line 0 column 14 near "" test1 character set utf8 COLLATE uft8_general_ci"" (total length 63)
```
see https://dev.mysql.com/doc/refman/5.7/en/alter-database.html",True,"alter database syntax support. - TiDB:
```
mysql> alter database test1 character set utf8 COLLATE uft8_general_ci;
ERROR 1105 (HY000): line 0 column 14 near "" test1 character set utf8 COLLATE uft8_general_ci"" (total length 63)
mysql> alter database test1 character set utf8 COLLATE uft8_general_ci;
ERROR 1105 (HY000): line 0 column 14 near "" test1 character set utf8 COLLATE uft8_general_ci"" (total length 63)
```
see https://dev.mysql.com/doc/refman/5.7/en/alter-database.html",1,alter database syntax support tidb mysql alter database character set collate general ci error line column near character set collate general ci total length mysql alter database character set collate general ci error line column near character set collate general ci total length see ,1
8998,11034837643.0,IssuesEvent,2019-12-07 09:01:45,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,Datetime compare incompatible with MySQL,type/bug type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```
CREATE TABLE t(d datetime);
INSERT INTO t(d) VALUES('2019-08-10 11:45:14');
SELECT d, d > 1 FROM t;
SELECT COUNT(1) FROM t WHERE d > 1;
```
2. What did you expect to see?
* MySQL 8.0
```
mysql> CREATE TABLE t(d datetime);
Query OK, 0 rows affected (0.01 sec)
mysql> INSERT INTO t(d) VALUES('2019-08-10 11:45:14');
Query OK, 1 row affected (0.00 sec)
mysql> SELECT d, d > 1 FROM t;
+---------------------+-------+
| d | d > 1 |
+---------------------+-------+
| 2019-08-10 11:45:14 | 1 |
+---------------------+-------+
1 row in set, 1 warning (0.02 sec)
mysql> SELECT COUNT(1) FROM t WHERE d > 1;
+----------+
| COUNT(1) |
+----------+
| 1 |
+----------+
1 row in set, 1 warning (0.04 sec)
mysql> SELECT version();
+-----------+
| version() |
+-----------+
| 8.0.18 |
+-----------+
1 row in set (0.00 sec)
```
3. What did you see instead?
* TiDB 3.0.7
```
mysql> CREATE TABLE t(d datetime);
Query OK, 0 rows affected (1.01 sec)
mysql> INSERT INTO t(d) VALUES('2019-08-10 11:45:14');
Query OK, 1 row affected (0.01 sec)
mysql> SELECT d, d > 1 FROM t;
+---------------------+-------+
| d | d > 1 |
+---------------------+-------+
| 2019-08-10 11:45:14 | NULL |
+---------------------+-------+
1 row in set, 1 warning (0.01 sec)
mysql> SELECT COUNT(1) FROM t WHERE d > 1;
+----------+
| COUNT(1) |
+----------+
| 0 |
+----------+
1 row in set, 1 warning (0.00 sec)
mysql> SELECT version();
+--------------------+
| version() |
+--------------------+
| 5.7.25-TiDB-v3.0.7 |
+--------------------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
Release Version: v3.0.7
Git Commit Hash: 84e4386c7a77d4b8df5db7f2303fb7fd3370eb9a
Git Branch: HEAD
UTC Build Time: 2019-12-04 10:08:24
GoVersion: go version go1.13 linux/amd64
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
```
",True,"Datetime compare incompatible with MySQL - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```
CREATE TABLE t(d datetime);
INSERT INTO t(d) VALUES('2019-08-10 11:45:14');
SELECT d, d > 1 FROM t;
SELECT COUNT(1) FROM t WHERE d > 1;
```
2. What did you expect to see?
* MySQL 8.0
```
mysql> CREATE TABLE t(d datetime);
Query OK, 0 rows affected (0.01 sec)
mysql> INSERT INTO t(d) VALUES('2019-08-10 11:45:14');
Query OK, 1 row affected (0.00 sec)
mysql> SELECT d, d > 1 FROM t;
+---------------------+-------+
| d | d > 1 |
+---------------------+-------+
| 2019-08-10 11:45:14 | 1 |
+---------------------+-------+
1 row in set, 1 warning (0.02 sec)
mysql> SELECT COUNT(1) FROM t WHERE d > 1;
+----------+
| COUNT(1) |
+----------+
| 1 |
+----------+
1 row in set, 1 warning (0.04 sec)
mysql> SELECT version();
+-----------+
| version() |
+-----------+
| 8.0.18 |
+-----------+
1 row in set (0.00 sec)
```
3. What did you see instead?
* TiDB 3.0.7
```
mysql> CREATE TABLE t(d datetime);
Query OK, 0 rows affected (1.01 sec)
mysql> INSERT INTO t(d) VALUES('2019-08-10 11:45:14');
Query OK, 1 row affected (0.01 sec)
mysql> SELECT d, d > 1 FROM t;
+---------------------+-------+
| d | d > 1 |
+---------------------+-------+
| 2019-08-10 11:45:14 | NULL |
+---------------------+-------+
1 row in set, 1 warning (0.01 sec)
mysql> SELECT COUNT(1) FROM t WHERE d > 1;
+----------+
| COUNT(1) |
+----------+
| 0 |
+----------+
1 row in set, 1 warning (0.00 sec)
mysql> SELECT version();
+--------------------+
| version() |
+--------------------+
| 5.7.25-TiDB-v3.0.7 |
+--------------------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
Release Version: v3.0.7
Git Commit Hash: 84e4386c7a77d4b8df5db7f2303fb7fd3370eb9a
Git Branch: HEAD
UTC Build Time: 2019-12-04 10:08:24
GoVersion: go version go1.13 linux/amd64
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
```
",1,datetime compare incompatible with mysql bug report please answer these questions before submitting your issue thanks what did you do create table t d datetime insert into t d values select d d from t select count from t where d what did you expect to see mysql mysql create table t d datetime query ok rows affected sec mysql insert into t d values query ok row affected sec mysql select d d from t d d row in set warning sec mysql select count from t where d count row in set warning sec mysql select version version row in set sec what did you see instead tidb mysql create table t d datetime query ok rows affected sec mysql insert into t d values query ok row affected sec mysql select d d from t d d null row in set warning sec mysql select count from t where d count row in set warning sec mysql select version version tidb row in set sec what version of tidb are you using tidb server v or run select tidb version on tidb release version git commit hash git branch head utc build time goversion go version linux race enabled false tikv min version check table before drop false ,1
7334,9577312403.0,IssuesEvent,2019-05-07 11:21:08,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,`unix_timestamp` is not compatible with Mysql,for new contributors help wanted type/bug type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
select @a:=FROM_UNIXTIME(1);
select unix_timestamp(@a);
```
2. What did you expect to see?
In Mysql
```
mysql> select @a:=FROM_UNIXTIME(1);
+----------------------+
| @a:=FROM_UNIXTIME(1) |
+----------------------+
| 1970-01-01 08:00:01 |
+----------------------+
1 row in set (0.00 sec)
mysql> select unix_timestamp(@a);
+--------------------+
| unix_timestamp(@a) |
+--------------------+
| 1 |
+--------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
In TiDB
```
mysql> select @a:=FROM_UNIXTIME(1);
+----------------------+
| @a:=FROM_UNIXTIME(1) |
+----------------------+
| 1970-01-01 08:00:01 |
+----------------------+
1 row in set (0.00 sec)
mysql> select unix_timestamp(@a);
+--------------------+
| unix_timestamp(@a) |
+--------------------+
| 1.000000 |
+--------------------+
1 row in set (0.01 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v3.0.0-beta-212-g0681b8125
Git Commit Hash: 0681b8125080045ee0d4747ce61923164c6f2dd1
Git Branch: master
UTC Build Time: 2019-03-14 04:39:19
GoVersion: go version go1.12 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
```
",True,"`unix_timestamp` is not compatible with Mysql - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
select @a:=FROM_UNIXTIME(1);
select unix_timestamp(@a);
```
2. What did you expect to see?
In Mysql
```
mysql> select @a:=FROM_UNIXTIME(1);
+----------------------+
| @a:=FROM_UNIXTIME(1) |
+----------------------+
| 1970-01-01 08:00:01 |
+----------------------+
1 row in set (0.00 sec)
mysql> select unix_timestamp(@a);
+--------------------+
| unix_timestamp(@a) |
+--------------------+
| 1 |
+--------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
In TiDB
```
mysql> select @a:=FROM_UNIXTIME(1);
+----------------------+
| @a:=FROM_UNIXTIME(1) |
+----------------------+
| 1970-01-01 08:00:01 |
+----------------------+
1 row in set (0.00 sec)
mysql> select unix_timestamp(@a);
+--------------------+
| unix_timestamp(@a) |
+--------------------+
| 1.000000 |
+--------------------+
1 row in set (0.01 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v3.0.0-beta-212-g0681b8125
Git Commit Hash: 0681b8125080045ee0d4747ce61923164c6f2dd1
Git Branch: master
UTC Build Time: 2019-03-14 04:39:19
GoVersion: go version go1.12 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
```
",1, unix timestamp is not compatible with mysql bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error select a from unixtime select unix timestamp a what did you expect to see in mysql mysql select a from unixtime a from unixtime row in set sec mysql select unix timestamp a unix timestamp a row in set sec what did you see instead in tidb mysql select a from unixtime a from unixtime row in set sec mysql select unix timestamp a unix timestamp a row in set sec what version of tidb are you using tidb server v or run select tidb version on tidb tidb version release version beta git commit hash git branch master utc build time goversion go version darwin race enabled false tikv min version alpha check table before drop false ,1
11861,13995564192.0,IssuesEvent,2020-10-28 03:36:04,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Support multiple table rename (swap table use case),challenge-program difficulty/medium high-performance picked sig/DDL type/compatibility type/enhancement,"## Feature Request
**Is your feature request related to a problem? Please describe:**
I know that multiple DDL changes are currently on the roadmap. My feature request is to support a much smaller subset, which is an atomic rename of two tables.
This supports the use case of swapping tables, something that occurs frequently in the replication stream due to its usage by tools such as `pt-online-schema-change`.
**Describe the feature you'd like:**
```
mysql> CREATE TABLE t1 (a int);
Query OK, 0 rows affected (0.01 sec)
mysql> CREATE TABLE t2 (a int, b int);
Query OK, 0 rows affected (0.01 sec)
mysql> RENAME TABLE t1 to t1_old, t2 to t1; <--- should work
ERROR 1105 (HY000): can't run multi schema change
```
**Describe alternatives you've considered:**
The alternative is to do this non-atomically (breaks apps) or under a global lock (not yet supported by TiDB). So there is not really a good alternative.
**Teachability, Documentation, Adoption, Migration Strategy:**
MySQL compatible behavior.
## Score
1500
## SIG Slack Channel
You can join [#sig-ddl ](https://app.slack.com/client/TH91JCS4W/CMAKWBNJU)on slack in your spare time to discuss and get help with mentors or others.
## Mentor(s)
* @zimulala
## Recommended Skills
* DDL
* Golang
## Learning Materials
MySQL's [document](https://dev.mysql.com/doc/refman/8.0/en/invisible-indexes.html) for syntax reference.
[TiDB DDL architecture](https://github.com/pingcap/tidb/blob/master/docs/design/2018-10-08-online-DDL.md)",True,"Support multiple table rename (swap table use case) - ## Feature Request
**Is your feature request related to a problem? Please describe:**
I know that multiple DDL changes are currently on the roadmap. My feature request is to support a much smaller subset, which is an atomic rename of two tables.
This supports the use case of swapping tables, something that occurs frequently in the replication stream due to its usage by tools such as `pt-online-schema-change`.
**Describe the feature you'd like:**
```
mysql> CREATE TABLE t1 (a int);
Query OK, 0 rows affected (0.01 sec)
mysql> CREATE TABLE t2 (a int, b int);
Query OK, 0 rows affected (0.01 sec)
mysql> RENAME TABLE t1 to t1_old, t2 to t1; <--- should work
ERROR 1105 (HY000): can't run multi schema change
```
**Describe alternatives you've considered:**
The alternative is to do this non-atomically (breaks apps) or under a global lock (not yet supported by TiDB). So there is not really a good alternative.
**Teachability, Documentation, Adoption, Migration Strategy:**
MySQL compatible behavior.
## Score
1500
## SIG Slack Channel
You can join [#sig-ddl ](https://app.slack.com/client/TH91JCS4W/CMAKWBNJU)on slack in your spare time to discuss and get help with mentors or others.
## Mentor(s)
* @zimulala
## Recommended Skills
* DDL
* Golang
## Learning Materials
MySQL's [document](https://dev.mysql.com/doc/refman/8.0/en/invisible-indexes.html) for syntax reference.
[TiDB DDL architecture](https://github.com/pingcap/tidb/blob/master/docs/design/2018-10-08-online-DDL.md)",1,support multiple table rename swap table use case feature request is your feature request related to a problem please describe i know that multiple ddl changes are currently on the roadmap my feature request is to support a much smaller subset which is an atomic rename of two tables this supports the use case of swapping tables something that occurs frequently in the replication stream due to its usage by tools such as pt online schema change describe the feature you d like mysql create table a int query ok rows affected sec mysql create table a int b int query ok rows affected sec mysql rename table to old to should work error can t run multi schema change describe alternatives you ve considered the alternative is to do this non atomically breaks apps or under a global lock not yet supported by tidb so there is not really a good alternative teachability documentation adoption migration strategy mysql compatible behavior score sig slack channel you can join slack in your spare time to discuss and get help with mentors or others mentor s zimulala recommended skills ddl golang learning materials mysql s for syntax reference ,1
20510,30333744748.0,IssuesEvent,2023-07-11 08:15:55,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,Sleep in subquery not executed correctly,type/bug type/compatibility sig/sql-infra severity/minor compatibility-mysql8,"## Bug Report
When calling `SLEEP()` multiple times in separate subqueries the execution time is not the expected execution time.
### 1. Minimal reproduce step (Required)
```
SELECT SLEEP(2) UNION ALL SELECT SLEEP(3);
SELECT SLEEP(2),SLEEP(3);
```
### 2. What did you expect to see? (Required)
Both statements taking 5s each.
### 3. What did you see instead (Required)
```
mysql> SELECT SLEEP(2) UNION ALL SELECT SLEEP(3);
+----------+
| SLEEP(2) |
+----------+
| 0 |
| 0 |
+----------+
2 rows in set (3.00 sec)
mysql> SELECT SLEEP(2),SLEEP(3);
+----------+----------+
| SLEEP(2) | SLEEP(3) |
+----------+----------+
| 0 | 0 |
+----------+----------+
1 row in set (5.00 sec)
```
### 4. What is your TiDB version? (Required)
```
Release Version: v7.3.0-alpha-160-g90dabc0433
Edition: Community
Git Commit Hash: 90dabc0433a75db650ac683897d264ef58d63a73
Git Branch: master
UTC Build Time: 2023-07-11 07:57:57
GoVersion: go1.20.5
Race Enabled: false
Check Table Before Drop: false
Store: unistore
```",True,"Sleep in subquery not executed correctly - ## Bug Report
When calling `SLEEP()` multiple times in separate subqueries the execution time is not the expected execution time.
### 1. Minimal reproduce step (Required)
```
SELECT SLEEP(2) UNION ALL SELECT SLEEP(3);
SELECT SLEEP(2),SLEEP(3);
```
### 2. What did you expect to see? (Required)
Both statements taking 5s each.
### 3. What did you see instead (Required)
```
mysql> SELECT SLEEP(2) UNION ALL SELECT SLEEP(3);
+----------+
| SLEEP(2) |
+----------+
| 0 |
| 0 |
+----------+
2 rows in set (3.00 sec)
mysql> SELECT SLEEP(2),SLEEP(3);
+----------+----------+
| SLEEP(2) | SLEEP(3) |
+----------+----------+
| 0 | 0 |
+----------+----------+
1 row in set (5.00 sec)
```
### 4. What is your TiDB version? (Required)
```
Release Version: v7.3.0-alpha-160-g90dabc0433
Edition: Community
Git Commit Hash: 90dabc0433a75db650ac683897d264ef58d63a73
Git Branch: master
UTC Build Time: 2023-07-11 07:57:57
GoVersion: go1.20.5
Race Enabled: false
Check Table Before Drop: false
Store: unistore
```",1,sleep in subquery not executed correctly bug report when calling sleep multiple times in separate subqueries the execution time is not the expected execution time minimal reproduce step required select sleep union all select sleep select sleep sleep what did you expect to see required both statements taking each what did you see instead required mysql select sleep union all select sleep sleep rows in set sec mysql select sleep sleep sleep sleep row in set sec what is your tidb version required release version alpha edition community git commit hash git branch master utc build time goversion race enabled false check table before drop false store unistore ,1
13155,15496099739.0,IssuesEvent,2021-03-11 02:03:37,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,reopened,Test compatibility using DataGrip,status/help-wanted type/compatibility,"DataGrip is a Database management systems that support many databases, including MySQL. See https://www.jetbrains.com/datagrip/
",True,"Test compatibility using DataGrip - DataGrip is a Database management systems that support many databases, including MySQL. See https://www.jetbrains.com/datagrip/
",1,test compatibility using datagrip datagrip is a database management systems that support many databases including mysql see ,1
3400,6366812778.0,IssuesEvent,2017-08-01 03:10:22,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,str_to_date function is not compatible with MySQL,compatibility rc3.1,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
select str_to_date('04 /30/2004', '%m /%d/%Y');
```
2. What did you expect to see?
2004-04-30
3. What did you see instead?
2004-04-30 00:00:00
4. What version of TiDB are you using (`tidb-server -V`)?
",True,"str_to_date function is not compatible with MySQL - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
select str_to_date('04 /30/2004', '%m /%d/%Y');
```
2. What did you expect to see?
2004-04-30
3. What did you see instead?
2004-04-30 00:00:00
4. What version of TiDB are you using (`tidb-server -V`)?
",1,str to date function is not compatible with mysql please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error sql select str to date m d y what did you expect to see what did you see instead what version of tidb are you using tidb server v ,1
12178,14354611704.0,IssuesEvent,2020-11-30 08:55:52,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Support LIST COLUMNS partitioning,feature/accepted status/help-wanted type/compatibility type/feature-request,"## Feature Request
**Is your feature request related to a problem? Please describe:**
MySQL support [LIST COLUMNS](https://dev.mysql.com/doc/refman/8.0/en/partitioning-columns-list.html) partition but TiDB didn't support it now.
support it will help mysql user migrate to TiDB
**Describe the feature you'd like:**
Compatible with MySQL's [LIST COLUMNS](https://dev.mysql.com/doc/refman/8.0/en/partitioning-columns-list.html) partition
**Describe alternatives you've considered:**
n/a
**Teachability, Documentation, Adoption, Migration Strategy:**
",True,"Support LIST COLUMNS partitioning - ## Feature Request
**Is your feature request related to a problem? Please describe:**
MySQL support [LIST COLUMNS](https://dev.mysql.com/doc/refman/8.0/en/partitioning-columns-list.html) partition but TiDB didn't support it now.
support it will help mysql user migrate to TiDB
**Describe the feature you'd like:**
Compatible with MySQL's [LIST COLUMNS](https://dev.mysql.com/doc/refman/8.0/en/partitioning-columns-list.html) partition
**Describe alternatives you've considered:**
n/a
**Teachability, Documentation, Adoption, Migration Strategy:**
",1,support list columns partitioning feature request is your feature request related to a problem please describe mysql support partition but tidb didn t support it now support it will help mysql user migrate to tidb describe the feature you d like compatible with mysql s partition describe alternatives you ve considered n a teachability documentation adoption migration strategy ,1
5724,8183087581.0,IssuesEvent,2018-08-29 07:58:00,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,SHOW GRANTS FOR CURRENT_USER() does not work,type/compatibility,"Hi.
I'm execute command(by mysql cli)
`SHOW GRANTS FOR CURRENT_USER();`
get the error
`
ERROR 1105 (HY000): line 1 column 28 near ""()"" (total length 30)
`
tidb version:
`5.7.1-TiDB-v1.1.0-alpha-459-ga2a48b3`
BTW .
tidb support MySQL Protocol , but not very compatible with MySQL's existing client tools ( `Navicat`, `MySQL-Front`,`mysql workbench` and so on ) . Less convenient for developers to use it.
",True,"SHOW GRANTS FOR CURRENT_USER() does not work - Hi.
I'm execute command(by mysql cli)
`SHOW GRANTS FOR CURRENT_USER();`
get the error
`
ERROR 1105 (HY000): line 1 column 28 near ""()"" (total length 30)
`
tidb version:
`5.7.1-TiDB-v1.1.0-alpha-459-ga2a48b3`
BTW .
tidb support MySQL Protocol , but not very compatible with MySQL's existing client tools ( `Navicat`, `MySQL-Front`,`mysql workbench` and so on ) . Less convenient for developers to use it.
",1,show grants for current user does not work hi i m execute command(by mysql cli) show grants for current user get the error error line column near total length tidb version tidb alpha btw tidb support mysql protocol but not very compatible with mysql s existing client tools navicat , mysql front , mysql workbench and so on less convenient for developers to use it ,1
18246,25237672188.0,IssuesEvent,2022-11-15 03:13:58,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,"`bit`, `char` type column metadata is not compatible with mysql.",type/bug type/compatibility sig/sql-infra severity/moderate,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```
CREATE TABLE `PK_MULTI_COL_527_tmp` (
`COL1` char(10) COLLATE utf8_general_ci NOT NULL,
`COL3` bit(1) NOT NULL,
PRIMARY KEY (`COL1`(5),`COL3`) /*T![clustered_index] NONCLUSTERED */
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
select table_catalog table_catalog,table_name table_name,column_name column_name,ordinal_position ordinal_position,column_default column_default,is_nullable is_nullable,data_type data_type,character_maximum_length character_maximum_length,character_octet_length character_octet_length,numeric_precision numeric_precision,numeric_scale numeric_scale,datetime_precision datetime_precision,character_set_name character_set_name,collation_name collation_name,column_type column_type,column_key column_key,extra extra,privileges privileges,column_comment column_comment,generation_expression generation_expression from information_schema.columns where table_schema=(select database()) and table_name=""PK_MULTI_COL_527_tmp"" order by ordinal_position;
```
### 2. What did you expect to see? (Required)
```
+---------------+----------------------+-------------+------------------+----------------+-------------+-----------+--------------------------+------------------------+-------------------+---------------+--------------------+--------------------+-----------------+-----------------+------------+-------+---------------------------------+----------------+-----------------------+
| table_catalog | table_name | column_name | ordinal_position | column_default | is_nullable | data_type | character_maximum_length | character_octet_length | numeric_precision | numeric_scale | datetime_precision | character_set_name | collation_name | column_type | column_key | extra | privileges | column_comment | generation_expression |
+---------------+----------------------+-------------+------------------+----------------+-------------+-----------+--------------------------+------------------------+-------------------+---------------+--------------------+--------------------+-----------------+-----------------+------------+-------+---------------------------------+----------------+-----------------------+
| def | PK_MULTI_COL_527_tmp | COL1 | 1 | NULL | NO | char | 10 | 30 | NULL | NULL | NULL | utf8 | utf8_general_ci | char(10) | PRI | | select,insert,update,references | | |
| def | PK_MULTI_COL_527_tmp | COL3 | 2 | NULL | NO | bit | NULL | NULL | 1 | NULL | NULL | NULL | NULL | bit(1) | PRI | | select,insert,update,references | | |
+---------------+----------------------+-------------+------------------+----------------+-------------+-----------+--------------------------+------------------------+-------------------+---------------+--------------------+--------------------+-----------------+-----------------+------------+-------+---------------------------------+----------------+-----------------------+
```
### 3. What did you see instead (Required)
```
+---------------+----------------------+-------------+------------------+----------------+-------------+-----------+--------------------------+------------------------+-------------------+---------------+--------------------+--------------------+-----------------+-----------------+------------+-------+---------------------------------+----------------+-----------------------+
| table_catalog | table_name | column_name | ordinal_position | column_default | is_nullable | data_type | character_maximum_length | character_octet_length | numeric_precision | numeric_scale | datetime_precision | character_set_name | collation_name | column_type | column_key | extra | privileges | column_comment | generation_expression |
+---------------+----------------------+-------------+------------------+----------------+-------------+-----------+--------------------------+------------------------+-------------------+---------------+--------------------+--------------------+-----------------+-----------------+------------+-------+---------------------------------+----------------+-----------------------+
| def | PK_MULTI_COL_527_tmp | COL1 | 1 | NULL | NO | char | 10 | 10 | NULL | NULL | NULL | utf8 | utf8_general_ci | char(10) | PRI | | select,insert,update,references | | |
| def | PK_MULTI_COL_527_tmp | COL3 | 2 | NULL | NO | bit | NULL | NULL | 1 | 0 | NULL | NULL | NULL | bit(1) unsigned | PRI | | select,insert,update,references | | |
+---------------+----------------------+-------------+------------------+----------------+-------------+-----------+--------------------------+------------------------+-------------------+---------------+--------------------+--------------------+-----------------+-----------------+------------+-------+---------------------------------+----------------+-----------------------+
```
### 4. What is your TiDB version? (Required)
```
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v5.1.0-20210611
Edition: Community
Git Commit Hash: 29bfbb28437609d0a524b7b84e6920dc765978c7
Git Branch: heads/refs/tags/v5.1.0-20210611
UTC Build Time: 2021-06-11 07:52:09
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
```
",True,"`bit`, `char` type column metadata is not compatible with mysql. - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```
CREATE TABLE `PK_MULTI_COL_527_tmp` (
`COL1` char(10) COLLATE utf8_general_ci NOT NULL,
`COL3` bit(1) NOT NULL,
PRIMARY KEY (`COL1`(5),`COL3`) /*T![clustered_index] NONCLUSTERED */
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
select table_catalog table_catalog,table_name table_name,column_name column_name,ordinal_position ordinal_position,column_default column_default,is_nullable is_nullable,data_type data_type,character_maximum_length character_maximum_length,character_octet_length character_octet_length,numeric_precision numeric_precision,numeric_scale numeric_scale,datetime_precision datetime_precision,character_set_name character_set_name,collation_name collation_name,column_type column_type,column_key column_key,extra extra,privileges privileges,column_comment column_comment,generation_expression generation_expression from information_schema.columns where table_schema=(select database()) and table_name=""PK_MULTI_COL_527_tmp"" order by ordinal_position;
```
### 2. What did you expect to see? (Required)
```
+---------------+----------------------+-------------+------------------+----------------+-------------+-----------+--------------------------+------------------------+-------------------+---------------+--------------------+--------------------+-----------------+-----------------+------------+-------+---------------------------------+----------------+-----------------------+
| table_catalog | table_name | column_name | ordinal_position | column_default | is_nullable | data_type | character_maximum_length | character_octet_length | numeric_precision | numeric_scale | datetime_precision | character_set_name | collation_name | column_type | column_key | extra | privileges | column_comment | generation_expression |
+---------------+----------------------+-------------+------------------+----------------+-------------+-----------+--------------------------+------------------------+-------------------+---------------+--------------------+--------------------+-----------------+-----------------+------------+-------+---------------------------------+----------------+-----------------------+
| def | PK_MULTI_COL_527_tmp | COL1 | 1 | NULL | NO | char | 10 | 30 | NULL | NULL | NULL | utf8 | utf8_general_ci | char(10) | PRI | | select,insert,update,references | | |
| def | PK_MULTI_COL_527_tmp | COL3 | 2 | NULL | NO | bit | NULL | NULL | 1 | NULL | NULL | NULL | NULL | bit(1) | PRI | | select,insert,update,references | | |
+---------------+----------------------+-------------+------------------+----------------+-------------+-----------+--------------------------+------------------------+-------------------+---------------+--------------------+--------------------+-----------------+-----------------+------------+-------+---------------------------------+----------------+-----------------------+
```
### 3. What did you see instead (Required)
```
+---------------+----------------------+-------------+------------------+----------------+-------------+-----------+--------------------------+------------------------+-------------------+---------------+--------------------+--------------------+-----------------+-----------------+------------+-------+---------------------------------+----------------+-----------------------+
| table_catalog | table_name | column_name | ordinal_position | column_default | is_nullable | data_type | character_maximum_length | character_octet_length | numeric_precision | numeric_scale | datetime_precision | character_set_name | collation_name | column_type | column_key | extra | privileges | column_comment | generation_expression |
+---------------+----------------------+-------------+------------------+----------------+-------------+-----------+--------------------------+------------------------+-------------------+---------------+--------------------+--------------------+-----------------+-----------------+------------+-------+---------------------------------+----------------+-----------------------+
| def | PK_MULTI_COL_527_tmp | COL1 | 1 | NULL | NO | char | 10 | 10 | NULL | NULL | NULL | utf8 | utf8_general_ci | char(10) | PRI | | select,insert,update,references | | |
| def | PK_MULTI_COL_527_tmp | COL3 | 2 | NULL | NO | bit | NULL | NULL | 1 | 0 | NULL | NULL | NULL | bit(1) unsigned | PRI | | select,insert,update,references | | |
+---------------+----------------------+-------------+------------------+----------------+-------------+-----------+--------------------------+------------------------+-------------------+---------------+--------------------+--------------------+-----------------+-----------------+------------+-------+---------------------------------+----------------+-----------------------+
```
### 4. What is your TiDB version? (Required)
```
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v5.1.0-20210611
Edition: Community
Git Commit Hash: 29bfbb28437609d0a524b7b84e6920dc765978c7
Git Branch: heads/refs/tags/v5.1.0-20210611
UTC Build Time: 2021-06-11 07:52:09
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
```
",1, bit char type column metadata is not compatible with mysql bug report please answer these questions before submitting your issue thanks minimal reproduce step required create table pk multi col tmp char collate general ci not null bit not null primary key t nonclustered engine innodb default charset collate general ci select table catalog table catalog table name table name column name column name ordinal position ordinal position column default column default is nullable is nullable data type data type character maximum length character maximum length character octet length character octet length numeric precision numeric precision numeric scale numeric scale datetime precision datetime precision character set name character set name collation name collation name column type column type column key column key extra extra privileges privileges column comment column comment generation expression generation expression from information schema columns where table schema select database and table name pk multi col tmp order by ordinal position what did you expect to see required table catalog table name column name ordinal position column default is nullable data type character maximum length character octet length numeric precision numeric scale datetime precision character set name collation name column type column key extra privileges column comment generation expression def pk multi col tmp null no char null null null general ci char pri select insert update references def pk multi col tmp null no bit null null null null null null bit pri select insert update references what did you see instead required table catalog table name column name ordinal position column default is nullable data type character maximum length character octet length numeric precision numeric scale datetime precision character set name collation name column type column key extra privileges column comment generation expression def pk multi col tmp null no char null null null general ci char pri select insert update references def pk multi col tmp null no bit null null null null null bit unsigned pri select insert update references what is your tidb version required tidb version release version edition community git commit hash git branch heads refs tags utc build time goversion race enabled false tikv min version check table before drop false ,1
6795,9100108708.0,IssuesEvent,2019-02-20 07:28:27,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,tidb-server always shows port 3306,type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```
mysql> show global variables like 'port';
```
2. What did you expect to see?
```
mysql> show global variables like 'port';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| port | 4000 |
+---------------+-------+
1 row in set (0.00 sec)
```
3. What did you see instead?
```
mysql> show global variables like 'port';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| port | 3306 |
+---------------+-------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v3.0.0-beta-55-gb9c5f55cc
Git Commit Hash: b9c5f55cc0259481734a204a9190a36f0761beea
Git Branch: accurate-port
UTC Build Time: 2019-02-19 06:48:36
GoVersion: go version go1.11.4 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
1 row in set (0.00 sec)
```
",True,"tidb-server always shows port 3306 - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```
mysql> show global variables like 'port';
```
2. What did you expect to see?
```
mysql> show global variables like 'port';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| port | 4000 |
+---------------+-------+
1 row in set (0.00 sec)
```
3. What did you see instead?
```
mysql> show global variables like 'port';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| port | 3306 |
+---------------+-------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v3.0.0-beta-55-gb9c5f55cc
Git Commit Hash: b9c5f55cc0259481734a204a9190a36f0761beea
Git Branch: accurate-port
UTC Build Time: 2019-02-19 06:48:36
GoVersion: go version go1.11.4 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
1 row in set (0.00 sec)
```
",1,tidb server always shows port bug report please answer these questions before submitting your issue thanks what did you do mysql show global variables like port what did you expect to see mysql show global variables like port variable name value port row in set sec what did you see instead mysql show global variables like port variable name value port row in set sec what version of tidb are you using tidb server v or run select tidb version on tidb mysql select tidb version g row tidb version release version beta git commit hash git branch accurate port utc build time goversion go version linux race enabled false tikv min version alpha check table before drop false row in set sec ,1
6409,8709680723.0,IssuesEvent,2018-12-06 14:36:51,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,builtin uncompress function ignored the four bytes length,help wanted type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```
mysql> select uncompress(unhex('02000000789CCB48CDC9C95728CF2FCA4901001A0B045D'));
```
2. What did you expect to see?
```
mysql> select uncompress(unhex('02000000789CCB48CDC9C95728CF2FCA4901001A0B045D'));
+---------------------------------------------------------------------+
| uncompress(unhex('02000000789CCB48CDC9C95728CF2FCA4901001A0B045D')) |
+---------------------------------------------------------------------+
| NULL |
+---------------------------------------------------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> show warnings;
+---------+------+--------------------------------------------------------------------------------------------------+
| Level | Code | Message |
+---------+------+--------------------------------------------------------------------------------------------------+
| Warning | 1258 | ZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted) |
+---------+------+--------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
```
+---------------------------------------------------------------------+
| uncompress(unhex('02000000789CCB48CDC9C95728CF2FCA4901001A0B045D')) |
+---------------------------------------------------------------------+
| hello world |
+---------------------------------------------------------------------+
1 row in set (0.01 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
tidb_version(): Release Version: v2.1.0-rc.2-10-gb30dbd0
Git Commit Hash: b30dbd06acaab088a1e8fa004e189c651ca08bf1
Git Branch: master
UTC Build Time: 2018-09-17 01:20:48
GoVersion: go version go1.11 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
```
5. more info
This is found when I try to implement builtin compress and uncompress function in TiKV (https://github.com/tikv/tikv/pull/3856)
the first four bytes stored the length of the uncompress string, if it's less than the corrected length (maybe corrupted), MySQL return Null, TiDB just ignore it.",True,"builtin uncompress function ignored the four bytes length - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```
mysql> select uncompress(unhex('02000000789CCB48CDC9C95728CF2FCA4901001A0B045D'));
```
2. What did you expect to see?
```
mysql> select uncompress(unhex('02000000789CCB48CDC9C95728CF2FCA4901001A0B045D'));
+---------------------------------------------------------------------+
| uncompress(unhex('02000000789CCB48CDC9C95728CF2FCA4901001A0B045D')) |
+---------------------------------------------------------------------+
| NULL |
+---------------------------------------------------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> show warnings;
+---------+------+--------------------------------------------------------------------------------------------------+
| Level | Code | Message |
+---------+------+--------------------------------------------------------------------------------------------------+
| Warning | 1258 | ZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted) |
+---------+------+--------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
```
+---------------------------------------------------------------------+
| uncompress(unhex('02000000789CCB48CDC9C95728CF2FCA4901001A0B045D')) |
+---------------------------------------------------------------------+
| hello world |
+---------------------------------------------------------------------+
1 row in set (0.01 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
tidb_version(): Release Version: v2.1.0-rc.2-10-gb30dbd0
Git Commit Hash: b30dbd06acaab088a1e8fa004e189c651ca08bf1
Git Branch: master
UTC Build Time: 2018-09-17 01:20:48
GoVersion: go version go1.11 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
```
5. more info
This is found when I try to implement builtin compress and uncompress function in TiKV (https://github.com/tikv/tikv/pull/3856)
the first four bytes stored the length of the uncompress string, if it's less than the corrected length (maybe corrupted), MySQL return Null, TiDB just ignore it.",1,builtin uncompress function ignored the four bytes length bug report please answer these questions before submitting your issue thanks what did you do mysql select uncompress unhex what did you expect to see mysql select uncompress unhex uncompress unhex null row in set warning sec mysql show warnings level code message warning zlib not enough room in the output buffer probably length of uncompressed data was corrupted row in set sec what did you see instead uncompress unhex hello world row in set sec what version of tidb are you using tidb server v or run select tidb version on tidb tidb version release version rc git commit hash git branch master utc build time goversion go version linux race enabled false tikv min version alpha check table before drop false more info this is found when i try to implement builtin compress and uncompress function in tikv the first four bytes stored the length of the uncompress string if it s less than the corrected length maybe corrupted mysql return null, tidb just ignore it ,1
8046,10185915799.0,IssuesEvent,2019-08-10 08:22:46,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,window function: should check fuction's arguments firstly.,help wanted type/bug type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```mysql
SELECT NTH_VALUE(fieldA, -1) OVER (w1 PARTITION BY fieldB ORDER BY fieldB , fieldA ) AS 'ntile', fieldA, fieldB FROM ( SELECT `pk` AS fieldA, `col_date_key` AS fieldB FROM `table70_int_autoinc` ) as t WINDOW w1 AS ( ORDER BY fieldB ASC, fieldA DESC );
```
2. What did you expect to see?
```mysql
ERROR 1210 (HY000): Incorrect arguments to nth_value
```
3. What did you see instead?
```mysql
ERROR 3581 (HY000): A window which depends on another cannot define partitioning.
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
",True,"window function: should check fuction's arguments firstly. - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```mysql
SELECT NTH_VALUE(fieldA, -1) OVER (w1 PARTITION BY fieldB ORDER BY fieldB , fieldA ) AS 'ntile', fieldA, fieldB FROM ( SELECT `pk` AS fieldA, `col_date_key` AS fieldB FROM `table70_int_autoinc` ) as t WINDOW w1 AS ( ORDER BY fieldB ASC, fieldA DESC );
```
2. What did you expect to see?
```mysql
ERROR 1210 (HY000): Incorrect arguments to nth_value
```
3. What did you see instead?
```mysql
ERROR 3581 (HY000): A window which depends on another cannot define partitioning.
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
",1,window function should check fuction s arguments firstly bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error mysql select nth value fielda over partition by fieldb order by fieldb fielda as ntile fielda fieldb from select pk as fielda col date key as fieldb from int autoinc as t window as order by fieldb asc fielda desc what did you expect to see mysql error incorrect arguments to nth value what did you see instead mysql error a window which depends on another cannot define partitioning what version of tidb are you using tidb server v or run select tidb version on tidb ,1
3289,6254682874.0,IssuesEvent,2017-07-14 03:22:10,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Support for setting global variable with `on` and `off`,compatibility help wanted rc3.1,"
1. What did you expect to see?
```
mysql> set global avoid_temporal_upgrade = on;
Query OK, 0 rows affected, 1 warning (0.00 sec)
```
2. What did you see instead?
```
mysql> set global avoid_temporal_upgrade = on;
ERROR 1105 (HY000): line 0 column 38 near """" (total length 38)
```
",True,"Support for setting global variable with `on` and `off` -
1. What did you expect to see?
```
mysql> set global avoid_temporal_upgrade = on;
Query OK, 0 rows affected, 1 warning (0.00 sec)
```
2. What did you see instead?
```
mysql> set global avoid_temporal_upgrade = on;
ERROR 1105 (HY000): line 0 column 38 near """" (total length 38)
```
",1,support for setting global variable with on and off what did you expect to see mysql set global avoid temporal upgrade on query ok rows affected warning sec what did you see instead mysql set global avoid temporal upgrade on error line column near total length ,1
3499,6485696846.0,IssuesEvent,2017-08-19 12:58:40,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,support `GROUP BY` modifiers,compatibility enhancement todo,"## 1. What did you do?
MySQL and Oracle support [`ROLLUP`](https://dev.mysql.com/doc/refman/5.7/en/group-by-modifiers.html) modifier, sql-server also support `CUBE` and `GROUPING SETS`
## 2. What did you expect to see?
```sql
drop table if exists t;
create table t(a bigint, b bigint, c bigint);
insert into t values(1, 2, 3), (2, 2, 3), (3, 2, 3);
```
```sql
MySQL > select a, min(b) from t group by a with rollup;
+------+--------+
| a | min(b) |
+------+--------+
| 1 | 2 |
| 2 | 2 |
| 3 | 2 |
| NULL | 2 |
+------+--------+
4 rows in set (0.01 sec)
```
## 3. What did you see instead?
```sql
TiDB > select a, min(b) from t group by a with rollup;
ERROR 1105 (HY000): line 0 column 39 near "" rollup"" (total length 46)
```
## 4. What version of TiDB are you using (`tidb-server -V`)?
```sql
TiDB > select tidb_version();
+-----------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+-----------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: 0.8.0
Git Commit Hash: 3e1728b4b853c224daa969fcc3d03be5d0860ef4
Git Branch: master
UTC Build Time: 2017-08-19 12:33:06 |
+-----------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```",True,"support `GROUP BY` modifiers - ## 1. What did you do?
MySQL and Oracle support [`ROLLUP`](https://dev.mysql.com/doc/refman/5.7/en/group-by-modifiers.html) modifier, sql-server also support `CUBE` and `GROUPING SETS`
## 2. What did you expect to see?
```sql
drop table if exists t;
create table t(a bigint, b bigint, c bigint);
insert into t values(1, 2, 3), (2, 2, 3), (3, 2, 3);
```
```sql
MySQL > select a, min(b) from t group by a with rollup;
+------+--------+
| a | min(b) |
+------+--------+
| 1 | 2 |
| 2 | 2 |
| 3 | 2 |
| NULL | 2 |
+------+--------+
4 rows in set (0.01 sec)
```
## 3. What did you see instead?
```sql
TiDB > select a, min(b) from t group by a with rollup;
ERROR 1105 (HY000): line 0 column 39 near "" rollup"" (total length 46)
```
## 4. What version of TiDB are you using (`tidb-server -V`)?
```sql
TiDB > select tidb_version();
+-----------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+-----------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: 0.8.0
Git Commit Hash: 3e1728b4b853c224daa969fcc3d03be5d0860ef4
Git Branch: master
UTC Build Time: 2017-08-19 12:33:06 |
+-----------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```",1,support group by modifiers what did you do mysql and oracle support modifier sql server also support cube and grouping sets what did you expect to see sql drop table if exists t create table t a bigint b bigint c bigint insert into t values sql mysql select a min b from t group by a with rollup a min b null rows in set sec what did you see instead sql tidb select a min b from t group by a with rollup error line column near rollup total length what version of tidb are you using tidb server v sql tidb select tidb version tidb version release version git commit hash git branch master utc build time row in set sec ,1
12983,15254600337.0,IssuesEvent,2021-02-20 12:41:54,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,prefixed column clustered index's duplicate error message differ to mysql,status/help-wanted type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```
set @@tidb_enable_clustered_index=1;
create table t(name varchar(255), b int, c int, primary key(name(2)), index idx(b));
insert into t(name, b) values(""cha"", 3);
insert into t(name, b) values(""chb"", 3);
```
### 2. What did you expect to see? (Required)
```
ERROR 1062 (23000): Duplicate entry 'ch' for key 'PRIMARY'
```
### 3. What did you see instead (Required)
```
ERROR 1062 (23000): Duplicate entry 'chb' for key 'PRIMARY'
```
### 4. What is your TiDB version? (Required)
```
Release Version: None
Edition: Community
Git Commit Hash: None
Git Branch: None
UTC Build Time: None
GoVersion: go1.15
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
```
",True,"prefixed column clustered index's duplicate error message differ to mysql - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```
set @@tidb_enable_clustered_index=1;
create table t(name varchar(255), b int, c int, primary key(name(2)), index idx(b));
insert into t(name, b) values(""cha"", 3);
insert into t(name, b) values(""chb"", 3);
```
### 2. What did you expect to see? (Required)
```
ERROR 1062 (23000): Duplicate entry 'ch' for key 'PRIMARY'
```
### 3. What did you see instead (Required)
```
ERROR 1062 (23000): Duplicate entry 'chb' for key 'PRIMARY'
```
### 4. What is your TiDB version? (Required)
```
Release Version: None
Edition: Community
Git Commit Hash: None
Git Branch: None
UTC Build Time: None
GoVersion: go1.15
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
```
",1,prefixed column clustered index s duplicate error message differ to mysql bug report please answer these questions before submitting your issue thanks minimal reproduce step required set tidb enable clustered index create table t name varchar b int c int primary key name index idx b insert into t name b values cha insert into t name b values chb what did you expect to see required error duplicate entry ch for key primary what did you see instead required error duplicate entry chb for key primary what is your tidb version required release version none edition community git commit hash none git branch none utc build time none goversion race enabled false tikv min version check table before drop false ,1
15229,19325304162.0,IssuesEvent,2021-12-14 10:38:36,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,JSON_EXTRACT function does not get the expected result,type/bug type/compatibility severity/moderate component/executor,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```sql
SELECT JSON_EXTRACT('{""properties"": {""$type"": ""TiDB""}}','$.properties.$type')
```
### 2. What did you expect to see? (Required)
""TiDB""
### 3. What did you see instead (Required)
{""$type"": ""TiDB""}
### 4. What is your TiDB version? (Required)
5.7.25-TiDB-v5.1.0",True,"JSON_EXTRACT function does not get the expected result - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```sql
SELECT JSON_EXTRACT('{""properties"": {""$type"": ""TiDB""}}','$.properties.$type')
```
### 2. What did you expect to see? (Required)
""TiDB""
### 3. What did you see instead (Required)
{""$type"": ""TiDB""}
### 4. What is your TiDB version? (Required)
5.7.25-TiDB-v5.1.0",1,json extract function does not get the expected result bug report please answer these questions before submitting your issue thanks minimal reproduce step required sql select json extract properties type tidb properties type what did you expect to see required tidb what did you see instead required type tidb what is your tidb version required tidb ,1
11149,13164855839.0,IssuesEvent,2020-08-11 05:02:19,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,TiDB does not support COM_RESET_CONNECTION,component/mysql-protocol type/compatibility," var conn = new MySql.Data.MySqlClient.MySqlConnection();
using (conn)
{
conn.Open();
}
conn = new MySql.Data.MySqlClient.MySqlConnection();
using (conn)
{
conn.Open(); // Crash here!!!
}
when close connection then use another one, crash on open method with the exception:
MySql.Data.MySqlClient.MySqlException:“ERROR 1105 (HY000): command 17 not supported now”",True,"TiDB does not support COM_RESET_CONNECTION - var conn = new MySql.Data.MySqlClient.MySqlConnection();
using (conn)
{
conn.Open();
}
conn = new MySql.Data.MySqlClient.MySqlConnection();
using (conn)
{
conn.Open(); // Crash here!!!
}
when close connection then use another one, crash on open method with the exception:
MySql.Data.MySqlClient.MySqlException:“ERROR 1105 (HY000): command 17 not supported now”",1,tidb does not support com reset connection var conn new mysql data mysqlclient mysqlconnection using conn conn open conn new mysql data mysqlclient mysqlconnection using conn conn open crash here when close connection then use another one crash on open method with the exception mysql data mysqlclient mysqlexception “error command not supported now”,1
6239,8638222438.0,IssuesEvent,2018-11-23 14:03:32,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,GRANT statements do not invalidate privilege cache,type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```
CREATE USER ted;
```
Immediately after:
```
mysql -u ted
```
2. What did you expect to see?
Login should work.
3. What did you see instead?
Error (requires `FLUSH PRIVILEGES` to be run).
For MySQL the following commands imply `FLUSH PRIVILEGES`:
- GRANT
- CREATE USER
- SET PASSWORD
- REVOKE
- DROP USER
The TiDB test suite also contains a lot of `FLUSH PRIVILEGES` commands that for MySQL compatibility would not be required.
This has the greatest impact on users that have permission to change their password, but don't have the ability to `FLUSH PRIVILEGES`! (fixed in https://github.com/pingcap/tidb/pull/8426 ) i.e. it is a very weird semantic for the change to take effect much further down the line.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v2.1.0-rc.3-213-g4ec77d5cb
Git Commit Hash: 4ec77d5cbe2536b587afa457a7dcc06bac61eda4
Git Branch: set-password
UTC Build Time: 2018-11-23 01:59:37
GoVersion: go version go1.11 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
1 row in set (0.00 sec)
```
",True,"GRANT statements do not invalidate privilege cache - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```
CREATE USER ted;
```
Immediately after:
```
mysql -u ted
```
2. What did you expect to see?
Login should work.
3. What did you see instead?
Error (requires `FLUSH PRIVILEGES` to be run).
For MySQL the following commands imply `FLUSH PRIVILEGES`:
- GRANT
- CREATE USER
- SET PASSWORD
- REVOKE
- DROP USER
The TiDB test suite also contains a lot of `FLUSH PRIVILEGES` commands that for MySQL compatibility would not be required.
This has the greatest impact on users that have permission to change their password, but don't have the ability to `FLUSH PRIVILEGES`! (fixed in https://github.com/pingcap/tidb/pull/8426 ) i.e. it is a very weird semantic for the change to take effect much further down the line.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v2.1.0-rc.3-213-g4ec77d5cb
Git Commit Hash: 4ec77d5cbe2536b587afa457a7dcc06bac61eda4
Git Branch: set-password
UTC Build Time: 2018-11-23 01:59:37
GoVersion: go version go1.11 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
1 row in set (0.00 sec)
```
",1,grant statements do not invalidate privilege cache bug report please answer these questions before submitting your issue thanks what did you do create user ted immediately after mysql u ted what did you expect to see login should work what did you see instead error requires flush privileges to be run for mysql the following commands imply flush privileges grant create user set password revoke drop user the tidb test suite also contains a lot of flush privileges commands that for mysql compatibility would not be required this has the greatest impact on users that have permission to change their password but don t have the ability to flush privileges fixed in i e it is a very weird semantic for the change to take effect much further down the line what version of tidb are you using tidb server v or run select tidb version on tidb mysql select tidb version g row tidb version release version rc git commit hash git branch set password utc build time goversion go version linux race enabled false tikv min version alpha check table before drop false row in set sec ,1
11938,14076899826.0,IssuesEvent,2020-11-04 11:10:04,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,mysql compatibility: enum element length limit,sig/DDL status/help-wanted type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
According to [MySQL 8.0 Refman](https://dev.mysql.com/doc/refman/8.0/en/string-type-syntax.html): `The maximum supported length of an individual ENUM element is M <= 255 and (M x w) <= 1020, where M is the element literal length and w is the number of bytes required for the maximum-length character in the character set.`
### 1. Minimal reproduce step (Required)
```sql
create table t (a enum('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'))
```
### 2. What did you expect to see? (Required)
On MySQL:
```
mysql root@127.0.0.1:test> create table t (a enum('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'))
(3505, 'Too long enumeration/set value for column a.')
```
### 3. What did you see instead (Required)
On TiDB:
```
mysql root@127.0.0.1:test> create table t (a enum('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'))
Query OK, 0 rows affected
Time: 0.004s
```
### 4. Affected version (Required)
```
mysql root@127.0.0.1:test> select tidb_version()
+-------------------------------------------------------------------+
| tidb_version() |
+-------------------------------------------------------------------+
| Release Version: v4.0.0-beta.2-893-g4e829aaee |
| Edition: Community |
| Git Commit Hash: 4e829aaee7b656aa807814708ae05af5233302af |
| Git Branch: master |
| UTC Build Time: 2020-08-05 02:23:17 |
| GoVersion: go1.14.4 |
| Race Enabled: false |
| TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306 |
| Check Table Before Drop: false |
+-------------------------------------------------------------------+
1 row in set
Time: 0.014s
```
### 5. Root Cause Analysis
",True,"mysql compatibility: enum element length limit - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
According to [MySQL 8.0 Refman](https://dev.mysql.com/doc/refman/8.0/en/string-type-syntax.html): `The maximum supported length of an individual ENUM element is M <= 255 and (M x w) <= 1020, where M is the element literal length and w is the number of bytes required for the maximum-length character in the character set.`
### 1. Minimal reproduce step (Required)
```sql
create table t (a enum('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'))
```
### 2. What did you expect to see? (Required)
On MySQL:
```
mysql root@127.0.0.1:test> create table t (a enum('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'))
(3505, 'Too long enumeration/set value for column a.')
```
### 3. What did you see instead (Required)
On TiDB:
```
mysql root@127.0.0.1:test> create table t (a enum('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'))
Query OK, 0 rows affected
Time: 0.004s
```
### 4. Affected version (Required)
```
mysql root@127.0.0.1:test> select tidb_version()
+-------------------------------------------------------------------+
| tidb_version() |
+-------------------------------------------------------------------+
| Release Version: v4.0.0-beta.2-893-g4e829aaee |
| Edition: Community |
| Git Commit Hash: 4e829aaee7b656aa807814708ae05af5233302af |
| Git Branch: master |
| UTC Build Time: 2020-08-05 02:23:17 |
| GoVersion: go1.14.4 |
| Race Enabled: false |
| TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306 |
| Check Table Before Drop: false |
+-------------------------------------------------------------------+
1 row in set
Time: 0.014s
```
### 5. Root Cause Analysis
",1,mysql compatibility enum element length limit bug report please answer these questions before submitting your issue thanks according to the maximum supported length of an individual enum element is m and m x w where m is the element literal length and w is the number of bytes required for the maximum length character in the character set minimal reproduce step required sql create table t a enum aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa what did you expect to see required on mysql mysql root test create table t a enum aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa too long enumeration set value for column a what did you see instead required on tidb mysql root test create table t a enum aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa query ok rows affected time affected version required mysql root test select tidb version tidb version release version beta edition community git commit hash git branch master utc build time goversion race enabled false tikv min version check table before drop false row in set time root cause analysis ,1
5766,8214957702.0,IssuesEvent,2018-09-05 02:29:12,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,parser failed to parse comment starts with two dash without whitespace but follows by other control character,component/parser type/compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
--
-- this is a comment.
--
CREATE TABLE `test`.`test_table_with_comment` (`id` int);
```
Note: The is no whitespace after the first `--` and third `--`.
If we use ""%q"" in Go to format, it will look like:
```
""--\n-- this is a comment.\n--\nCREATE TABLE `test`.`test_table_with_comment` (`id` int);\n""
```
Btw, I test with parser code, not execution in mysql client.
2. What did you expect to see?
```
Query OK, 0 rows affected (0.20 sec)
```
3. What did you see instead?
```
line 1 column 1 near ""-
-- this is a comment.
--
CREATE TABLE `test`.`test_table_with_comment` (`id` int);
"" (total length 86)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
418cdf2308c8ebedadbf356142f9afbab9aea111
According to mysql doc: https://dev.mysql.com/doc/refman/5.7/en/ansi-diff-comments.html
>Standard SQL uses “--” as a start-comment sequence. MySQL Server uses # as the start comment character. MySQL Server also supports a variant of the -- comment style. That is, the -- start-comment sequence must be followed by a space (or by a control character such as a newline).
I found that we only support whitespace in `lexer.go`
```
func startWithDash(s *Scanner) (tok int, pos Pos, lit string) {
pos = s.r.pos()
// should we support more control character(space character) ?
if strings.HasPrefix(s.r.s[pos.Offset:], ""-- "") {
s.r.incN(3)
s.r.incAsLongAs(func(ch rune) bool {
return ch != '\n'
})
return s.scan()
}
if strings.HasPrefix(s.r.s[pos.Offset:], ""->>"") {
tok = juss
s.r.incN(3)
return
}
if strings.HasPrefix(s.r.s[pos.Offset:], ""->"") {
tok = jss
s.r.incN(2)
return
}
tok = int('-')
s.r.inc()
return
}
```",True,"parser failed to parse comment starts with two dash without whitespace but follows by other control character - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
--
-- this is a comment.
--
CREATE TABLE `test`.`test_table_with_comment` (`id` int);
```
Note: The is no whitespace after the first `--` and third `--`.
If we use ""%q"" in Go to format, it will look like:
```
""--\n-- this is a comment.\n--\nCREATE TABLE `test`.`test_table_with_comment` (`id` int);\n""
```
Btw, I test with parser code, not execution in mysql client.
2. What did you expect to see?
```
Query OK, 0 rows affected (0.20 sec)
```
3. What did you see instead?
```
line 1 column 1 near ""-
-- this is a comment.
--
CREATE TABLE `test`.`test_table_with_comment` (`id` int);
"" (total length 86)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
418cdf2308c8ebedadbf356142f9afbab9aea111
According to mysql doc: https://dev.mysql.com/doc/refman/5.7/en/ansi-diff-comments.html
>Standard SQL uses “--” as a start-comment sequence. MySQL Server uses # as the start comment character. MySQL Server also supports a variant of the -- comment style. That is, the -- start-comment sequence must be followed by a space (or by a control character such as a newline).
I found that we only support whitespace in `lexer.go`
```
func startWithDash(s *Scanner) (tok int, pos Pos, lit string) {
pos = s.r.pos()
// should we support more control character(space character) ?
if strings.HasPrefix(s.r.s[pos.Offset:], ""-- "") {
s.r.incN(3)
s.r.incAsLongAs(func(ch rune) bool {
return ch != '\n'
})
return s.scan()
}
if strings.HasPrefix(s.r.s[pos.Offset:], ""->>"") {
tok = juss
s.r.incN(3)
return
}
if strings.HasPrefix(s.r.s[pos.Offset:], ""->"") {
tok = jss
s.r.incN(2)
return
}
tok = int('-')
s.r.inc()
return
}
```",1,parser failed to parse comment starts with two dash without whitespace but follows by other control character please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error this is a comment create table test test table with comment id int note the is no whitespace after the first and third if we use q in go to format it will look like n this is a comment n ncreate table test test table with comment id int n btw i test with parser code not execution in mysql client what did you expect to see query ok rows affected sec what did you see instead line column near this is a comment create table test test table with comment id int total length what version of tidb are you using tidb server v or run select tidb version on tidb according to mysql doc standard sql uses “ ” as a start comment sequence mysql server uses as the start comment character mysql server also supports a variant of the comment style that is the start comment sequence must be followed by a space or by a control character such as a newline i found that we only support whitespace in lexer go func startwithdash s scanner tok int pos pos lit string pos s r pos should we support more control character space character if strings hasprefix s r s s r incn s r incaslongas func ch rune bool return ch n return s scan if strings hasprefix s r s tok juss s r incn return if strings hasprefix s r s tok jss s r incn return tok int s r inc return ,1
8679,10605931139.0,IssuesEvent,2019-10-10 21:40:12,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Navicat fails to connect (due to missing mysql.proc_priv table),help wanted type/compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
SELECT * FROM mysql.procs_priv;
2. What did you expect to see?
Host Db User Routine_name Routine_type Grantor Proc_priv Timestamp
3. What did you see instead?
[Err] 1146 - Table 'mysql.procs_priv' doesn't exist
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
1.1.0-dev.2
TiDB don't have t mysql.proc_priv table. Navicat have failed to login in TiDB with non-root user because it got an error by sending such sql query.",True,"Navicat fails to connect (due to missing mysql.proc_priv table) - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
SELECT * FROM mysql.procs_priv;
2. What did you expect to see?
Host Db User Routine_name Routine_type Grantor Proc_priv Timestamp
3. What did you see instead?
[Err] 1146 - Table 'mysql.procs_priv' doesn't exist
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
1.1.0-dev.2
TiDB don't have t mysql.proc_priv table. Navicat have failed to login in TiDB with non-root user because it got an error by sending such sql query.",1,navicat fails to connect due to missing mysql proc priv table please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error select from mysql procs priv what did you expect to see host db user routine name routine type grantor proc priv timestamp what did you see instead table mysql procs priv doesn t exist what version of tidb are you using tidb server v or run select tidb version on tidb dev tidb don t have t mysql proc priv table navicat have failed to login in tidb with non root user because it got an error by sending such sql query ,1
19384,26903946824.0,IssuesEvent,2023-02-06 17:32:02,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Column defaults in ComFieldList response violate protocol,type/bug type/compatibility component/mysql-protocol severity/minor compatibility-mysql8,"## Bug Report
The `mysql.ComFieldList` returns default values for columns. However this isn't fully implemented in TiDB, so it won't send the actual defaults and it also seems to violate the protocol.
### 1. Minimal reproduce step (Required)
Send a field list query, e.g. by connecting without database and running `use test` in the MySQL Client.
Dump and inspect traffic with Wireshark
### 2. What did you expect to see? (Required)
Proper column defaults
### 3. What did you see instead (Required)
Too many zeros being written.
### 4. What is your TiDB version? (Required)
```
$ ./bin/tidb-server -V
Release Version: v6.6.0-alpha-274-g1e0956d5b
Edition: Community
Git Commit Hash: 1e0956d5ba41182e603295e02ae8f767d62979e4
Git Branch: master
UTC Build Time: 2023-01-22 23:13:24
GoVersion: go1.19.5
Race Enabled: false
TiKV Min Version: 6.2.0-alpha
Check Table Before Drop: false
Store: unistore
```",True,"Column defaults in ComFieldList response violate protocol - ## Bug Report
The `mysql.ComFieldList` returns default values for columns. However this isn't fully implemented in TiDB, so it won't send the actual defaults and it also seems to violate the protocol.
### 1. Minimal reproduce step (Required)
Send a field list query, e.g. by connecting without database and running `use test` in the MySQL Client.
Dump and inspect traffic with Wireshark
### 2. What did you expect to see? (Required)
Proper column defaults
### 3. What did you see instead (Required)
Too many zeros being written.
### 4. What is your TiDB version? (Required)
```
$ ./bin/tidb-server -V
Release Version: v6.6.0-alpha-274-g1e0956d5b
Edition: Community
Git Commit Hash: 1e0956d5ba41182e603295e02ae8f767d62979e4
Git Branch: master
UTC Build Time: 2023-01-22 23:13:24
GoVersion: go1.19.5
Race Enabled: false
TiKV Min Version: 6.2.0-alpha
Check Table Before Drop: false
Store: unistore
```",1,column defaults in comfieldlist response violate protocol bug report the mysql comfieldlist returns default values for columns however this isn t fully implemented in tidb so it won t send the actual defaults and it also seems to violate the protocol minimal reproduce step required send a field list query e g by connecting without database and running use test in the mysql client dump and inspect traffic with wireshark what did you expect to see required proper column defaults what did you see instead required too many zeros being written what is your tidb version required bin tidb server v release version alpha edition community git commit hash git branch master utc build time goversion race enabled false tikv min version alpha check table before drop false store unistore ,1
3679,6549981555.0,IssuesEvent,2017-09-05 09:14:03,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Create table date default value meets now() should fail.,compatibility,"MySQL:
```
mysql> CREATE TABLE `t` (`a` date DEFAULT now());
ERROR 1067 (42000): Invalid default value for 'a'
```
TiDB:
```
mysql> CREATE TABLE `t` (`a` date DEFAULT now());
Query OK, 0 rows affected (0.07 sec)
```
See: https://dev.mysql.com/doc/refman/5.7/en/data-type-defaults.html
",True,"Create table date default value meets now() should fail. - MySQL:
```
mysql> CREATE TABLE `t` (`a` date DEFAULT now());
ERROR 1067 (42000): Invalid default value for 'a'
```
TiDB:
```
mysql> CREATE TABLE `t` (`a` date DEFAULT now());
Query OK, 0 rows affected (0.07 sec)
```
See: https://dev.mysql.com/doc/refman/5.7/en/data-type-defaults.html
",1,create table date default value meets now should fail mysql mysql create table t a date default now error invalid default value for a tidb mysql create table t a date default now query ok rows affected sec see ,1
5695,8161015054.0,IssuesEvent,2018-08-24 05:15:22,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,INFORMATION_SCHEMA.COLUMNS's PRECISION value for different type,type/compatibility,"1. What did you do?
```
create table testprec(x decimal, y time, z datetime, e timestamp, f bit);
select * from INFORMATION_SCHEMA.COLUMNS where TABLE_NAMe = 'testprec'\G;
```
2. What did you expect to see?
```
*************************** 1. row ***************************
TABLE_CATALOG: def
TABLE_SCHEMA: test
TABLE_NAME: testprec
COLUMN_NAME: x
NUMERIC_PRECISION: 10
DATETIME_PRECISION: NULL
GENERATION_EXPRESSION:
*************************** 2. row ***************************
TABLE_CATALOG: def
TABLE_SCHEMA: test
TABLE_NAME: testprec
COLUMN_NAME: y
NUMERIC_PRECISION: NULL
DATETIME_PRECISION: 0
GENERATION_EXPRESSION:
*************************** 3. row ***************************
TABLE_CATALOG: def
TABLE_SCHEMA: test
TABLE_NAME: testprec
COLUMN_NAME: z
NUMERIC_PRECISION: NULL
DATETIME_PRECISION: 0
GENERATION_EXPRESSION:
*************************** 4. row ***************************
TABLE_CATALOG: def
TABLE_SCHEMA: test
TABLE_NAME: testprec
COLUMN_NAME: e
NUMERIC_PRECISION: NULL
DATETIME_PRECISION: 0
GENERATION_EXPRESSION:
*************************** 5. row ***************************
TABLE_CATALOG: def
TABLE_SCHEMA: test
TABLE_NAME: testprec
COLUMN_NAME: f
NUMERIC_PRECISION: 1
DATETIME_PRECISION: NULL
GENERATION_EXPRESSION:
5 rows in set (0.00 sec)
```
3. What did you see instead?
```
*************************** 1. row ***************************
TABLE_CATALOG: def
TABLE_SCHEMA: test
TABLE_NAME: testprec
NUMERIC_PRECISION: 0
DATETIME_PRECISION: 0
GENERATION_EXPRESSION:
*************************** 2. row ***************************
TABLE_CATALOG: def
TABLE_SCHEMA: test
TABLE_NAME: testprec
COLUMN_NAME: y
NUMERIC_PRECISION: 0
DATETIME_PRECISION: 0
GENERATION_EXPRESSION:
*************************** 3. row ***************************
TABLE_CATALOG: def
TABLE_SCHEMA: test
TABLE_NAME: testprec
COLUMN_NAME: z
NUMERIC_PRECISION: 0
DATETIME_PRECISION: 0
CHARACTER_SET_NAME: NULL
GENERATION_EXPRESSION:
*************************** 4. row ***************************
TABLE_CATALOG: def
TABLE_SCHEMA: test
TABLE_NAME: testprec
COLUMN_NAME: e
NUMERIC_PRECISION: 0
DATETIME_PRECISION: 0
GENERATION_EXPRESSION:
*************************** 5. row ***************************
TABLE_CATALOG: def
TABLE_SCHEMA: test
TABLE_NAME: testprec
COLUMN_NAME: f
NUMERIC_PRECISION: 0
DATETIME_PRECISION: 0
GENERATION_EXPRESSION:
5 rows in set (0.03 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
",True,"INFORMATION_SCHEMA.COLUMNS's PRECISION value for different type - 1. What did you do?
```
create table testprec(x decimal, y time, z datetime, e timestamp, f bit);
select * from INFORMATION_SCHEMA.COLUMNS where TABLE_NAMe = 'testprec'\G;
```
2. What did you expect to see?
```
*************************** 1. row ***************************
TABLE_CATALOG: def
TABLE_SCHEMA: test
TABLE_NAME: testprec
COLUMN_NAME: x
NUMERIC_PRECISION: 10
DATETIME_PRECISION: NULL
GENERATION_EXPRESSION:
*************************** 2. row ***************************
TABLE_CATALOG: def
TABLE_SCHEMA: test
TABLE_NAME: testprec
COLUMN_NAME: y
NUMERIC_PRECISION: NULL
DATETIME_PRECISION: 0
GENERATION_EXPRESSION:
*************************** 3. row ***************************
TABLE_CATALOG: def
TABLE_SCHEMA: test
TABLE_NAME: testprec
COLUMN_NAME: z
NUMERIC_PRECISION: NULL
DATETIME_PRECISION: 0
GENERATION_EXPRESSION:
*************************** 4. row ***************************
TABLE_CATALOG: def
TABLE_SCHEMA: test
TABLE_NAME: testprec
COLUMN_NAME: e
NUMERIC_PRECISION: NULL
DATETIME_PRECISION: 0
GENERATION_EXPRESSION:
*************************** 5. row ***************************
TABLE_CATALOG: def
TABLE_SCHEMA: test
TABLE_NAME: testprec
COLUMN_NAME: f
NUMERIC_PRECISION: 1
DATETIME_PRECISION: NULL
GENERATION_EXPRESSION:
5 rows in set (0.00 sec)
```
3. What did you see instead?
```
*************************** 1. row ***************************
TABLE_CATALOG: def
TABLE_SCHEMA: test
TABLE_NAME: testprec
NUMERIC_PRECISION: 0
DATETIME_PRECISION: 0
GENERATION_EXPRESSION:
*************************** 2. row ***************************
TABLE_CATALOG: def
TABLE_SCHEMA: test
TABLE_NAME: testprec
COLUMN_NAME: y
NUMERIC_PRECISION: 0
DATETIME_PRECISION: 0
GENERATION_EXPRESSION:
*************************** 3. row ***************************
TABLE_CATALOG: def
TABLE_SCHEMA: test
TABLE_NAME: testprec
COLUMN_NAME: z
NUMERIC_PRECISION: 0
DATETIME_PRECISION: 0
CHARACTER_SET_NAME: NULL
GENERATION_EXPRESSION:
*************************** 4. row ***************************
TABLE_CATALOG: def
TABLE_SCHEMA: test
TABLE_NAME: testprec
COLUMN_NAME: e
NUMERIC_PRECISION: 0
DATETIME_PRECISION: 0
GENERATION_EXPRESSION:
*************************** 5. row ***************************
TABLE_CATALOG: def
TABLE_SCHEMA: test
TABLE_NAME: testprec
COLUMN_NAME: f
NUMERIC_PRECISION: 0
DATETIME_PRECISION: 0
GENERATION_EXPRESSION:
5 rows in set (0.03 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
",1,information schema columns s precision value for different type what did you do create table testprec x decimal y time z datetime e timestamp f bit select from information schema columns where table name testprec g what did you expect to see row table catalog def table schema test table name testprec column name x numeric precision datetime precision null generation expression row table catalog def table schema test table name testprec column name y numeric precision null datetime precision generation expression row table catalog def table schema test table name testprec column name z numeric precision null datetime precision generation expression row table catalog def table schema test table name testprec column name e numeric precision null datetime precision generation expression row table catalog def table schema test table name testprec column name f numeric precision datetime precision null generation expression rows in set sec what did you see instead row table catalog def table schema test table name testprec numeric precision datetime precision generation expression row table catalog def table schema test table name testprec column name y numeric precision datetime precision generation expression row table catalog def table schema test table name testprec column name z numeric precision datetime precision character set name null generation expression row table catalog def table schema test table name testprec column name e numeric precision datetime precision generation expression row table catalog def table schema test table name testprec column name f numeric precision datetime precision generation expression rows in set sec what version of tidb are you using tidb server v or run select tidb version on tidb ,1
11031,13065168365.0,IssuesEvent,2020-07-30 19:20:31,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,ifnull should not do type conversion?,type/compatibility,"This is a compatibility issue.
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
use test;
create table t1 (id int unsigned);
insert into t1 values (NULL);
select ifnull(id, -1) from t1;
```
2. What did you expect to see?
This is the output when executed on MySQL
```sql
MariaDB [test]> create table t1 (id int unsigned);
Query OK, 0 rows affected (0.13 sec)
MariaDB [test]> insert into t1 values (NULL);
Query OK, 1 row affected (0.00 sec)
MariaDB [test]> select ifnull(id, -1) from t1;
+----------------+
| ifnull(id, -1) |
+----------------+
| -1 |
+----------------+
1 row in set (0.00 sec)
MariaDB [test]>
```
3. What did you see instead?
```sql
TiDB-Server [test]> create table t1 (id int unsigned);
Query OK, 0 rows affected (0.01 sec)
TiDB-Server [test]> insert into t1 values (NULL);
Query OK, 1 row affected (0.00 sec)
TiDB-Server [test]> select ifnull(id, -1) from t1;
+----------------------+
| ifnull(id, -1) |
+----------------------+
| 18446744073709551615 |
+----------------------+
1 row in set (0.00 sec)
```
since ifnull can also so use string as second parameter, convert from int to unsinged int seems not necessary.
``` sql
MySQL [test]> select ifnull(id, 'a') from t1;
+-----------------+
| ifnull(id, 'a') |
+-----------------+
| a |
+-----------------+
1 row in set (0.01 sec)
```
4. What version of TiDB are you using (`tidb-server -V`)?
Git Commit Hash: b1a3244e73e038589ab993ab02267528254ffcb2
",True,"ifnull should not do type conversion? - This is a compatibility issue.
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
use test;
create table t1 (id int unsigned);
insert into t1 values (NULL);
select ifnull(id, -1) from t1;
```
2. What did you expect to see?
This is the output when executed on MySQL
```sql
MariaDB [test]> create table t1 (id int unsigned);
Query OK, 0 rows affected (0.13 sec)
MariaDB [test]> insert into t1 values (NULL);
Query OK, 1 row affected (0.00 sec)
MariaDB [test]> select ifnull(id, -1) from t1;
+----------------+
| ifnull(id, -1) |
+----------------+
| -1 |
+----------------+
1 row in set (0.00 sec)
MariaDB [test]>
```
3. What did you see instead?
```sql
TiDB-Server [test]> create table t1 (id int unsigned);
Query OK, 0 rows affected (0.01 sec)
TiDB-Server [test]> insert into t1 values (NULL);
Query OK, 1 row affected (0.00 sec)
TiDB-Server [test]> select ifnull(id, -1) from t1;
+----------------------+
| ifnull(id, -1) |
+----------------------+
| 18446744073709551615 |
+----------------------+
1 row in set (0.00 sec)
```
since ifnull can also so use string as second parameter, convert from int to unsinged int seems not necessary.
``` sql
MySQL [test]> select ifnull(id, 'a') from t1;
+-----------------+
| ifnull(id, 'a') |
+-----------------+
| a |
+-----------------+
1 row in set (0.01 sec)
```
4. What version of TiDB are you using (`tidb-server -V`)?
Git Commit Hash: b1a3244e73e038589ab993ab02267528254ffcb2
",1,ifnull should not do type conversion this is a compatibility issue what did you do if possible provide a recipe for reproducing the error sql use test create table id int unsigned insert into values null select ifnull id from what did you expect to see this is the output when executed on mysql sql mariadb create table id int unsigned query ok rows affected sec mariadb insert into values null query ok row affected sec mariadb select ifnull id from ifnull id row in set sec mariadb what did you see instead sql tidb server create table id int unsigned query ok rows affected sec tidb server insert into values null query ok row affected sec tidb server select ifnull id from ifnull id row in set sec since ifnull can also so use string as second parameter convert from int to unsinged int seems not necessary sql mysql select ifnull id a from ifnull id a a row in set sec what version of tidb are you using tidb server v git commit hash ,1
12198,14395554298.0,IssuesEvent,2020-12-03 04:03:50,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Convert ddl types automatically according to length i.e. BLOB(3) -> TINYBLOB.,difficulty/easy hacktoberfest sig/DDL status/help-wanted type/compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What version of Go are you using (`go version`)?
1.5.1
2. What operating system and processor architecture are you using (`go env`)?
Linux
3. What did you do?
```
CREATE TABLE mysql_types (
c1 BLOB(3),
c2 BLOB,
c3 BINARY(3),
c4 VARBINARY(3),
c5 TINYBLOB,
c6 BLOB,
c7 BLOB(1234),
c8 MEDIUMBLOB,
c9 LONGBLOB
);
SHOW CREATE TABLE `mysql_types`;
```
4. What did you expect to see?
```
+-------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| mysql_types | CREATE TABLE `mysql_types` (
`c1` tinyblob,
`c2` blob,
`c3` binary(3) DEFAULT NULL,
`c4` varbinary(3) DEFAULT NULL,
`c5` tinyblob,
`c6` blob,
`c7` blob,
`c8` mediumblob,
`c9` longblob
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
```
5. What did you see instead?
```
+-------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| mysql_types | CREATE TABLE `mysql_types` (
`c1` blob(3) DEFAULT NULL,
`c2` blob DEFAULT NULL,
`c3` binary(3) DEFAULT NULL,
`c4` varbinary(3) DEFAULT NULL,
`c5` tinyblob DEFAULT NULL,
`c6` blob DEFAULT NULL,
`c7` blob(1234) DEFAULT NULL,
`c8` mediumblob DEFAULT NULL,
`c9` longblob DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
```",True,"Convert ddl types automatically according to length i.e. BLOB(3) -> TINYBLOB. - Please answer these questions before submitting your issue. Thanks!
1. What version of Go are you using (`go version`)?
1.5.1
2. What operating system and processor architecture are you using (`go env`)?
Linux
3. What did you do?
```
CREATE TABLE mysql_types (
c1 BLOB(3),
c2 BLOB,
c3 BINARY(3),
c4 VARBINARY(3),
c5 TINYBLOB,
c6 BLOB,
c7 BLOB(1234),
c8 MEDIUMBLOB,
c9 LONGBLOB
);
SHOW CREATE TABLE `mysql_types`;
```
4. What did you expect to see?
```
+-------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| mysql_types | CREATE TABLE `mysql_types` (
`c1` tinyblob,
`c2` blob,
`c3` binary(3) DEFAULT NULL,
`c4` varbinary(3) DEFAULT NULL,
`c5` tinyblob,
`c6` blob,
`c7` blob,
`c8` mediumblob,
`c9` longblob
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
```
5. What did you see instead?
```
+-------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| mysql_types | CREATE TABLE `mysql_types` (
`c1` blob(3) DEFAULT NULL,
`c2` blob DEFAULT NULL,
`c3` binary(3) DEFAULT NULL,
`c4` varbinary(3) DEFAULT NULL,
`c5` tinyblob DEFAULT NULL,
`c6` blob DEFAULT NULL,
`c7` blob(1234) DEFAULT NULL,
`c8` mediumblob DEFAULT NULL,
`c9` longblob DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
```",1,convert ddl types automatically according to length i e blob tinyblob please answer these questions before submitting your issue thanks what version of go are you using go version what operating system and processor architecture are you using go env linux what did you do create table mysql types blob blob binary varbinary tinyblob blob blob mediumblob longblob show create table mysql types what did you expect to see table create table mysql types create table mysql types tinyblob blob binary default null varbinary default null tinyblob blob blob mediumblob longblob engine innodb default charset what did you see instead table create table mysql types create table mysql types blob default null blob default null binary default null varbinary default null tinyblob default null blob default null blob default null mediumblob default null longblob default null engine innodb default charset ,1
3301,6261686382.0,IssuesEvent,2017-07-15 02:16:25,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,create user without quotes failed,compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
exec sql `create user user1@localhost;`
2. What did you expect to see?
```
mysql> create user user1@localhost;
Query OK, 0 rows affected (0.00 sec)
```
3. What did you see instead?
```
mysql> create user uesr1@localhost;
ERROR 1105 (HY000): line 0 column 17 near ""@localhost"" (total length 27)
```
but add quotes will succeed:
```
create user 'uesr1'@'localhost';
```
4. What version of TiDB are you using (`tidb-server -V`)?
```
Git Commit Hash: d1328e1b7282c026e579a413db3ad386c15fdabf
UTC Build Time: 2017-06-22 03:37:28
```
",True,"create user without quotes failed - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
exec sql `create user user1@localhost;`
2. What did you expect to see?
```
mysql> create user user1@localhost;
Query OK, 0 rows affected (0.00 sec)
```
3. What did you see instead?
```
mysql> create user uesr1@localhost;
ERROR 1105 (HY000): line 0 column 17 near ""@localhost"" (total length 27)
```
but add quotes will succeed:
```
create user 'uesr1'@'localhost';
```
4. What version of TiDB are you using (`tidb-server -V`)?
```
Git Commit Hash: d1328e1b7282c026e579a413db3ad386c15fdabf
UTC Build Time: 2017-06-22 03:37:28
```
",1,create user without quotes failed please answer these questions before submitting your issue thanks what did you do exec sql create user localhost what did you expect to see mysql create user localhost query ok rows affected sec what did you see instead mysql create user localhost error line column near localhost total length but add quotes will succeed create user localhost what version of tidb are you using tidb server v git commit hash utc build time ,1
5274,7802456618.0,IssuesEvent,2018-06-10 12:49:38,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Add support for alter table convert to syntax,compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
mysql > create table user(id int);
mysql> alter table user CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
```
2. What did you expect to see?
```
mysql> alter table user CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
Query OK, 0 rows affected (0.09 sec)
Records: 0 Duplicates: 0 Warnings: 0
```
3. What did you see instead?
```
mysql> alter table user CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
ERROR 1105 (HY000): line 1 column 25 near "" TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin"" (total length 70)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
tidb_version(): Release Version: v1.1.0-alpha-293-g0b5c0cf9
Git Commit Hash: 0b5c0cf94d852901f8e2392917a97d85eb851a55
Git Branch: master
UTC Build Time: 2018-01-02 07:53:48
```
Ref:
```
ALTER TABLE tbl_name
| CONVERT TO CHARACTER SET charset_name [COLLATE collation_name]
```",True,"Add support for alter table convert to syntax - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
mysql > create table user(id int);
mysql> alter table user CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
```
2. What did you expect to see?
```
mysql> alter table user CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
Query OK, 0 rows affected (0.09 sec)
Records: 0 Duplicates: 0 Warnings: 0
```
3. What did you see instead?
```
mysql> alter table user CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
ERROR 1105 (HY000): line 1 column 25 near "" TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin"" (total length 70)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
tidb_version(): Release Version: v1.1.0-alpha-293-g0b5c0cf9
Git Commit Hash: 0b5c0cf94d852901f8e2392917a97d85eb851a55
Git Branch: master
UTC Build Time: 2018-01-02 07:53:48
```
Ref:
```
ALTER TABLE tbl_name
| CONVERT TO CHARACTER SET charset_name [COLLATE collation_name]
```",1,add support for alter table convert to syntax please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error mysql create table user id int mysql alter table user convert to character set collate bin what did you expect to see mysql alter table user convert to character set collate bin query ok rows affected sec records duplicates warnings what did you see instead mysql alter table user convert to character set collate bin error line column near to character set collate bin total length what version of tidb are you using tidb server v or run select tidb version on tidb tidb version release version alpha git commit hash git branch master utc build time ref alter table tbl name convert to character set charset name ,1
11164,13182146458.0,IssuesEvent,2020-08-12 15:20:08,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,join on int primary key and text is not the same with MySQL,type/compatibility type/wontfix,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```
CREATE TABLE t1 (id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`));
INSERT INTO t1(`id`) VALUES(3);
CREATE TABLE t2 (title text);
INSERT INTO t2(`title`) VALUES(""3.0.1"");
SELECT * FROM t1 JOIN t2 ON t1.id=t2.title;
```
2. What did you expect to see?
* MySQL 8.0
```
mysql> CREATE TABLE t1 (id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`));
Query OK, 0 rows affected, 1 warning (0.01 sec)
mysql> INSERT INTO t1(`id`) VALUES(3);
Query OK, 1 row affected (0.00 sec)
mysql> CREATE TABLE t2 (title text);
Query OK, 0 rows affected (0.00 sec)
mysql> INSERT INTO t2(`title`) VALUES(""3.0.1"");
Query OK, 1 row affected (0.00 sec)
mysql> SELECT * FROM t1 JOIN t2 ON t1.id=t2.title;
Empty set (0.00 sec)
mysql> SELECT version();
+-----------+
| version() |
+-----------+
| 8.0.18 |
+-----------+
1 row in set (0.00 sec)
mysql> EXPLAIN SELECT * FROM t1 JOIN t2 ON t1.id=t2.title;
+----+-------------+-------+------------+--------+---------------+---------+---------+----------------+------+----------+--------------------------+
| id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
+----+-------------+-------+------------+--------+---------------+---------+---------+----------------+------+----------+--------------------------+
| 1 | SIMPLE | t2 | NULL | ALL | NULL | NULL | NULL | NULL | 1 | 100.00 | Using where |
| 1 | SIMPLE | t1 | NULL | eq_ref | PRIMARY | PRIMARY | 4 | repro.t2.title | 1 | 100.00 | Using where; Using index |
+----+-------------+-------+------------+--------+---------------+---------+---------+----------------+------+----------+--------------------------+
2 rows in set, 1 warning (0.00 sec)
```
3. What did you see instead?
* TiDB
```
mysql> CREATE TABLE t1 (id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`));
Query OK, 0 rows affected (0.08 sec)
mysql> INSERT INTO t1(`id`) VALUES(3);
Query OK, 1 row affected (0.01 sec)
mysql> CREATE TABLE t2 (title text);
Query OK, 0 rows affected (0.08 sec)
mysql> INSERT INTO t2(`title`) VALUES(""3.0.1"");
Query OK, 1 row affected (0.01 sec)
mysql> SELECT * FROM t1 JOIN t2 ON t1.id=t2.title;
+----+-------+
| id | title |
+----+-------+
| 3 | 3.0.1 |
+----+-------+
1 row in set, 1 warning (0.00 sec)
mysql> EXPLAIN SELECT * FROM t1 JOIN t2 ON t1.id=t2.title;
+----------------------------+-------+-----------+-----------------------------------------------------------------+
| id | count | task | operator info |
+----------------------------+-------+-----------+-----------------------------------------------------------------+
| Projection_8 | 1.00 | root | Column#1, Column#2 |
| └─HashLeftJoin_9 | 1.00 | root | inner join, inner:Projection_14, equal:[eq(Column#6, Column#7)] |
| ├─Projection_11 | 1.00 | root | Column#1, cast(Column#1) |
| │ └─TableReader_13 | 1.00 | root | data:TableScan_12 |
| │ └─TableScan_12 | 1.00 | cop[tikv] | table:t1, range:[-inf,+inf], keep order:false, stats:pseudo |
| └─Projection_14 | 1.00 | root | Column#2, cast(Column#2) |
| └─TableReader_16 | 1.00 | root | data:TableScan_15 |
| └─TableScan_15 | 1.00 | cop[tikv] | table:t2, range:[-inf,+inf], keep order:false, stats:pseudo |
+----------------------------+-------+-----------+-----------------------------------------------------------------+
8 rows in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
Release Version: v4.0.0-alpha-842-g3ca8661b5
Git Commit Hash: 3ca8661b5b3b12ecdfd664a5dd090f2af859a55c
Git Branch: master
UTC Build Time: 2019-11-12 01:03:14
GoVersion: go version go1.13 linux/amd64
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
```
5. More information
BTW, this incorrect behavior only happens in primary key, the following SQLs are executed same in both side.
```
CREATE TABLE t1 (id int);
INSERT INTO t1(`id`) VALUES(3);
CREATE TABLE t2 (title text);
INSERT INTO t2(`title`) VALUES(""3.0.1"");
SELECT * FROM t1 JOIN t2 ON t1.id=t2.title;
```
* In MySQL 8.0
```
mysql> CREATE TABLE t1 (id int);
Query OK, 0 rows affected (0.01 sec)
mysql> INSERT INTO t1(`id`) VALUES(3);
Query OK, 1 row affected (0.00 sec)
mysql> CREATE TABLE t2 (title text);
Query OK, 0 rows affected (0.00 sec)
mysql> INSERT INTO t2(`title`) VALUES(""3.0.1"");
Query OK, 1 row affected (0.00 sec)
mysql> SELECT * FROM t1 JOIN t2 ON t1.id=t2.title;
+------+-------+
| id | title |
+------+-------+
| 3 | 3.0.1 |
+------+-------+
1 row in set (0.01 sec)
mysql> EXPLAIN SELECT * FROM t1 JOIN t2 ON t1.id=t2.title;
+----+-------------+-------+------------+------+---------------+------+---------+------+------+----------+----------------------------------------------------+
| id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
+----+-------------+-------+------------+------+---------------+------+---------+------+------+----------+----------------------------------------------------+
| 1 | SIMPLE | t1 | NULL | ALL | NULL | NULL | NULL | NULL | 1 | 100.00 | NULL |
| 1 | SIMPLE | t2 | NULL | ALL | NULL | NULL | NULL | NULL | 1 | 100.00 | Using where; Using join buffer (Block Nested Loop) |
+----+-------------+-------+------------+------+---------------+------+---------+------+------+----------+----------------------------------------------------+
2 rows in set, 1 warning (0.00 sec)
```
* In TiDB
```
mysql> CREATE TABLE t1 (id int);
Query OK, 0 rows affected (0.08 sec)
mysql> INSERT INTO t1(`id`) VALUES(3);
Query OK, 1 row affected (0.01 sec)
mysql> CREATE TABLE t2 (title text);
Query OK, 0 rows affected (0.08 sec)
mysql> INSERT INTO t2(`title`) VALUES(""3.0.1"");
Query OK, 1 row affected (0.02 sec)
mysql> SELECT * FROM t1 JOIN t2 ON t1.id=t2.title;
+------+-------+
| id | title |
+------+-------+
| 3 | 3.0.1 |
+------+-------+
1 row in set, 1 warning (0.00 sec)
mysql> EXPLAIN SELECT * FROM t1 JOIN t2 ON t1.id=t2.title;
+----------------------------+----------+-----------+-----------------------------------------------------------------+
| id | count | task | operator info |
+----------------------------+----------+-----------+-----------------------------------------------------------------+
| Projection_8 | 12500.00 | root | Column#1, Column#3 |
| └─HashLeftJoin_9 | 12500.00 | root | inner join, inner:Projection_14, equal:[eq(Column#7, Column#8)] |
| ├─Projection_11 | 10000.00 | root | Column#1, cast(Column#1) |
| │ └─TableReader_13 | 10000.00 | root | data:TableScan_12 |
| │ └─TableScan_12 | 10000.00 | cop[tikv] | table:t1, range:[-inf,+inf], keep order:false, stats:pseudo |
| └─Projection_14 | 10000.00 | root | Column#3, cast(Column#3) |
| └─TableReader_16 | 10000.00 | root | data:TableScan_15 |
| └─TableScan_15 | 10000.00 | cop[tikv] | table:t2, range:[-inf,+inf], keep order:false, stats:pseudo |
+----------------------------+----------+-----------+-----------------------------------------------------------------+
8 rows in set (0.00 sec)
```",True,"join on int primary key and text is not the same with MySQL - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```
CREATE TABLE t1 (id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`));
INSERT INTO t1(`id`) VALUES(3);
CREATE TABLE t2 (title text);
INSERT INTO t2(`title`) VALUES(""3.0.1"");
SELECT * FROM t1 JOIN t2 ON t1.id=t2.title;
```
2. What did you expect to see?
* MySQL 8.0
```
mysql> CREATE TABLE t1 (id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`));
Query OK, 0 rows affected, 1 warning (0.01 sec)
mysql> INSERT INTO t1(`id`) VALUES(3);
Query OK, 1 row affected (0.00 sec)
mysql> CREATE TABLE t2 (title text);
Query OK, 0 rows affected (0.00 sec)
mysql> INSERT INTO t2(`title`) VALUES(""3.0.1"");
Query OK, 1 row affected (0.00 sec)
mysql> SELECT * FROM t1 JOIN t2 ON t1.id=t2.title;
Empty set (0.00 sec)
mysql> SELECT version();
+-----------+
| version() |
+-----------+
| 8.0.18 |
+-----------+
1 row in set (0.00 sec)
mysql> EXPLAIN SELECT * FROM t1 JOIN t2 ON t1.id=t2.title;
+----+-------------+-------+------------+--------+---------------+---------+---------+----------------+------+----------+--------------------------+
| id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
+----+-------------+-------+------------+--------+---------------+---------+---------+----------------+------+----------+--------------------------+
| 1 | SIMPLE | t2 | NULL | ALL | NULL | NULL | NULL | NULL | 1 | 100.00 | Using where |
| 1 | SIMPLE | t1 | NULL | eq_ref | PRIMARY | PRIMARY | 4 | repro.t2.title | 1 | 100.00 | Using where; Using index |
+----+-------------+-------+------------+--------+---------------+---------+---------+----------------+------+----------+--------------------------+
2 rows in set, 1 warning (0.00 sec)
```
3. What did you see instead?
* TiDB
```
mysql> CREATE TABLE t1 (id int(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`));
Query OK, 0 rows affected (0.08 sec)
mysql> INSERT INTO t1(`id`) VALUES(3);
Query OK, 1 row affected (0.01 sec)
mysql> CREATE TABLE t2 (title text);
Query OK, 0 rows affected (0.08 sec)
mysql> INSERT INTO t2(`title`) VALUES(""3.0.1"");
Query OK, 1 row affected (0.01 sec)
mysql> SELECT * FROM t1 JOIN t2 ON t1.id=t2.title;
+----+-------+
| id | title |
+----+-------+
| 3 | 3.0.1 |
+----+-------+
1 row in set, 1 warning (0.00 sec)
mysql> EXPLAIN SELECT * FROM t1 JOIN t2 ON t1.id=t2.title;
+----------------------------+-------+-----------+-----------------------------------------------------------------+
| id | count | task | operator info |
+----------------------------+-------+-----------+-----------------------------------------------------------------+
| Projection_8 | 1.00 | root | Column#1, Column#2 |
| └─HashLeftJoin_9 | 1.00 | root | inner join, inner:Projection_14, equal:[eq(Column#6, Column#7)] |
| ├─Projection_11 | 1.00 | root | Column#1, cast(Column#1) |
| │ └─TableReader_13 | 1.00 | root | data:TableScan_12 |
| │ └─TableScan_12 | 1.00 | cop[tikv] | table:t1, range:[-inf,+inf], keep order:false, stats:pseudo |
| └─Projection_14 | 1.00 | root | Column#2, cast(Column#2) |
| └─TableReader_16 | 1.00 | root | data:TableScan_15 |
| └─TableScan_15 | 1.00 | cop[tikv] | table:t2, range:[-inf,+inf], keep order:false, stats:pseudo |
+----------------------------+-------+-----------+-----------------------------------------------------------------+
8 rows in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
Release Version: v4.0.0-alpha-842-g3ca8661b5
Git Commit Hash: 3ca8661b5b3b12ecdfd664a5dd090f2af859a55c
Git Branch: master
UTC Build Time: 2019-11-12 01:03:14
GoVersion: go version go1.13 linux/amd64
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
```
5. More information
BTW, this incorrect behavior only happens in primary key, the following SQLs are executed same in both side.
```
CREATE TABLE t1 (id int);
INSERT INTO t1(`id`) VALUES(3);
CREATE TABLE t2 (title text);
INSERT INTO t2(`title`) VALUES(""3.0.1"");
SELECT * FROM t1 JOIN t2 ON t1.id=t2.title;
```
* In MySQL 8.0
```
mysql> CREATE TABLE t1 (id int);
Query OK, 0 rows affected (0.01 sec)
mysql> INSERT INTO t1(`id`) VALUES(3);
Query OK, 1 row affected (0.00 sec)
mysql> CREATE TABLE t2 (title text);
Query OK, 0 rows affected (0.00 sec)
mysql> INSERT INTO t2(`title`) VALUES(""3.0.1"");
Query OK, 1 row affected (0.00 sec)
mysql> SELECT * FROM t1 JOIN t2 ON t1.id=t2.title;
+------+-------+
| id | title |
+------+-------+
| 3 | 3.0.1 |
+------+-------+
1 row in set (0.01 sec)
mysql> EXPLAIN SELECT * FROM t1 JOIN t2 ON t1.id=t2.title;
+----+-------------+-------+------------+------+---------------+------+---------+------+------+----------+----------------------------------------------------+
| id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
+----+-------------+-------+------------+------+---------------+------+---------+------+------+----------+----------------------------------------------------+
| 1 | SIMPLE | t1 | NULL | ALL | NULL | NULL | NULL | NULL | 1 | 100.00 | NULL |
| 1 | SIMPLE | t2 | NULL | ALL | NULL | NULL | NULL | NULL | 1 | 100.00 | Using where; Using join buffer (Block Nested Loop) |
+----+-------------+-------+------------+------+---------------+------+---------+------+------+----------+----------------------------------------------------+
2 rows in set, 1 warning (0.00 sec)
```
* In TiDB
```
mysql> CREATE TABLE t1 (id int);
Query OK, 0 rows affected (0.08 sec)
mysql> INSERT INTO t1(`id`) VALUES(3);
Query OK, 1 row affected (0.01 sec)
mysql> CREATE TABLE t2 (title text);
Query OK, 0 rows affected (0.08 sec)
mysql> INSERT INTO t2(`title`) VALUES(""3.0.1"");
Query OK, 1 row affected (0.02 sec)
mysql> SELECT * FROM t1 JOIN t2 ON t1.id=t2.title;
+------+-------+
| id | title |
+------+-------+
| 3 | 3.0.1 |
+------+-------+
1 row in set, 1 warning (0.00 sec)
mysql> EXPLAIN SELECT * FROM t1 JOIN t2 ON t1.id=t2.title;
+----------------------------+----------+-----------+-----------------------------------------------------------------+
| id | count | task | operator info |
+----------------------------+----------+-----------+-----------------------------------------------------------------+
| Projection_8 | 12500.00 | root | Column#1, Column#3 |
| └─HashLeftJoin_9 | 12500.00 | root | inner join, inner:Projection_14, equal:[eq(Column#7, Column#8)] |
| ├─Projection_11 | 10000.00 | root | Column#1, cast(Column#1) |
| │ └─TableReader_13 | 10000.00 | root | data:TableScan_12 |
| │ └─TableScan_12 | 10000.00 | cop[tikv] | table:t1, range:[-inf,+inf], keep order:false, stats:pseudo |
| └─Projection_14 | 10000.00 | root | Column#3, cast(Column#3) |
| └─TableReader_16 | 10000.00 | root | data:TableScan_15 |
| └─TableScan_15 | 10000.00 | cop[tikv] | table:t2, range:[-inf,+inf], keep order:false, stats:pseudo |
+----------------------------+----------+-----------+-----------------------------------------------------------------+
8 rows in set (0.00 sec)
```",1,join on int primary key and text is not the same with mysql bug report please answer these questions before submitting your issue thanks what did you do create table id int not null auto increment primary key id insert into id values create table title text insert into title values select from join on id title what did you expect to see mysql mysql create table id int not null auto increment primary key id query ok rows affected warning sec mysql insert into id values query ok row affected sec mysql create table title text query ok rows affected sec mysql insert into title values query ok row affected sec mysql select from join on id title empty set sec mysql select version version row in set sec mysql explain select from join on id title id select type table partitions type possible keys key key len ref rows filtered extra simple null all null null null null using where simple null eq ref primary primary repro title using where using index rows in set warning sec what did you see instead tidb mysql create table id int not null auto increment primary key id query ok rows affected sec mysql insert into id values query ok row affected sec mysql create table title text query ok rows affected sec mysql insert into title values query ok row affected sec mysql select from join on id title id title row in set warning sec mysql explain select from join on id title id count task operator info projection root column column └─hashleftjoin root inner join inner projection equal ├─projection root column cast column │ └─tablereader root data tablescan │ └─tablescan cop table range keep order false stats pseudo └─projection root column cast column └─tablereader root data tablescan └─tablescan cop table range keep order false stats pseudo rows in set sec what version of tidb are you using tidb server v or run select tidb version on tidb release version alpha git commit hash git branch master utc build time goversion go version linux race enabled false tikv min version check table before drop false more information btw this incorrect behavior only happens in primary key the following sqls are executed same in both side create table id int insert into id values create table title text insert into title values select from join on id title in mysql mysql create table id int query ok rows affected sec mysql insert into id values query ok row affected sec mysql create table title text query ok rows affected sec mysql insert into title values query ok row affected sec mysql select from join on id title id title row in set sec mysql explain select from join on id title id select type table partitions type possible keys key key len ref rows filtered extra simple null all null null null null null simple null all null null null null using where using join buffer block nested loop rows in set warning sec in tidb mysql create table id int query ok rows affected sec mysql insert into id values query ok row affected sec mysql create table title text query ok rows affected sec mysql insert into title values query ok row affected sec mysql select from join on id title id title row in set warning sec mysql explain select from join on id title id count task operator info projection root column column └─hashleftjoin root inner join inner projection equal ├─projection root column cast column │ └─tablereader root data tablescan │ └─tablescan cop table range keep order false stats pseudo └─projection root column cast column └─tablereader root data tablescan └─tablescan cop table range keep order false stats pseudo rows in set sec ,1
11956,14102229077.0,IssuesEvent,2020-11-06 08:24:41,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Different error code from MySQL when inserting incorrect time value,challenge-program picked severity/moderate sig/execution status/help-wanted type/bug type/compatibility,"## Description
## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```mysql
drop table if exists t; create table t(a time); insert into t values(8385966);
```
### 2. What did you expect to see? (Required)
Both MySQL 5.7 and MySQL 8.0 produces error code 1292
```mysql
mysql> drop table if exists t; create table t(a time); insert into t values(8385966);
Query OK, 0 rows affected (0.02 sec)
Query OK, 0 rows affected (0.02 sec)
ERROR 1292 (22007): Incorrect time value: '8385966' for column 'a' at row 1
```
### 3. What did you see instead (Required)
```mysql
mysql> drop table if exists t; create table t(a time); insert into t values(8385966);
Query OK, 0 rows affected (0.01 sec)
Query OK, 0 rows affected (0.01 sec)
ERROR 1366 (HY000): Incorrect time value: '8385966' for column 'a' at row 1
```
### 4. What is your TiDB version? (Required)
master (6a10e2129)
## SIG slack channel
[#sig-exec](https://slack.tidb.io/invite?team=tidb-community&channel=sig-exec&ref=high-performance)
## Score
- 300
## Mentor
* @lzmhhh123
",True,"Different error code from MySQL when inserting incorrect time value - ## Description
## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```mysql
drop table if exists t; create table t(a time); insert into t values(8385966);
```
### 2. What did you expect to see? (Required)
Both MySQL 5.7 and MySQL 8.0 produces error code 1292
```mysql
mysql> drop table if exists t; create table t(a time); insert into t values(8385966);
Query OK, 0 rows affected (0.02 sec)
Query OK, 0 rows affected (0.02 sec)
ERROR 1292 (22007): Incorrect time value: '8385966' for column 'a' at row 1
```
### 3. What did you see instead (Required)
```mysql
mysql> drop table if exists t; create table t(a time); insert into t values(8385966);
Query OK, 0 rows affected (0.01 sec)
Query OK, 0 rows affected (0.01 sec)
ERROR 1366 (HY000): Incorrect time value: '8385966' for column 'a' at row 1
```
### 4. What is your TiDB version? (Required)
master (6a10e2129)
## SIG slack channel
[#sig-exec](https://slack.tidb.io/invite?team=tidb-community&channel=sig-exec&ref=high-performance)
## Score
- 300
## Mentor
* @lzmhhh123
",1,different error code from mysql when inserting incorrect time value description bug report please answer these questions before submitting your issue thanks minimal reproduce step required mysql drop table if exists t create table t a time insert into t values what did you expect to see required both mysql and mysql produces error code mysql mysql drop table if exists t create table t a time insert into t values query ok rows affected sec query ok rows affected sec error incorrect time value for column a at row what did you see instead required mysql mysql drop table if exists t create table t a time insert into t values query ok rows affected sec query ok rows affected sec error incorrect time value for column a at row what is your tidb version required master sig slack channel score mentor ,1
19269,26766613367.0,IssuesEvent,2023-01-31 11:05:57,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Column names incorrect when using a non default delimiter,type/compatibility sig/sql-infra type/feature-request severity/minor compatibility-mysql8 affects-6.4 affects-6.5,"## Bug Report
This is with MySQL Shell 8.0 as client. I would expect that this also happens with MySQL Client.
```
sql> delimiter $$
sql> SELECT 1; SELECT 2; $$
+--------------+
| 1; SELECT 2; |
+--------------+
| 1 |
+--------------+
1 row in set (0.0004 sec)
+----+
| 2; |
+----+
| 2 |
+----+
1 row in set (0.0004 sec)
sql> SELECT 1 AS 'a'; SELECT 2 AS 'b'; $$
+---+
| a |
+---+
| 1 |
+---+
1 row in set (0.0004 sec)
+---+
| b |
+---+
| 2 |
+---+
1 row in set (0.0004 sec)
sql> delimiter ;
sql> SELECT tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v6.4.0
Edition: Community
Git Commit Hash: cf36a9ce2fe1039db3cf3444d51930b887df18a1
Git Branch: heads/refs/tags/v6.4.0
UTC Build Time: 2022-11-13 05:25:30
GoVersion: go1.19.2
Race Enabled: false
TiKV Min Version: 6.2.0-alpha
Check Table Before Drop: false
Store: tikv
1 row in set (0.0003 sec)
```
I expected this to have the same column names as when the default delimiter is used:
```
sql> SELECT 1; SELECT 2;
+---+
| 1 |
+---+
| 1 |
+---+
1 row in set (0.0006 sec)
+---+
| 2 |
+---+
| 2 |
+---+
1 row in set (0.0002 sec)
```",True,"Column names incorrect when using a non default delimiter - ## Bug Report
This is with MySQL Shell 8.0 as client. I would expect that this also happens with MySQL Client.
```
sql> delimiter $$
sql> SELECT 1; SELECT 2; $$
+--------------+
| 1; SELECT 2; |
+--------------+
| 1 |
+--------------+
1 row in set (0.0004 sec)
+----+
| 2; |
+----+
| 2 |
+----+
1 row in set (0.0004 sec)
sql> SELECT 1 AS 'a'; SELECT 2 AS 'b'; $$
+---+
| a |
+---+
| 1 |
+---+
1 row in set (0.0004 sec)
+---+
| b |
+---+
| 2 |
+---+
1 row in set (0.0004 sec)
sql> delimiter ;
sql> SELECT tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v6.4.0
Edition: Community
Git Commit Hash: cf36a9ce2fe1039db3cf3444d51930b887df18a1
Git Branch: heads/refs/tags/v6.4.0
UTC Build Time: 2022-11-13 05:25:30
GoVersion: go1.19.2
Race Enabled: false
TiKV Min Version: 6.2.0-alpha
Check Table Before Drop: false
Store: tikv
1 row in set (0.0003 sec)
```
I expected this to have the same column names as when the default delimiter is used:
```
sql> SELECT 1; SELECT 2;
+---+
| 1 |
+---+
| 1 |
+---+
1 row in set (0.0006 sec)
+---+
| 2 |
+---+
| 2 |
+---+
1 row in set (0.0002 sec)
```",1,column names incorrect when using a non default delimiter bug report this is with mysql shell as client i would expect that this also happens with mysql client sql delimiter sql select select select row in set sec row in set sec sql select as a select as b a row in set sec b row in set sec sql delimiter sql select tidb version g row tidb version release version edition community git commit hash git branch heads refs tags utc build time goversion race enabled false tikv min version alpha check table before drop false store tikv row in set sec i expected this to have the same column names as when the default delimiter is used sql select select row in set sec row in set sec ,1
16386,22096076893.0,IssuesEvent,2022-06-01 10:14:29,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,SHOW TABLE STATUS case sensitivity,help wanted type/compatibility severity/minor,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```
MySQL [test]> show tables;
Empty set (0.00 sec)
MySQL [test]> CREATE TABLE t1 (a int);
Query OK, 0 rows affected (0.12 sec)
MySQL [test]> SELECT * FROM T1;
Empty set (0.11 sec)
MySQL [test]> SHOW TABLE STATUS like 't1';
+------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+-----------------------------------+---------------------+---------------------+-----------------+----------+----------------+---------+
| Name | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time | Update_time | Check_time | Collation | Checksum | Create_options | Comment |
+------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+-----------------------------------+---------------------+---------------------+-----------------+----------+----------------+---------+
| t1 | InnoDB | 10 | Compact | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 2018-08-28 14:31:40.165 +0000 UTC | 2018-08-28 14:32:04 | 2018-08-28 14:32:04 | utf8_general_ci | | | |
+------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+-----------------------------------+---------------------+---------------------+-----------------+----------+----------------+---------+
1 row in set (0.00 sec)
MySQL [test]> SHOW TABLE STATUS like 'T1';
Empty set (0.00 sec)
```
Also:
```
MySQL [test]> SELECT * FROM information_schema.tables where table_schema='test' and table_name='T1'\G
Empty set (0.02 sec)
```
This command is however correct:
```
MySQL [test]> SHOW CREATE TABLE T1;
+-------+------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+------------------------------------------------------------------------------------------------------+
| t1 | CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin |
+-------+------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
(I checked some other commands too: `SHOW INDEXES FROM T1` is also correct leading to some inconsistency.)
2. What did you expect to see?
`SHOW TABLE STATUS` should be case insensitive / behave the same as the select statement, since TiDB behaves according to `lower_case_table_names=2`.
3. What did you see instead?
No result.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
MySQL [test]> SELECT tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v2.1.0-beta-229-g5404e2e
Git Commit Hash: 5404e2eaae27b9ce31264a4eff0a41aa92ffe328
Git Branch: master
UTC Build Time: 2018-08-14 01:46:09
GoVersion: go version go1.10.2 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
1 row in set (0.00 sec)",True,"SHOW TABLE STATUS case sensitivity - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```
MySQL [test]> show tables;
Empty set (0.00 sec)
MySQL [test]> CREATE TABLE t1 (a int);
Query OK, 0 rows affected (0.12 sec)
MySQL [test]> SELECT * FROM T1;
Empty set (0.11 sec)
MySQL [test]> SHOW TABLE STATUS like 't1';
+------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+-----------------------------------+---------------------+---------------------+-----------------+----------+----------------+---------+
| Name | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time | Update_time | Check_time | Collation | Checksum | Create_options | Comment |
+------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+-----------------------------------+---------------------+---------------------+-----------------+----------+----------------+---------+
| t1 | InnoDB | 10 | Compact | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 2018-08-28 14:31:40.165 +0000 UTC | 2018-08-28 14:32:04 | 2018-08-28 14:32:04 | utf8_general_ci | | | |
+------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+-----------------------------------+---------------------+---------------------+-----------------+----------+----------------+---------+
1 row in set (0.00 sec)
MySQL [test]> SHOW TABLE STATUS like 'T1';
Empty set (0.00 sec)
```
Also:
```
MySQL [test]> SELECT * FROM information_schema.tables where table_schema='test' and table_name='T1'\G
Empty set (0.02 sec)
```
This command is however correct:
```
MySQL [test]> SHOW CREATE TABLE T1;
+-------+------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+------------------------------------------------------------------------------------------------------+
| t1 | CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin |
+-------+------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
(I checked some other commands too: `SHOW INDEXES FROM T1` is also correct leading to some inconsistency.)
2. What did you expect to see?
`SHOW TABLE STATUS` should be case insensitive / behave the same as the select statement, since TiDB behaves according to `lower_case_table_names=2`.
3. What did you see instead?
No result.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
MySQL [test]> SELECT tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v2.1.0-beta-229-g5404e2e
Git Commit Hash: 5404e2eaae27b9ce31264a4eff0a41aa92ffe328
Git Branch: master
UTC Build Time: 2018-08-14 01:46:09
GoVersion: go version go1.10.2 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
1 row in set (0.00 sec)",1,show table status case sensitivity please answer these questions before submitting your issue thanks what did you do mysql show tables empty set sec mysql create table a int query ok rows affected sec mysql select from empty set sec mysql show table status like name engine version row format rows avg row length data length max data length index length data free auto increment create time update time check time collation checksum create options comment innodb compact utc general ci row in set sec mysql show table status like empty set sec also mysql select from information schema tables where table schema test and table name g empty set sec this command is however correct mysql show create table table create table create table a int default null engine innodb default charset collate bin row in set sec i checked some other commands too show indexes from is also correct leading to some inconsistency what did you expect to see show table status should be case insensitive behave the same as the select statement since tidb behaves according to lower case table names what did you see instead no result what version of tidb are you using tidb server v or run select tidb version on tidb mysql select tidb version g row tidb version release version beta git commit hash git branch master utc build time goversion go version linux race enabled false tikv min version alpha row in set sec ,1
12222,14432854792.0,IssuesEvent,2020-12-07 03:11:15,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Support implicit primary key,type/compatibility type/duplicate type/enhancement,"## Feature Request
**Is your feature request related to a problem? Please describe:**
In MySQL 8.0, a table with no explicit primary key may still have an effective implicit primary key if it has any UNIQUE indexes on `NOT NULL` columns. In this case, the first such index places the same constraint on table rows as an explicit primary key and that index cannot be made invisible. Consider the following table definition:
```sql
CREATE TABLE t2 (
i INT NOT NULL,
j INT NOT NULL,
UNIQUE j_idx (j)
) ENGINE = InnoDB;
```
The key `j_idx` will became a primary key, even if we do not assign `primary key` explicitly.
**Describe the feature you'd like:**
In MySQL 8.0
```
mysql> show create table t;
+-------+--------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+--------------------------------------------------------------------------------------------------------------------------------------+
| t | CREATE TABLE `t` (
`a` int(11) NOT NULL,
UNIQUE KEY `a` (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci |
+-------+--------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> show keys from t;
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+------------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | Visible | Expression |
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+------------+
| t | 0 | a | 1 | a | A | 0 | NULL | NULL | | BTREE | | | YES | NULL |
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+------------+
1 row in set (0.00 sec)
mysql> desc t;
+-------+---------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------+------+-----+---------+-------+
| a | int(11) | NO | PRI | NULL | |
+-------+---------+------+-----+---------+-------+
1 row in set (0.01 sec)
mysql> alter table t alter index a invisible;
ERROR 3522 (HY000): A primary key index cannot be invisible
```
In TiDB:
```
mysql> create table t (a int not null, unique (a));
Query OK, 0 rows affected (0.11 sec)
mysql> show create table t;
+-------+-------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+-------------------------------------------------------------------------------------------------------------------------------+
| t | CREATE TABLE `t` (
`a` int(11) NOT NULL,
UNIQUE KEY `a` (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin |
+-------+-------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> desc t;
+-------+---------+------+------+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------+------+------+---------+-------+
| a | int(11) | NO | UNI | NULL | |
+-------+---------+------+------+---------+-------+
1 row in set (0.00 sec)
```
**Teachability, Documentation, Adoption, Migration Strategy:**
[MySQL document](https://dev.mysql.com/doc/refman/8.0/en/invisible-indexes.html)",True,"Support implicit primary key - ## Feature Request
**Is your feature request related to a problem? Please describe:**
In MySQL 8.0, a table with no explicit primary key may still have an effective implicit primary key if it has any UNIQUE indexes on `NOT NULL` columns. In this case, the first such index places the same constraint on table rows as an explicit primary key and that index cannot be made invisible. Consider the following table definition:
```sql
CREATE TABLE t2 (
i INT NOT NULL,
j INT NOT NULL,
UNIQUE j_idx (j)
) ENGINE = InnoDB;
```
The key `j_idx` will became a primary key, even if we do not assign `primary key` explicitly.
**Describe the feature you'd like:**
In MySQL 8.0
```
mysql> show create table t;
+-------+--------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+--------------------------------------------------------------------------------------------------------------------------------------+
| t | CREATE TABLE `t` (
`a` int(11) NOT NULL,
UNIQUE KEY `a` (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci |
+-------+--------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> show keys from t;
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+------------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | Visible | Expression |
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+------------+
| t | 0 | a | 1 | a | A | 0 | NULL | NULL | | BTREE | | | YES | NULL |
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+------------+
1 row in set (0.00 sec)
mysql> desc t;
+-------+---------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------+------+-----+---------+-------+
| a | int(11) | NO | PRI | NULL | |
+-------+---------+------+-----+---------+-------+
1 row in set (0.01 sec)
mysql> alter table t alter index a invisible;
ERROR 3522 (HY000): A primary key index cannot be invisible
```
In TiDB:
```
mysql> create table t (a int not null, unique (a));
Query OK, 0 rows affected (0.11 sec)
mysql> show create table t;
+-------+-------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+-------------------------------------------------------------------------------------------------------------------------------+
| t | CREATE TABLE `t` (
`a` int(11) NOT NULL,
UNIQUE KEY `a` (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin |
+-------+-------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> desc t;
+-------+---------+------+------+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------+------+------+---------+-------+
| a | int(11) | NO | UNI | NULL | |
+-------+---------+------+------+---------+-------+
1 row in set (0.00 sec)
```
**Teachability, Documentation, Adoption, Migration Strategy:**
[MySQL document](https://dev.mysql.com/doc/refman/8.0/en/invisible-indexes.html)",1,support implicit primary key feature request is your feature request related to a problem please describe in mysql a table with no explicit primary key may still have an effective implicit primary key if it has any unique indexes on not null columns in this case the first such index places the same constraint on table rows as an explicit primary key and that index cannot be made invisible consider the following table definition sql create table i int not null j int not null unique j idx j engine innodb the key j idx will became a primary key even if we do not assign primary key explicitly describe the feature you d like in mysql mysql show create table t table create table t create table t a int not null unique key a a engine innodb default charset collate unicode ci row in set sec mysql show keys from t table non unique key name seq in index column name collation cardinality sub part packed null index type comment index comment visible expression t a a a null null btree yes null row in set sec mysql desc t field type null key default extra a int no pri null row in set sec mysql alter table t alter index a invisible error a primary key index cannot be invisible in tidb mysql create table t a int not null unique a query ok rows affected sec mysql show create table t table create table t create table t a int not null unique key a a engine innodb default charset collate bin row in set sec mysql desc t field type null key default extra a int no uni null row in set sec teachability documentation adoption migration strategy ,1
16544,22497246529.0,IssuesEvent,2022-06-23 08:40:39,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Bad error message for numeric conversion,type/compatibility severity/moderate component/executor compatibility-mysql8,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```sql
DROP TABLE IF EXISTS t0;
CREATE TABLE t0 (c0 DECIMAL);
INSERT INTO t0 VALUES (1);
SELECT * FROM t0 WHERE t0.c0 > 'a';
SHOW WARNINGS;
```
### 2. What did you expect to see? (Required)
A specific type of error for external applications like MySQL.
```sql
+---------+------+----------------------------------------+
| Level | Code | Message |
+---------+------+----------------------------------------+
| Warning | 1292 | Truncated incorrect DECIMAL value: 'a' |
+---------+------+----------------------------------------+
1 row in set (0.00 sec)
```
### 3. What did you see instead (Required)
```sql
+---------+------+------------+
| Level | Code | Message |
+---------+------+------------+
| Warning | 8029 | Bad Number |
+---------+------+------------+
1 row in set (0.00 sec)
```
### 4. What is your TiDB version? (Required)
```sql
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version()
|
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v5.4.0
Edition: Community
Git Commit Hash: 55f3b24c1c9f506bd652ef1d162283541e428872
Git Branch: heads/refs/tags/v5.4.0
UTC Build Time: 2022-01-25 08:39:26
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
",True,"Bad error message for numeric conversion - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```sql
DROP TABLE IF EXISTS t0;
CREATE TABLE t0 (c0 DECIMAL);
INSERT INTO t0 VALUES (1);
SELECT * FROM t0 WHERE t0.c0 > 'a';
SHOW WARNINGS;
```
### 2. What did you expect to see? (Required)
A specific type of error for external applications like MySQL.
```sql
+---------+------+----------------------------------------+
| Level | Code | Message |
+---------+------+----------------------------------------+
| Warning | 1292 | Truncated incorrect DECIMAL value: 'a' |
+---------+------+----------------------------------------+
1 row in set (0.00 sec)
```
### 3. What did you see instead (Required)
```sql
+---------+------+------------+
| Level | Code | Message |
+---------+------+------------+
| Warning | 8029 | Bad Number |
+---------+------+------------+
1 row in set (0.00 sec)
```
### 4. What is your TiDB version? (Required)
```sql
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version()
|
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v5.4.0
Edition: Community
Git Commit Hash: 55f3b24c1c9f506bd652ef1d162283541e428872
Git Branch: heads/refs/tags/v5.4.0
UTC Build Time: 2022-01-25 08:39:26
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
",1,bad error message for numeric conversion bug report please answer these questions before submitting your issue thanks minimal reproduce step required sql drop table if exists create table decimal insert into values select from where a show warnings what did you expect to see required a specific type of error for external applications like mysql sql level code message warning truncated incorrect decimal value a row in set sec what did you see instead required sql level code message warning bad number row in set sec what is your tidb version required sql tidb version release version edition community git commit hash git branch heads refs tags utc build time goversion race enabled false tikv min version check table before drop false row in set sec ,1
5991,8414371281.0,IssuesEvent,2018-10-13 01:38:48,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,should we display foreign key information in `show create table`,type/compatibility,"## Question
Currently, TiDB only support `foreign key` grammar, not support `foreign key constrain`.
If create table with foreign key, Should we display the foreign key information when `show create table`?
sql:
```sql
create table t1 (a int, index(a));
create table t2 (b int, foreign key (b) references t1(a));
show create table t2;
```
**TiDB** return
```sql
+-------+-------------------------------------------------------+
| Table | Create Table |
+-------+-------------------------------------------------------+
| t2 | CREATE TABLE `t2` ( |
| | `b` int(11) DEFAULT NULL |
| | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin |
+-------+-------------------------------------------------------+
```
**MySQL** return
```sql
+-------+------------------------------------------------------------------+
| Table | Create Table |
+-------+------------------------------------------------------------------+
| t2 | CREATE TABLE `t2` ( |
| | `b` int(11) DEFAULT NULL, |
| | KEY `b` (`b`), |
| | CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`b`) REFERENCES `t1` (`a`) |
| | ) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+-------+------------------------------------------------------------------+
```",True,"should we display foreign key information in `show create table` - ## Question
Currently, TiDB only support `foreign key` grammar, not support `foreign key constrain`.
If create table with foreign key, Should we display the foreign key information when `show create table`?
sql:
```sql
create table t1 (a int, index(a));
create table t2 (b int, foreign key (b) references t1(a));
show create table t2;
```
**TiDB** return
```sql
+-------+-------------------------------------------------------+
| Table | Create Table |
+-------+-------------------------------------------------------+
| t2 | CREATE TABLE `t2` ( |
| | `b` int(11) DEFAULT NULL |
| | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin |
+-------+-------------------------------------------------------+
```
**MySQL** return
```sql
+-------+------------------------------------------------------------------+
| Table | Create Table |
+-------+------------------------------------------------------------------+
| t2 | CREATE TABLE `t2` ( |
| | `b` int(11) DEFAULT NULL, |
| | KEY `b` (`b`), |
| | CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`b`) REFERENCES `t1` (`a`) |
| | ) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+-------+------------------------------------------------------------------+
```",1,should we display foreign key information in show create table question currently tidb only support foreign key grammar not support foreign key constrain if create table with foreign key should we display the foreign key information when show create table sql sql create table a int index a create table b int foreign key b references a show create table tidb return sql table create table create table b int default null engine innodb default charset collate bin mysql return sql table create table create table b int default null key b b constraint ibfk foreign key b references a engine innodb default charset ,1
6088,8516784246.0,IssuesEvent,2018-11-01 04:49:23,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,Make `max_prepared_stmt_count` work,for new contributors help wanted type/compatibility,"## Feature Request
**Is your feature request related to a problem? Please describe:**
`max_prepared_stmt_count` is a variable ported from mysql.
It controls that how many PREPARE statement tidb can store at one time. It can be used in environments where there is the potential for denial-of-service attacks based on running the server out of memory by preparing huge numbers of statements.
It can disable the prepare statement if we set it to zero.
Currently we have ported it. But not actually make it work.
**Teachability, Documentation, Adoption, Migration Strategy:**
https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_max_prepared_stmt_count",True,"Make `max_prepared_stmt_count` work - ## Feature Request
**Is your feature request related to a problem? Please describe:**
`max_prepared_stmt_count` is a variable ported from mysql.
It controls that how many PREPARE statement tidb can store at one time. It can be used in environments where there is the potential for denial-of-service attacks based on running the server out of memory by preparing huge numbers of statements.
It can disable the prepare statement if we set it to zero.
Currently we have ported it. But not actually make it work.
**Teachability, Documentation, Adoption, Migration Strategy:**
https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_max_prepared_stmt_count",1,make max prepared stmt count work feature request is your feature request related to a problem please describe max prepared stmt count is a variable ported from mysql it controls that how many prepare statement tidb can store at one time it can be used in environments where there is the potential for denial of service attacks based on running the server out of memory by preparing huge numbers of statements it can disable the prepare statement if we set it to zero currently we have ported it but not actually make it work teachability documentation adoption migration strategy ,1
6993,9285409420.0,IssuesEvent,2019-03-21 07:00:31,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,`str_to_date` is not compatible with MySQL,for new contributors help wanted type/bug type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
create table t1 (date char(30), format char(30) not null);
insert into t1 values
('2003-01-02 10:11:12 PM', '%Y-%m-%d %H:%i:%S %p'),
('10:20:10AM', '%H:%i:%s%p');
select date,format,str_to_date(date, format) as str_to_date from t1;
```
2. What did you expect to see?
In Mysql
```
mysql> create table t1 (date char(30), format char(30) not null);
Query OK, 0 rows affected (0.02 sec)
mysql> insert into t1 values
-> ('2003-01-02 10:11:12 PM', '%Y-%m-%d %H:%i:%S %p'),
-> ('10:20:10AM', '%H:%i:%s%p');
Query OK, 2 rows affected (0.00 sec)
Records: 2 Duplicates: 0 Warnings: 0
mysql> select date,format,str_to_date(date, format) as str_to_date from t1;
+------------------------+----------------------+-------------+
| date | format | str_to_date |
+------------------------+----------------------+-------------+
| 2003-01-02 10:11:12 PM | %Y-%m-%d %H:%i:%S %p | NULL |
| 10:20:10AM | %H:%i:%s%p | NULL |
+------------------------+----------------------+-------------+
2 rows in set, 4 warnings (0.00 sec)
```
3. What did you see instead?
In TiDB
```
mysql> create table t1 (date char(30), format char(30) not null);
Query OK, 0 rows affected (0.01 sec)
mysql> insert into t1 values
-> ('2003-01-02 10:11:12 PM', '%Y-%m-%d %H:%i:%S %p'),
-> ('10:20:10AM', '%H:%i:%s%p');
Query OK, 2 rows affected (0.01 sec)
Records: 2 Duplicates: 0 Warnings: 0
mysql> select date,format,str_to_date(date, format) as str_to_date from t1;
+------------------------+----------------------+----------------------------+
| date | format | str_to_date |
+------------------------+----------------------+----------------------------+
| 2003-01-02 10:11:12 PM | %Y-%m-%d %H:%i:%S %p | 2003-01-02 22:11:12.000000 |
| 10:20:10AM | %H:%i:%s%p | 0000-00-00 10:20:10.000000 |
+------------------------+----------------------+----------------------------+
2 rows in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v3.0.0-beta-227-g06183393e-dirty
Git Commit Hash: 06183393ed536aa248248b72d4bf9f5010947f66
Git Branch: master
UTC Build Time: 2019-03-15 08:22:53
GoVersion: go version go1.12 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
```
",True,"`str_to_date` is not compatible with MySQL - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
create table t1 (date char(30), format char(30) not null);
insert into t1 values
('2003-01-02 10:11:12 PM', '%Y-%m-%d %H:%i:%S %p'),
('10:20:10AM', '%H:%i:%s%p');
select date,format,str_to_date(date, format) as str_to_date from t1;
```
2. What did you expect to see?
In Mysql
```
mysql> create table t1 (date char(30), format char(30) not null);
Query OK, 0 rows affected (0.02 sec)
mysql> insert into t1 values
-> ('2003-01-02 10:11:12 PM', '%Y-%m-%d %H:%i:%S %p'),
-> ('10:20:10AM', '%H:%i:%s%p');
Query OK, 2 rows affected (0.00 sec)
Records: 2 Duplicates: 0 Warnings: 0
mysql> select date,format,str_to_date(date, format) as str_to_date from t1;
+------------------------+----------------------+-------------+
| date | format | str_to_date |
+------------------------+----------------------+-------------+
| 2003-01-02 10:11:12 PM | %Y-%m-%d %H:%i:%S %p | NULL |
| 10:20:10AM | %H:%i:%s%p | NULL |
+------------------------+----------------------+-------------+
2 rows in set, 4 warnings (0.00 sec)
```
3. What did you see instead?
In TiDB
```
mysql> create table t1 (date char(30), format char(30) not null);
Query OK, 0 rows affected (0.01 sec)
mysql> insert into t1 values
-> ('2003-01-02 10:11:12 PM', '%Y-%m-%d %H:%i:%S %p'),
-> ('10:20:10AM', '%H:%i:%s%p');
Query OK, 2 rows affected (0.01 sec)
Records: 2 Duplicates: 0 Warnings: 0
mysql> select date,format,str_to_date(date, format) as str_to_date from t1;
+------------------------+----------------------+----------------------------+
| date | format | str_to_date |
+------------------------+----------------------+----------------------------+
| 2003-01-02 10:11:12 PM | %Y-%m-%d %H:%i:%S %p | 2003-01-02 22:11:12.000000 |
| 10:20:10AM | %H:%i:%s%p | 0000-00-00 10:20:10.000000 |
+------------------------+----------------------+----------------------------+
2 rows in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v3.0.0-beta-227-g06183393e-dirty
Git Commit Hash: 06183393ed536aa248248b72d4bf9f5010947f66
Git Branch: master
UTC Build Time: 2019-03-15 08:22:53
GoVersion: go version go1.12 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
```
",1, str to date is not compatible with mysql bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error create table date char format char not null insert into values pm y m d h i s p h i s p select date format str to date date format as str to date from what did you expect to see in mysql mysql create table date char format char not null query ok rows affected sec mysql insert into values pm y m d h i s p h i s p query ok rows affected sec records duplicates warnings mysql select date format str to date date format as str to date from date format str to date pm y m d h i s p null h i s p null rows in set warnings sec what did you see instead in tidb mysql create table date char format char not null query ok rows affected sec mysql insert into values pm y m d h i s p h i s p query ok rows affected sec records duplicates warnings mysql select date format str to date date format as str to date from date format str to date pm y m d h i s p h i s p rows in set sec what version of tidb are you using tidb server v or run select tidb version on tidb tidb version release version beta dirty git commit hash git branch master utc build time goversion go version darwin race enabled false tikv min version alpha check table before drop false ,1
181278,14013224669.0,IssuesEvent,2020-10-29 10:07:51,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,db_test.go:testDBSuite5.TestAlterPrimaryKey failed,component/test sig/DDL,"db_test.go:testDBSuite5.TestAlterPrimaryKey
```
[2020-08-27T12:01:57.189Z] ----------------------------------------------------------------------
[2020-08-27T12:01:57.189Z] FAIL: db_test.go:1698: testDBSuite5.TestAlterPrimaryKey
[2020-08-27T12:01:57.189Z]
[2020-08-27T12:01:57.189Z] db_test.go:1784:
[2020-08-27T12:01:57.189Z] tk.MustGetErrCode(""alter table test_add_pk add primary key (b)"", errno.ErrInvalidUseOfNull)
[2020-08-27T12:01:57.189Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/util/testkit/testkit.go:295:
[2020-08-27T12:01:57.189Z] tk.c.Assert(err, check.NotNil)
[2020-08-27T12:01:57.189Z] ... value = nil
[2020-08-27T12:01:57.189Z]
```
Latest failed builds:
https://internal.pingcap.net/idc-jenkins/job/tidb_ghpr_unit_test/48208/display/redirect
",1.0,"db_test.go:testDBSuite5.TestAlterPrimaryKey failed - db_test.go:testDBSuite5.TestAlterPrimaryKey
```
[2020-08-27T12:01:57.189Z] ----------------------------------------------------------------------
[2020-08-27T12:01:57.189Z] FAIL: db_test.go:1698: testDBSuite5.TestAlterPrimaryKey
[2020-08-27T12:01:57.189Z]
[2020-08-27T12:01:57.189Z] db_test.go:1784:
[2020-08-27T12:01:57.189Z] tk.MustGetErrCode(""alter table test_add_pk add primary key (b)"", errno.ErrInvalidUseOfNull)
[2020-08-27T12:01:57.189Z] /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/util/testkit/testkit.go:295:
[2020-08-27T12:01:57.189Z] tk.c.Assert(err, check.NotNil)
[2020-08-27T12:01:57.189Z] ... value = nil
[2020-08-27T12:01:57.189Z]
```
Latest failed builds:
https://internal.pingcap.net/idc-jenkins/job/tidb_ghpr_unit_test/48208/display/redirect
",0,db test go testalterprimarykey failed db test go testalterprimarykey fail db test go testalterprimarykey db test go tk mustgeterrcode alter table test add pk add primary key b errno errinvaliduseofnull home jenkins agent workspace tidb ghpr unit test go src github com pingcap tidb util testkit testkit go tk c assert err check notnil value nil latest failed builds ,0
12261,14493931993.0,IssuesEvent,2020-12-11 09:10:56,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,"The ""varchar"" type column flags are not compatible with MySQL",severity/moderate sig/DDL status/won't-fix type/bug type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
CREATE TABLE t (
-> c varchar(120) DEFAULT NULL
-> ) CHARSET=utf8 COLLATE=utf8_bin;
select c from t;
```
2. What did you expect to see?
3. What did you see instead?
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
Release Version: v2.1.18-32-g8ddd007c7-dirty
Git Commit Hash: 8ddd007c7b3aafbd571bf43d5b7fe4ad7fb9704c
Git Branch: heads/zimuxia/drop-col
",True,"The ""varchar"" type column flags are not compatible with MySQL - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
CREATE TABLE t (
-> c varchar(120) DEFAULT NULL
-> ) CHARSET=utf8 COLLATE=utf8_bin;
select c from t;
```
2. What did you expect to see?
3. What did you see instead?
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
Release Version: v2.1.18-32-g8ddd007c7-dirty
Git Commit Hash: 8ddd007c7b3aafbd571bf43d5b7fe4ad7fb9704c
Git Branch: heads/zimuxia/drop-col
",1,the varchar type column flags are not compatible with mysql bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error create table t c varchar default null charset collate bin select c from t what did you expect to see img width alt screen shot at src what did you see instead img width alt screen shot at src what version of tidb are you using tidb server v or run select tidb version on tidb release version dirty git commit hash git branch heads zimuxia drop col ,1
4418,7098535478.0,IssuesEvent,2018-01-15 05:59:07,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,multi-update bug when alias one table to multi names,bug compatibility,"```sql
create table b (x int, y int);
insert into b values(1,2), (3,4), (5,6);
update b as m, b as n set m.x = m.x + 10;
select * from b;
```
on MySQL we'll get:
```
+------+------+
| x | y |
+------+------+
| 11 | 2 |
| 13 | 4 |
| 15 | 6 |
+------+------+
```
but on TiDB, we'll get:
```
+------+------+
| x | y |
+------+------+
| 11 | 2 |
| 3 | 4 |
| 5 | 6 |
+------+------+
```",True,"multi-update bug when alias one table to multi names - ```sql
create table b (x int, y int);
insert into b values(1,2), (3,4), (5,6);
update b as m, b as n set m.x = m.x + 10;
select * from b;
```
on MySQL we'll get:
```
+------+------+
| x | y |
+------+------+
| 11 | 2 |
| 13 | 4 |
| 15 | 6 |
+------+------+
```
but on TiDB, we'll get:
```
+------+------+
| x | y |
+------+------+
| 11 | 2 |
| 3 | 4 |
| 5 | 6 |
+------+------+
```",1,multi update bug when alias one table to multi names sql create table b x int y int insert into b values update b as m b as n set m x m x select from b on mysql we ll get x y but on tidb we ll get x y ,1
13231,15595726260.0,IssuesEvent,2021-03-18 15:09:49,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,ddl: changing a column from nullable to `NOT NULL` is not 'SQL_MODE'-aware.,type/bug type/compatibility,"## Bug Report
### 1. Minimal reproduce step (Required)
Reproduce scripts:
```
set @@sql_mode='';
create table t(a int, b varchar(20));
insert into t values (1, NULL), (2, 'A');
alter table t modify column b varchar(20) not null;
```
### 2. What did you expect to see? (Required)
In MySQL:
```
alter table t modify column b varchar(20) not null;
Query OK, 2 rows affected, 1 warning (0.07 sec)
Records: 2 Duplicates: 0 Warnings:
```
### 3. What did you see instead (Required)
TiDB:
```
alter table t modify column b varchar(20) not null;
ERROR 1138 (22004): Invalid use of NULL value
```
### 4. What is your TiDB version? (Required)
v5.0.0-rc, but I believe it happens for all existing versions.",True,"ddl: changing a column from nullable to `NOT NULL` is not 'SQL_MODE'-aware. - ## Bug Report
### 1. Minimal reproduce step (Required)
Reproduce scripts:
```
set @@sql_mode='';
create table t(a int, b varchar(20));
insert into t values (1, NULL), (2, 'A');
alter table t modify column b varchar(20) not null;
```
### 2. What did you expect to see? (Required)
In MySQL:
```
alter table t modify column b varchar(20) not null;
Query OK, 2 rows affected, 1 warning (0.07 sec)
Records: 2 Duplicates: 0 Warnings:
```
### 3. What did you see instead (Required)
TiDB:
```
alter table t modify column b varchar(20) not null;
ERROR 1138 (22004): Invalid use of NULL value
```
### 4. What is your TiDB version? (Required)
v5.0.0-rc, but I believe it happens for all existing versions.",1,ddl changing a column from nullable to not null is not sql mode aware bug report minimal reproduce step required reproduce scripts set sql mode create table t a int b varchar insert into t values null a alter table t modify column b varchar not null what did you expect to see required in mysql alter table t modify column b varchar not null query ok rows affected warning sec records duplicates warnings what did you see instead required tidb alter table t modify column b varchar not null error invalid use of null value what is your tidb version required rc but i believe it happens for all existing versions ,1
9571,11628201109.0,IssuesEvent,2020-02-27 17:52:22,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,builtin function WEIGHT_STRING() not support,help-wanted type/compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
use mysql builtin function WEIGHT_STRING(), but it is not supported by TiDB yet.
2. What did you expect to see?
```
mysql> SELECT HEX(WEIGHT_STRING('ab' AS CHAR(4)));
+-------------------------------------+
| HEX(WEIGHT_STRING('ab' AS CHAR(4))) |
+-------------------------------------+
| 0041004200200020 |
+-------------------------------------+
1 row in set (0.03 sec)
```
3. What did you see instead?
```
mysql> SELECT HEX(WEIGHT_STRING('ab' AS CHAR(4)));
ERROR 1105 (HY000): line 0 column 25 near ""'ab' AS CHAR(4)))"" (total length 42)
```
4. What version of TiDB are you using (`tidb-server -V`)?
```
[wink@localhost tidb]$ bin/tidb-server -V
Git Commit Hash: 677fd05c82517e20c60345202e8dc612b1942615
UTC Build Time: 2017-06-29 08:03:08
```
",True,"builtin function WEIGHT_STRING() not support - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
use mysql builtin function WEIGHT_STRING(), but it is not supported by TiDB yet.
2. What did you expect to see?
```
mysql> SELECT HEX(WEIGHT_STRING('ab' AS CHAR(4)));
+-------------------------------------+
| HEX(WEIGHT_STRING('ab' AS CHAR(4))) |
+-------------------------------------+
| 0041004200200020 |
+-------------------------------------+
1 row in set (0.03 sec)
```
3. What did you see instead?
```
mysql> SELECT HEX(WEIGHT_STRING('ab' AS CHAR(4)));
ERROR 1105 (HY000): line 0 column 25 near ""'ab' AS CHAR(4)))"" (total length 42)
```
4. What version of TiDB are you using (`tidb-server -V`)?
```
[wink@localhost tidb]$ bin/tidb-server -V
Git Commit Hash: 677fd05c82517e20c60345202e8dc612b1942615
UTC Build Time: 2017-06-29 08:03:08
```
",1,builtin function weight string not support please answer these questions before submitting your issue thanks what did you do use mysql builtin function weight string but it is not supported by tidb yet what did you expect to see mysql select hex weight string ab as char hex weight string ab as char row in set sec what did you see instead mysql select hex weight string ab as char error line column near ab as char total length what version of tidb are you using tidb server v bin tidb server v git commit hash utc build time ,1
5650,8126964451.0,IssuesEvent,2018-08-17 05:52:29,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,create user identified WITH mysql_native_password not work,type/compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
public void testBug19354014() throws Exception {
if (versionMeetsMinimum(5, 5, 7)) {
Connection con = null;
createUser(""'bug19354014user'@'%'"", ""identified WITH mysql_native_password"");
this.stmt.executeUpdate(""grant all on *.* to 'bug19354014user'@'%'"");
this.stmt.executeUpdate(versionMeetsMinimum(5, 7, 6) ? ""ALTER USER 'bug19354014user'@'%' IDENTIFIED BY 'pwd'""
: ""set password for 'bug19354014user'@'%' = PASSWORD('pwd')"");
this.stmt.executeUpdate(""flush privileges"");
try {
Properties props = new Properties();
props.setProperty(""useCompression"", ""true"");
con = getConnectionWithProps(props);
((MySQLConnection) con).changeUser(""bug19354014user"", ""pwd"");
} finally {
this.stmt.executeUpdate(""flush privileges"");
if (con != null) {
con.close();
}
}
}
}
```
2. What did you expect to see?
It should be OK.
3. What did you see instead?
`createUser(""'bug19354014user'@'%'"", ""identified WITH mysql_native_password"");` return an syntax error. ""java.sql.SQLException: line 1 column 50 near "" mysql_native_password"" (total length 72)""
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
ae2e3ac0a7f28453a758b18f1cb87e34f77a5890
",True,"create user identified WITH mysql_native_password not work - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
public void testBug19354014() throws Exception {
if (versionMeetsMinimum(5, 5, 7)) {
Connection con = null;
createUser(""'bug19354014user'@'%'"", ""identified WITH mysql_native_password"");
this.stmt.executeUpdate(""grant all on *.* to 'bug19354014user'@'%'"");
this.stmt.executeUpdate(versionMeetsMinimum(5, 7, 6) ? ""ALTER USER 'bug19354014user'@'%' IDENTIFIED BY 'pwd'""
: ""set password for 'bug19354014user'@'%' = PASSWORD('pwd')"");
this.stmt.executeUpdate(""flush privileges"");
try {
Properties props = new Properties();
props.setProperty(""useCompression"", ""true"");
con = getConnectionWithProps(props);
((MySQLConnection) con).changeUser(""bug19354014user"", ""pwd"");
} finally {
this.stmt.executeUpdate(""flush privileges"");
if (con != null) {
con.close();
}
}
}
}
```
2. What did you expect to see?
It should be OK.
3. What did you see instead?
`createUser(""'bug19354014user'@'%'"", ""identified WITH mysql_native_password"");` return an syntax error. ""java.sql.SQLException: line 1 column 50 near "" mysql_native_password"" (total length 72)""
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
ae2e3ac0a7f28453a758b18f1cb87e34f77a5890
",1,create user identified with mysql native password not work please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error public void throws exception if versionmeetsminimum connection con null createuser identified with mysql native password this stmt executeupdate grant all on to this stmt executeupdate versionmeetsminimum alter user identified by pwd set password for password pwd this stmt executeupdate flush privileges try properties props new properties props setproperty usecompression true con getconnectionwithprops props mysqlconnection con changeuser pwd finally this stmt executeupdate flush privileges if con null con close what did you expect to see it should be ok what did you see instead createuser identified with mysql native password return an syntax error java sql sqlexception line column near mysql native password total length what version of tidb are you using tidb server v or run select tidb version on tidb ,1
19548,27140998374.0,IssuesEvent,2023-02-16 16:20:06,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Wrong error message for unknown column in INSERT...SET,type/bug type/compatibility sig/sql-infra severity/minor compatibility-mysql8,"## Bug Report
### 1. Minimal reproduce step (Required)
```sql
CREATE TABLE t1(id INT PRIMARY KEY);
INSERT INTO t1 SET c2=123;
```
### 2. What did you expect to see? (Required)
MySQL 8.0.32 returns this:
```
sql> CREATE TABLE t1(id INT PRIMARY KEY);
Query OK, 0 rows affected (0.0527 sec)
sql> INSERT INTO t1 SET c2=123;
ERROR: 1054 (42S22): Unknown column 'c2' in 'field list'
```
### 3. What did you see instead (Required)
TiDB returns
```
sql> CREATE TABLE t1(id INT PRIMARY KEY);
Query OK, 0 rows affected (0.0111 sec)
sql> INSERT INTO t1 SET c2=123;
ERROR: 1105 (HY000): Can't find column c2
```
### 4. What is your TiDB version? (Required)
```
sql> SELECT tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v6.7.0-alpha-23-g08f57c7ea-dirty
Edition: Community
Git Commit Hash: 08f57c7ead9fb6c45e00b670feb2b1a738676b38
Git Branch: load_data_colname_mismatch
UTC Build Time: 2023-02-15 19:47:12
GoVersion: go1.19.5
Race Enabled: false
TiKV Min Version: 6.2.0-alpha
Check Table Before Drop: false
Store: unistore
1 row in set (0.0005 sec)
```",True,"Wrong error message for unknown column in INSERT...SET - ## Bug Report
### 1. Minimal reproduce step (Required)
```sql
CREATE TABLE t1(id INT PRIMARY KEY);
INSERT INTO t1 SET c2=123;
```
### 2. What did you expect to see? (Required)
MySQL 8.0.32 returns this:
```
sql> CREATE TABLE t1(id INT PRIMARY KEY);
Query OK, 0 rows affected (0.0527 sec)
sql> INSERT INTO t1 SET c2=123;
ERROR: 1054 (42S22): Unknown column 'c2' in 'field list'
```
### 3. What did you see instead (Required)
TiDB returns
```
sql> CREATE TABLE t1(id INT PRIMARY KEY);
Query OK, 0 rows affected (0.0111 sec)
sql> INSERT INTO t1 SET c2=123;
ERROR: 1105 (HY000): Can't find column c2
```
### 4. What is your TiDB version? (Required)
```
sql> SELECT tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v6.7.0-alpha-23-g08f57c7ea-dirty
Edition: Community
Git Commit Hash: 08f57c7ead9fb6c45e00b670feb2b1a738676b38
Git Branch: load_data_colname_mismatch
UTC Build Time: 2023-02-15 19:47:12
GoVersion: go1.19.5
Race Enabled: false
TiKV Min Version: 6.2.0-alpha
Check Table Before Drop: false
Store: unistore
1 row in set (0.0005 sec)
```",1,wrong error message for unknown column in insert set bug report minimal reproduce step required sql create table id int primary key insert into set what did you expect to see required mysql returns this sql create table id int primary key query ok rows affected sec sql insert into set error unknown column in field list what did you see instead required tidb returns sql create table id int primary key query ok rows affected sec sql insert into set error can t find column what is your tidb version required sql select tidb version g row tidb version release version alpha dirty edition community git commit hash git branch load data colname mismatch utc build time goversion race enabled false tikv min version alpha check table before drop false store unistore row in set sec ,1
3132,6060763639.0,IssuesEvent,2017-06-14 03:18:49,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,different result when query `select cast(-1 as unsigned)`,compatibility,"1. What did you do?
``` sql
select cast(-1 as unsigned);
```
2. What did you expect to see?
```sql
mysql> select cast(-1 as unsigned);
+----------------------+
| cast(-1 as unsigned) |
+----------------------+
| 18446744073709551615 |
+----------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
``` sql
mysql> select cast(-1 as unsigned);
ERROR 1690 (22003): constant -1 overflows bigint
```
4. What version of TiDB are you using (`tidb-server -V`)?
>Git Commit Hash: 7a9f4a61e68c8cddeb3967a83e9a8e170700a9a9
UTC Build Time: 2017-06-08 02:35:04
",True,"different result when query `select cast(-1 as unsigned)` - 1. What did you do?
``` sql
select cast(-1 as unsigned);
```
2. What did you expect to see?
```sql
mysql> select cast(-1 as unsigned);
+----------------------+
| cast(-1 as unsigned) |
+----------------------+
| 18446744073709551615 |
+----------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
``` sql
mysql> select cast(-1 as unsigned);
ERROR 1690 (22003): constant -1 overflows bigint
```
4. What version of TiDB are you using (`tidb-server -V`)?
>Git Commit Hash: 7a9f4a61e68c8cddeb3967a83e9a8e170700a9a9
UTC Build Time: 2017-06-08 02:35:04
",1,different result when query select cast as unsigned what did you do sql select cast as unsigned what did you expect to see sql mysql select cast as unsigned cast as unsigned row in set sec what did you see instead sql mysql select cast as unsigned error constant overflows bigint what version of tidb are you using tidb server v git commit hash utc build time ,1
4026,6876605905.0,IssuesEvent,2017-11-20 02:05:49,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,grant privilege identified by password should be hash string,compatibility help wanted,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
In MySQL, it's invalid:
```
mysql> grant select on *.* to 'genius'@'%' identified by password '0101001';
ERROR 1827 (HY000): The password hash doesn't have the expected format. Check if the correct password algorithm is being used with the PASSWORD() function.
```
2. What did you expect to see?
According to [mysql document](https://dev.mysql.com/doc/refman/5.7/en/grant.html#grant-accounts-passwords), grant privilege identified by password should be hash string.
3. What did you see instead?
TiDB accept the input `grant select on *.* to 'genius'@'%' identified by password '0101001';`
4. What version of TiDB are you using (`tidb-server -V`)?
",True,"grant privilege identified by password should be hash string - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
In MySQL, it's invalid:
```
mysql> grant select on *.* to 'genius'@'%' identified by password '0101001';
ERROR 1827 (HY000): The password hash doesn't have the expected format. Check if the correct password algorithm is being used with the PASSWORD() function.
```
2. What did you expect to see?
According to [mysql document](https://dev.mysql.com/doc/refman/5.7/en/grant.html#grant-accounts-passwords), grant privilege identified by password should be hash string.
3. What did you see instead?
TiDB accept the input `grant select on *.* to 'genius'@'%' identified by password '0101001';`
4. What version of TiDB are you using (`tidb-server -V`)?
",1,grant privilege identified by password should be hash string please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error in mysql it s invalid mysql grant select on to genius identified by password error the password hash doesn t have the expected format check if the correct password algorithm is being used with the password function what did you expect to see according to grant privilege identified by password should be hash string what did you see instead tidb accept the input grant select on to genius identified by password what version of tidb are you using tidb server v ,1
16349,22037681061.0,IssuesEvent,2022-05-28 21:22:50,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,no warning info for config deleted and change to system variable,type/bug type/compatibility component/config sig/sql-infra severity/moderate may-affects-4.0 may-affects-5.1 may-affects-5.2 may-affects-5.3 may-affects-5.4 may-affects-5.0 may-affects-6.0 affects-6.1,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
1. install v6.0.0 include following config:
server_configs:
tidb:
enable-batch-dml: true
experimental.enable-global-kill: false
log.query-log-max-len: 4000
mem-quota-query: 0
oom-action: log
performance.committer-concurrency: 120
performance.run-auto-analyze: true
performance.txn-entry-size-limit: 6000000
performance.txn-total-size-limit: 6000000
prepared-plan-cache.capacity: 2000
prepared-plan-cache.enabled: true
security.require-secure-transport: false
2. upgrade to v6.1.0 nightly
### 2. What did you expect to see? (Required)
according to the discussion with PM, when the old cluster includes the above configs, during upgrade, the tidb node should report
a warning to tell the user that these configs have been deleted and converted to system variables.
### 3. What did you see instead (Required)
no waring found
+ [ Serial ] - InitConfig: cluster=local, user=tidb, host=172.16.5.101, path=/home/tidb/.tiup/storage/cluster/clusters/local/config-cache/tidb-4000.service, deploy_dir=/home/tidb/deploy/tidb-4000, data_dir=[], log_dir=/home/tidb/deploy/tidb-4000/log, cache_dir=/home/tidb/.tiup/storage/cluster/clusters/local/config-cache
+ [ Serial ] - InitConfig: cluster=local, user=tidb, host=172.16.5.101, path=/home/tidb/.tiup/storage/cluster/clusters/local/config-cache/tidb-14000.service, deploy_dir=/home/tidb/deploy/tidb-14000, data_dir=[], log_dir=/home/tidb/deploy/tidb-14000/log, cache_dir=/home/tidb/.tiup/storage/cluster/clusters/local/config-cache
### 4. What is your TiDB version? (Required)
Git Commit Hash: 388b3c79cc3a313aee59334ebe6fc7dc451769c3
Git Branch: heads/refs/tags/v6.1.0-alpha
UTC Build Time: 2022-05-22 15:03:09
",True,"no warning info for config deleted and change to system variable - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
1. install v6.0.0 include following config:
server_configs:
tidb:
enable-batch-dml: true
experimental.enable-global-kill: false
log.query-log-max-len: 4000
mem-quota-query: 0
oom-action: log
performance.committer-concurrency: 120
performance.run-auto-analyze: true
performance.txn-entry-size-limit: 6000000
performance.txn-total-size-limit: 6000000
prepared-plan-cache.capacity: 2000
prepared-plan-cache.enabled: true
security.require-secure-transport: false
2. upgrade to v6.1.0 nightly
### 2. What did you expect to see? (Required)
according to the discussion with PM, when the old cluster includes the above configs, during upgrade, the tidb node should report
a warning to tell the user that these configs have been deleted and converted to system variables.
### 3. What did you see instead (Required)
no waring found
+ [ Serial ] - InitConfig: cluster=local, user=tidb, host=172.16.5.101, path=/home/tidb/.tiup/storage/cluster/clusters/local/config-cache/tidb-4000.service, deploy_dir=/home/tidb/deploy/tidb-4000, data_dir=[], log_dir=/home/tidb/deploy/tidb-4000/log, cache_dir=/home/tidb/.tiup/storage/cluster/clusters/local/config-cache
+ [ Serial ] - InitConfig: cluster=local, user=tidb, host=172.16.5.101, path=/home/tidb/.tiup/storage/cluster/clusters/local/config-cache/tidb-14000.service, deploy_dir=/home/tidb/deploy/tidb-14000, data_dir=[], log_dir=/home/tidb/deploy/tidb-14000/log, cache_dir=/home/tidb/.tiup/storage/cluster/clusters/local/config-cache
### 4. What is your TiDB version? (Required)
Git Commit Hash: 388b3c79cc3a313aee59334ebe6fc7dc451769c3
Git Branch: heads/refs/tags/v6.1.0-alpha
UTC Build Time: 2022-05-22 15:03:09
",1,no warning info for config deleted and change to system variable bug report please answer these questions before submitting your issue thanks minimal reproduce step required install include following config server configs tidb enable batch dml true experimental enable global kill false log query log max len mem quota query oom action log performance committer concurrency performance run auto analyze true performance txn entry size limit performance txn total size limit prepared plan cache capacity prepared plan cache enabled true security require secure transport false upgrade to nightly what did you expect to see required according to the discussion with pm when the old cluster includes the above configs during upgrade the tidb node should report a warning to tell the user that these configs have been deleted and converted to system variables what did you see instead required no waring found initconfig cluster local user tidb host path home tidb tiup storage cluster clusters local config cache tidb service deploy dir home tidb deploy tidb data dir log dir home tidb deploy tidb log cache dir home tidb tiup storage cluster clusters local config cache initconfig cluster local user tidb host path home tidb tiup storage cluster clusters local config cache tidb service deploy dir home tidb deploy tidb data dir log dir home tidb deploy tidb log cache dir home tidb tiup storage cluster clusters local config cache what is your tidb version required git commit hash git branch heads refs tags alpha utc build time ,1
3609,6515919813.0,IssuesEvent,2017-08-26 22:45:05,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,auto_increment is missing from `show create table`,compatibility help wanted,"`AUTO_INCREMENT=X` is missing from `show create table`.
MySQL:
```
mysql> create table t2(a int key auto_increment, b int, c int);
Query OK, 0 rows affected (0.02 sec)
mysql> insert into t2 values (0, 1, 1);
Query OK, 1 row affected (0.01 sec)
mysql> insert into t2 values (0, 1, 1);
Query OK, 1 row affected (0.01 sec)
mysql> insert into t2 values (0, 1, 1);
Query OK, 1 row affected (0.00 sec)
mysql> show create table t2;
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| t2 | CREATE TABLE `t2` (
`a` int(11) NOT NULL AUTO_INCREMENT,
`b` int(11) DEFAULT NULL,
`c` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 |
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
TiDB:
```
mysql> create table t2(a int key auto_increment, b int, c int);
Query OK, 0 rows affected (0.01 sec)
mysql> insert into t2 values (0, 1, 1);
Query OK, 1 row affected (0.00 sec)
mysql> insert into t2 values (0, 1, 1);
Query OK, 1 row affected (0.01 sec)
mysql> insert into t2 values (0, 1, 1);
Query OK, 1 row affected (0.00 sec)
mysql> show create table t2;
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| t2 | CREATE TABLE `t2` (
`a` int(11) NOT NULL AUTO_INCREMENT,
`b` int(11) DEFAULT NULL,
`c` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin |
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```",True,"auto_increment is missing from `show create table` - `AUTO_INCREMENT=X` is missing from `show create table`.
MySQL:
```
mysql> create table t2(a int key auto_increment, b int, c int);
Query OK, 0 rows affected (0.02 sec)
mysql> insert into t2 values (0, 1, 1);
Query OK, 1 row affected (0.01 sec)
mysql> insert into t2 values (0, 1, 1);
Query OK, 1 row affected (0.01 sec)
mysql> insert into t2 values (0, 1, 1);
Query OK, 1 row affected (0.00 sec)
mysql> show create table t2;
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| t2 | CREATE TABLE `t2` (
`a` int(11) NOT NULL AUTO_INCREMENT,
`b` int(11) DEFAULT NULL,
`c` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 |
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
TiDB:
```
mysql> create table t2(a int key auto_increment, b int, c int);
Query OK, 0 rows affected (0.01 sec)
mysql> insert into t2 values (0, 1, 1);
Query OK, 1 row affected (0.00 sec)
mysql> insert into t2 values (0, 1, 1);
Query OK, 1 row affected (0.01 sec)
mysql> insert into t2 values (0, 1, 1);
Query OK, 1 row affected (0.00 sec)
mysql> show create table t2;
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| t2 | CREATE TABLE `t2` (
`a` int(11) NOT NULL AUTO_INCREMENT,
`b` int(11) DEFAULT NULL,
`c` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin |
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```",1,auto increment is missing from show create table auto increment x is missing from show create table mysql mysql create table a int key auto increment b int c int query ok rows affected sec mysql insert into values query ok row affected sec mysql insert into values query ok row affected sec mysql insert into values query ok row affected sec mysql show create table table create table create table a int not null auto increment b int default null c int default null primary key a engine innodb auto increment default charset row in set sec tidb mysql create table a int key auto increment b int c int query ok rows affected sec mysql insert into values query ok row affected sec mysql insert into values query ok row affected sec mysql insert into values query ok row affected sec mysql show create table table create table create table a int not null auto increment b int default null c int default null primary key a engine innodb default charset collate bin row in set sec ,1
12344,14599682914.0,IssuesEvent,2020-12-21 04:58:47,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Muti-update behavior with mysql.,challenge-program severity/moderate sig/execution status/help-wanted type/bug type/compatibility,"## Description
In Mysql:
```
mysql> select * from t;
+------+------+
| a | b |
+------+------+
| 3 | 1 |
| 4 | 2 |
| 5 | 3 |
+------+------+
mysql> select * from tt;
+------+------+
| a | b |
+------+------+
| 3 | 1 |
| 4 | 2 |
| 5 | 3 |
+------+------+
mysql> update t, tt set t.a=t.a+1, tt.a=t.a+1;
Query OK, 5 rows affected (0.01 sec)
Rows matched: 6 Changed: 5 Warnings: 0
mysql> select * from t;
+------+------+
| a | b |
+------+------+
| 4 | 1 |
| 5 | 2 |
| 6 | 3 |
+------+------+
3 rows in set (0.00 sec)
mysql> select * from tt;
+------+------+
| a | b |
+------+------+
| 5 | 1 |
| 5 | 2 |
| 5 | 3 |
+------+------+
3 rows in set (0.00 sec)
```
And something as strange as this when do multi-update.
It's hard to be completely comatible with it.
## SIG slack channel
[#sig-exec](https://slack.tidb.io/invite?team=tidb-community&channel=sig-exec&ref=high-performance)
## Score
- 300
## Mentor
* @lzmhhh123
",True,"Muti-update behavior with mysql. - ## Description
In Mysql:
```
mysql> select * from t;
+------+------+
| a | b |
+------+------+
| 3 | 1 |
| 4 | 2 |
| 5 | 3 |
+------+------+
mysql> select * from tt;
+------+------+
| a | b |
+------+------+
| 3 | 1 |
| 4 | 2 |
| 5 | 3 |
+------+------+
mysql> update t, tt set t.a=t.a+1, tt.a=t.a+1;
Query OK, 5 rows affected (0.01 sec)
Rows matched: 6 Changed: 5 Warnings: 0
mysql> select * from t;
+------+------+
| a | b |
+------+------+
| 4 | 1 |
| 5 | 2 |
| 6 | 3 |
+------+------+
3 rows in set (0.00 sec)
mysql> select * from tt;
+------+------+
| a | b |
+------+------+
| 5 | 1 |
| 5 | 2 |
| 5 | 3 |
+------+------+
3 rows in set (0.00 sec)
```
And something as strange as this when do multi-update.
It's hard to be completely comatible with it.
## SIG slack channel
[#sig-exec](https://slack.tidb.io/invite?team=tidb-community&channel=sig-exec&ref=high-performance)
## Score
- 300
## Mentor
* @lzmhhh123
",1,muti update behavior with mysql description in mysql mysql select from t a b mysql select from tt a b mysql update t tt set t a t a tt a t a query ok rows affected sec rows matched changed warnings mysql select from t a b rows in set sec mysql select from tt a b rows in set sec and something as strange as this when do multi update it s hard to be completely comatible with it sig slack channel score mentor ,1
11866,13999627955.0,IssuesEvent,2020-10-28 11:06:27,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,expression: let str_to_date() works the same as that in MYSQL,component/expression feature/accepted type/compatibility type/feature-request,"## Feature Request
**Is your feature request related to a problem? Please describe:**
https://github.com/pingcap/tidb/issues/18370 although is fixed, but it need to solve some unexpections.
**Describe the feature you'd like:**
```
mysql> SELECT STR_TO_DATE('2020-07-04 11:22:33 PM c', '%Y-%m-%d %r');
+--------------------------------------------------------+
| STR_TO_DATE('2020-07-04 11:22:33 PM c', '%Y-%m-%d %r') |
+--------------------------------------------------------+
| 2020-07-04 23:22:33 |
+--------------------------------------------------------+
1 row in set (0.00 sec) // it should throw a warning.
mysql> SELECT STR_TO_DATE('11:22:33 PM', ' %r');
+-----------------------------------+
| STR_TO_DATE('11:22:33 PM', ' %r') |
+-----------------------------------+
| NULL |
+-----------------------------------+
1 row in set, 1 warning (0.00 sec) // should work normally.
mysql> show warnings;
+---------+------+-------------------------------------------------+
| Level | Code | Message |
+---------+------+-------------------------------------------------+
| Warning | 1292 | Incorrect datetime value: '0000-00-00 23:22:33' |
+---------+------+-------------------------------------------------+
1 row in set (0.00 sec)
```
**Describe alternatives you've considered:**
**Teachability, Documentation, Adoption, Migration Strategy:**
",True,"expression: let str_to_date() works the same as that in MYSQL - ## Feature Request
**Is your feature request related to a problem? Please describe:**
https://github.com/pingcap/tidb/issues/18370 although is fixed, but it need to solve some unexpections.
**Describe the feature you'd like:**
```
mysql> SELECT STR_TO_DATE('2020-07-04 11:22:33 PM c', '%Y-%m-%d %r');
+--------------------------------------------------------+
| STR_TO_DATE('2020-07-04 11:22:33 PM c', '%Y-%m-%d %r') |
+--------------------------------------------------------+
| 2020-07-04 23:22:33 |
+--------------------------------------------------------+
1 row in set (0.00 sec) // it should throw a warning.
mysql> SELECT STR_TO_DATE('11:22:33 PM', ' %r');
+-----------------------------------+
| STR_TO_DATE('11:22:33 PM', ' %r') |
+-----------------------------------+
| NULL |
+-----------------------------------+
1 row in set, 1 warning (0.00 sec) // should work normally.
mysql> show warnings;
+---------+------+-------------------------------------------------+
| Level | Code | Message |
+---------+------+-------------------------------------------------+
| Warning | 1292 | Incorrect datetime value: '0000-00-00 23:22:33' |
+---------+------+-------------------------------------------------+
1 row in set (0.00 sec)
```
**Describe alternatives you've considered:**
**Teachability, Documentation, Adoption, Migration Strategy:**
",1,expression let str to date works the same as that in mysql feature request is your feature request related to a problem please describe although is fixed but it need to solve some unexpections describe the feature you d like mysql select str to date pm c y m d r str to date pm c y m d r row in set sec it should throw a warning mysql select str to date pm r str to date pm r null row in set warning sec should work normally mysql show warnings level code message warning incorrect datetime value row in set sec describe alternatives you ve considered teachability documentation adoption migration strategy ,1
3435,6402529235.0,IssuesEvent,2017-08-06 10:27:05,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,parser: `DISTINCTROW` is not supported,compatibility easy rc3.1,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```
CREATE TABLE t1 (email varchar(50), infoID BIGINT, dateentered DATETIME);
CREATE TABLE t2 (infoID BIGINT, shipcode varchar(10));
INSERT INTO t1 (email, infoID, dateentered) VALUES('test1@testdomain.com', 1, '2002-07-30 22:56:38');
INSERT INTO t2(infoID, shipcode) VALUES(1, 'Z001');
SELECT DISTINCTROW email, shipcode FROM t1, t2 WHERE t1.infoID=t2.infoID;
```
2. What did you expect to see?
```
mysql> CREATE TABLE t1 (email varchar(50), infoID BIGINT, dateentered DATETIME);
Query OK, 0 rows affected (0.01 sec)
mysql> CREATE TABLE t2 (infoID BIGINT, shipcode varchar(10));
Query OK, 0 rows affected (0.01 sec)
mysql> INSERT INTO t1 (email, infoID, dateentered) VALUES('test1@testdomain.com', 1, '2002-07-30 22:56:38');
Query OK, 1 row affected (0.00 sec)
mysql> INSERT INTO t2(infoID, shipcode) VALUES(1, 'Z001');
Query OK, 1 row affected (0.01 sec)
mysql> SELECT DISTINCTROW email, shipcode FROM t1, t2 WHERE t1.infoID=t2.infoID;
+----------------------+----------+
| email | shipcode |
+----------------------+----------+
| test1@testdomain.com | Z001 |
+----------------------+----------+
1 row in set (0.00 sec)
```
3. What did you see instead?
```
mysql> CREATE TABLE t1 (email varchar(50), infoID BIGINT, dateentered DATETIME);
Query OK, 0 rows affected (0.09 sec)
mysql> CREATE TABLE t2 (infoID BIGINT, shipcode varchar(10));
Query OK, 0 rows affected (0.09 sec)
mysql> INSERT INTO t1 (email, infoID, dateentered) VALUES('test1@testdomain.com', 1, '2002-07-30 22:56:38');
Query OK, 1 row affected (0.01 sec)
mysql> INSERT INTO t2(infoID, shipcode) VALUES(1, 'Z001');
Query OK, 1 row affected (0.01 sec)
mysql> SELECT DISTINCTROW email, shipcode FROM t1, t2 WHERE t1.infoID=t2.infoID;
ERROR 1105 (HY000): unknown column distinctrow
```
4. What version of TiDB are you using (`tidb-server -V`)?
",True,"parser: `DISTINCTROW` is not supported - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```
CREATE TABLE t1 (email varchar(50), infoID BIGINT, dateentered DATETIME);
CREATE TABLE t2 (infoID BIGINT, shipcode varchar(10));
INSERT INTO t1 (email, infoID, dateentered) VALUES('test1@testdomain.com', 1, '2002-07-30 22:56:38');
INSERT INTO t2(infoID, shipcode) VALUES(1, 'Z001');
SELECT DISTINCTROW email, shipcode FROM t1, t2 WHERE t1.infoID=t2.infoID;
```
2. What did you expect to see?
```
mysql> CREATE TABLE t1 (email varchar(50), infoID BIGINT, dateentered DATETIME);
Query OK, 0 rows affected (0.01 sec)
mysql> CREATE TABLE t2 (infoID BIGINT, shipcode varchar(10));
Query OK, 0 rows affected (0.01 sec)
mysql> INSERT INTO t1 (email, infoID, dateentered) VALUES('test1@testdomain.com', 1, '2002-07-30 22:56:38');
Query OK, 1 row affected (0.00 sec)
mysql> INSERT INTO t2(infoID, shipcode) VALUES(1, 'Z001');
Query OK, 1 row affected (0.01 sec)
mysql> SELECT DISTINCTROW email, shipcode FROM t1, t2 WHERE t1.infoID=t2.infoID;
+----------------------+----------+
| email | shipcode |
+----------------------+----------+
| test1@testdomain.com | Z001 |
+----------------------+----------+
1 row in set (0.00 sec)
```
3. What did you see instead?
```
mysql> CREATE TABLE t1 (email varchar(50), infoID BIGINT, dateentered DATETIME);
Query OK, 0 rows affected (0.09 sec)
mysql> CREATE TABLE t2 (infoID BIGINT, shipcode varchar(10));
Query OK, 0 rows affected (0.09 sec)
mysql> INSERT INTO t1 (email, infoID, dateentered) VALUES('test1@testdomain.com', 1, '2002-07-30 22:56:38');
Query OK, 1 row affected (0.01 sec)
mysql> INSERT INTO t2(infoID, shipcode) VALUES(1, 'Z001');
Query OK, 1 row affected (0.01 sec)
mysql> SELECT DISTINCTROW email, shipcode FROM t1, t2 WHERE t1.infoID=t2.infoID;
ERROR 1105 (HY000): unknown column distinctrow
```
4. What version of TiDB are you using (`tidb-server -V`)?
",1,parser distinctrow is not supported please answer these questions before submitting your issue thanks what did you do create table email varchar infoid bigint dateentered datetime create table infoid bigint shipcode varchar insert into email infoid dateentered values testdomain com insert into infoid shipcode values select distinctrow email shipcode from where infoid infoid what did you expect to see mysql create table email varchar infoid bigint dateentered datetime query ok rows affected sec mysql create table infoid bigint shipcode varchar query ok rows affected sec mysql insert into email infoid dateentered values testdomain com query ok row affected sec mysql insert into infoid shipcode values query ok row affected sec mysql select distinctrow email shipcode from where infoid infoid email shipcode testdomain com row in set sec what did you see instead mysql create table email varchar infoid bigint dateentered datetime query ok rows affected sec mysql create table infoid bigint shipcode varchar query ok rows affected sec mysql insert into email infoid dateentered values testdomain com query ok row affected sec mysql insert into infoid shipcode values query ok row affected sec mysql select distinctrow email shipcode from where infoid infoid error unknown column distinctrow what version of tidb are you using tidb server v ,1
5570,8049273217.0,IssuesEvent,2018-08-01 09:35:12,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,Check how MySQL sort privilege cache items exactly,help wanted type/compatibility,"https://github.com/pingcap/tidb/pull/7211 try to sort the user records according to the document https://dev.mysql.com/doc/refman/5.5/en/connection-access.html
The document missing many details, so maybe we should check the MySQL source code to see how to do it.",True,"Check how MySQL sort privilege cache items exactly - https://github.com/pingcap/tidb/pull/7211 try to sort the user records according to the document https://dev.mysql.com/doc/refman/5.5/en/connection-access.html
The document missing many details, so maybe we should check the MySQL source code to see how to do it.",1,check how mysql sort privilege cache items exactly try to sort the user records according to the document the document missing many details so maybe we should check the mysql source code to see how to do it ,1
8188,10270345398.0,IssuesEvent,2019-08-23 11:21:45,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,"After executing ""modify column"", its flag has changed",type/bug type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
CREATE TABLE `t` (
`a` varchar(123) DEFAULT NULL,
`d` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
tidb> select d from t;
Field 1: `d`
Catalog: `def`
Database: `test`
Table: `t`
Org_table: `t`
Type: DATETIME
Collation: binary (63)
Length: 19
Max_length: 0
Decimals: 0
Flags: NOT_NULL BINARY
```
alter table t modify column d datetime
select d from t;
```
2. What did you expect to see?
I hope that after executing ""modify column"", its flag is the same as before.
3. What did you see instead?
```
tidb> alter table t modify column d datetime;
Query OK, 0 rows affected (0.01 sec)
tidb> select d from t;
Field 1: `d`
Catalog: `def`
Database: `test`
Table: `t`
Org_table: `t`
Type: DATETIME
Collation: binary (63)
Length: 19
Max_length: 0
Decimals: 0
Flags:
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
[""Release Version""=v4.0.0-alpha-119-g0ff5b50c1-dirty]
[""Git Commit Hash""=0ff5b50c1509bed279a2c2ba7acdb38519b38c9c]
",True,"After executing ""modify column"", its flag has changed - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
CREATE TABLE `t` (
`a` varchar(123) DEFAULT NULL,
`d` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
tidb> select d from t;
Field 1: `d`
Catalog: `def`
Database: `test`
Table: `t`
Org_table: `t`
Type: DATETIME
Collation: binary (63)
Length: 19
Max_length: 0
Decimals: 0
Flags: NOT_NULL BINARY
```
alter table t modify column d datetime
select d from t;
```
2. What did you expect to see?
I hope that after executing ""modify column"", its flag is the same as before.
3. What did you see instead?
```
tidb> alter table t modify column d datetime;
Query OK, 0 rows affected (0.01 sec)
tidb> select d from t;
Field 1: `d`
Catalog: `def`
Database: `test`
Table: `t`
Org_table: `t`
Type: DATETIME
Collation: binary (63)
Length: 19
Max_length: 0
Decimals: 0
Flags:
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
[""Release Version""=v4.0.0-alpha-119-g0ff5b50c1-dirty]
[""Git Commit Hash""=0ff5b50c1509bed279a2c2ba7acdb38519b38c9c]
",1,after executing modify column its flag has changed bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error create table t a varchar default null d datetime default null engine innodb default charset collate bin tidb select d from t field d catalog def database test table t org table t type datetime collation binary length max length decimals flags not null binary alter table t modify column d datetime select d from t what did you expect to see i hope that after executing modify column its flag is the same as before what did you see instead tidb alter table t modify column d datetime query ok rows affected sec tidb select d from t field d catalog def database test table t org table t type datetime collation binary length max length decimals flags what version of tidb are you using tidb server v or run select tidb version on tidb ,1
14856,18388722272.0,IssuesEvent,2021-10-12 00:39:34,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,expression: Non-existing local timestamps during DST spring forward got converted to 0 instead of getting the transition timestamp,type/compatibility component/expression,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```sql
set time_zone = 'Europe/Vilnius';
select unix_timestamp('2020-03-29 03:45:00');
```
### 2. What did you expect to see? (Required)
On MySQL 8.0, after the server time zone got [populated](https://dev.mysql.com/doc/refman/8.0/en/time-zone-support.html#time-zone-installation):
```sql
mysql> select unix_timestamp('2020-03-29 03:45:00');
+---------------------------------------+
| unix_timestamp('2020-03-29 03:45:00') |
+---------------------------------------+
| 1585443600 |
+---------------------------------------+
1 row in set (0.00 sec)
```
(Note: 1,585,443,600 = 2020-03-29 01:00:00 UTC, the instant when the spring forward happens)
### 3. What did you see instead (Required)
```
mysql> select unix_timestamp('2020-03-29 03:45:00');
+---------------------------------------+
| unix_timestamp('2020-03-29 03:45:00') |
+---------------------------------------+
| 0 |
+---------------------------------------+
1 row in set (0.15 sec)
```
### 4. What is your TiDB version? (Required)
```
Release Version: v5.2.1
Edition: Community
Git Commit Hash: cd8fb24c5f7ebd9d479ed228bb41848bd5e97445
Git Branch: heads/refs/tags/v5.2.1
UTC Build Time: 2021-09-08 02:32:56
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
```
",True,"expression: Non-existing local timestamps during DST spring forward got converted to 0 instead of getting the transition timestamp - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```sql
set time_zone = 'Europe/Vilnius';
select unix_timestamp('2020-03-29 03:45:00');
```
### 2. What did you expect to see? (Required)
On MySQL 8.0, after the server time zone got [populated](https://dev.mysql.com/doc/refman/8.0/en/time-zone-support.html#time-zone-installation):
```sql
mysql> select unix_timestamp('2020-03-29 03:45:00');
+---------------------------------------+
| unix_timestamp('2020-03-29 03:45:00') |
+---------------------------------------+
| 1585443600 |
+---------------------------------------+
1 row in set (0.00 sec)
```
(Note: 1,585,443,600 = 2020-03-29 01:00:00 UTC, the instant when the spring forward happens)
### 3. What did you see instead (Required)
```
mysql> select unix_timestamp('2020-03-29 03:45:00');
+---------------------------------------+
| unix_timestamp('2020-03-29 03:45:00') |
+---------------------------------------+
| 0 |
+---------------------------------------+
1 row in set (0.15 sec)
```
### 4. What is your TiDB version? (Required)
```
Release Version: v5.2.1
Edition: Community
Git Commit Hash: cd8fb24c5f7ebd9d479ed228bb41848bd5e97445
Git Branch: heads/refs/tags/v5.2.1
UTC Build Time: 2021-09-08 02:32:56
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
```
",1,expression non existing local timestamps during dst spring forward got converted to instead of getting the transition timestamp bug report please answer these questions before submitting your issue thanks minimal reproduce step required sql set time zone europe vilnius select unix timestamp what did you expect to see required on mysql after the server time zone got sql mysql select unix timestamp unix timestamp row in set sec note utc the instant when the spring forward happens what did you see instead required mysql select unix timestamp unix timestamp row in set sec what is your tidb version required release version edition community git commit hash git branch heads refs tags utc build time goversion race enabled false tikv min version check table before drop false ,1
4895,7498308285.0,IssuesEvent,2018-04-09 03:40:25,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,`unix_timestamp`'s return type is not compatible,compatibility for-new-contributors help wanted,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
mysql> select unix_timestamp('2016-01-01');
+------------------------------+
| unix_timestamp('2016-01-01') |
+------------------------------+
| 1451577600.000000 |
+------------------------------+
1 row in set (0.00 sec)
2. What did you expect to see?
mysql> select unix_timestamp('2016-01-01');
+------------------------------+
| unix_timestamp('2016-01-01') |
+------------------------------+
| 1451577600 |
+------------------------------+
1 row in set (0.00 sec)
3. What did you see instead?
Should be the same, but it's different.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
57afbe2680dbc6b23e604b5c0d5ab322a494e772",True,"`unix_timestamp`'s return type is not compatible - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
mysql> select unix_timestamp('2016-01-01');
+------------------------------+
| unix_timestamp('2016-01-01') |
+------------------------------+
| 1451577600.000000 |
+------------------------------+
1 row in set (0.00 sec)
2. What did you expect to see?
mysql> select unix_timestamp('2016-01-01');
+------------------------------+
| unix_timestamp('2016-01-01') |
+------------------------------+
| 1451577600 |
+------------------------------+
1 row in set (0.00 sec)
3. What did you see instead?
Should be the same, but it's different.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
57afbe2680dbc6b23e604b5c0d5ab322a494e772",1, unix timestamp s return type is not compatible please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error mysql select unix timestamp unix timestamp row in set sec what did you expect to see mysql select unix timestamp unix timestamp row in set sec what did you see instead should be the same but it s different what version of tidb are you using tidb server v or run select tidb version on tidb ,1
14437,17404670602.0,IssuesEvent,2021-08-03 03:01:07,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Drop local temporary table is not atomic,sig/sql-infra type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
Prepare
```
set @@tidb_enable_noop_functions=1;
create temporary table taa (id int);
drop table taa, tnexist;
```
The drop clause will fail here because table tnexist not exist. And then execute sql:
```
select * from taa;
```
### 2. What did you expect to see? (Required)
```
mysql> select * from taa;
Empty set (0.00 sec)
```
### 3. What did you see instead (Required)
```
mysql> select * from taa;
ERROR 1146 (42S02): Table 'test.taa' doesn't exist
```
### 4. What is your TiDB version? (Required)
master
",True,"Drop local temporary table is not atomic - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
Prepare
```
set @@tidb_enable_noop_functions=1;
create temporary table taa (id int);
drop table taa, tnexist;
```
The drop clause will fail here because table tnexist not exist. And then execute sql:
```
select * from taa;
```
### 2. What did you expect to see? (Required)
```
mysql> select * from taa;
Empty set (0.00 sec)
```
### 3. What did you see instead (Required)
```
mysql> select * from taa;
ERROR 1146 (42S02): Table 'test.taa' doesn't exist
```
### 4. What is your TiDB version? (Required)
master
",1,drop local temporary table is not atomic bug report please answer these questions before submitting your issue thanks minimal reproduce step required prepare set tidb enable noop functions create temporary table taa id int drop table taa tnexist the drop clause will fail here because table tnexist not exist and then execute sql select from taa what did you expect to see required mysql select from taa empty set sec what did you see instead required mysql select from taa error table test taa doesn t exist what is your tidb version required master ,1
12298,14535961839.0,IssuesEvent,2020-12-15 06:44:51,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Error is not consistent with MySQL when insert into a table with SET type,challenge-program good-first-issue severity/moderate sig/execution status/help-wanted type/bug type/compatibility,"## Description
## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
mysql> create table myset(i int, s set('a', 'b', 'c'));
Query OK, 0 rows affected (0.03 sec)
mysql> insert into myset values (2, 'a, b, c');
```
2. What did you expect to see?
```
ERROR 1265 (01000): Data truncated for column 's' at row 1
```
3. What did you see instead?
```
ERROR 1105 (HY000): cannot convert datum from char to type set.
```
## SIG slack channel
[#sig-exec](https://slack.tidb.io/invite?team=tidb-community&channel=sig-exec&ref=high-performance)
## Score
300
## Mentor
- @lzmhhh123
",True,"Error is not consistent with MySQL when insert into a table with SET type - ## Description
## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
mysql> create table myset(i int, s set('a', 'b', 'c'));
Query OK, 0 rows affected (0.03 sec)
mysql> insert into myset values (2, 'a, b, c');
```
2. What did you expect to see?
```
ERROR 1265 (01000): Data truncated for column 's' at row 1
```
3. What did you see instead?
```
ERROR 1105 (HY000): cannot convert datum from char to type set.
```
## SIG slack channel
[#sig-exec](https://slack.tidb.io/invite?team=tidb-community&channel=sig-exec&ref=high-performance)
## Score
300
## Mentor
- @lzmhhh123
",1,error is not consistent with mysql when insert into a table with set type description bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error mysql create table myset i int s set a b c query ok rows affected sec mysql insert into myset values a b c what did you expect to see error data truncated for column s at row what did you see instead error cannot convert datum from char to type set sig slack channel score mentor ,1
12262,14493963114.0,IssuesEvent,2020-12-11 09:13:22,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Function `extract` is incompatible with Mysql,challenge-program component/expression difficulty/easy good-first-issue high-performance severity/major sig/execution status/help-wanted type/bug type/compatibility,"## Description
## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
select extract(DAY_MINUTE FROM ""01 23:45:56.89"");
select extract(DAY_HOUR FROM ""01 23:45:56.89"");
select extract(DAY_MICROSECOND FROM ""01 23:45:56.89"");
select extract(DAY_SECOND FROM ""01 23:45:56.89"");
```
2. What did you expect to see?
In Mysql
```
mysql> select extract(DAY_MINUTE FROM ""01 23:45:56.89"");
+-------------------------------------------+
| extract(DAY_MINUTE FROM ""01 23:45:56.89"") |
+-------------------------------------------+
| 4745 |
+-------------------------------------------+
1 row in set (0.00 sec)
mysql> select extract(DAY_HOUR FROM ""01 23:45:56.89"");
+-----------------------------------------+
| extract(DAY_HOUR FROM ""01 23:45:56.89"") |
+-----------------------------------------+
| 47 |
+-----------------------------------------+
1 row in set (0.00 sec)
mysql> select extract(DAY_MICROSECOND FROM ""01 23:45:56.89"");
+------------------------------------------------+
| extract(DAY_MICROSECOND FROM ""01 23:45:56.89"") |
+------------------------------------------------+
| 474556890000 |
+------------------------------------------------+
1 row in set (0.00 sec)
mysql> select extract(DAY_SECOND FROM ""01 23:45:56.89"");
+-------------------------------------------+
| extract(DAY_SECOND FROM ""01 23:45:56.89"") |
+-------------------------------------------+
| 474556 |
+-------------------------------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
In TiDB
```
mysql> select extract(DAY_MINUTE FROM ""01 23:45:56.89"");
+-------------------------------------------+
| extract(DAY_MINUTE FROM ""01 23:45:56.89"") |
+-------------------------------------------+
| NULL |
+-------------------------------------------+
1 row in set, 1 warning (0.01 sec)
mysql> select extract(DAY_HOUR FROM ""01 23:45:56.89"");
+-----------------------------------------+
| extract(DAY_HOUR FROM ""01 23:45:56.89"") |
+-----------------------------------------+
| NULL |
+-----------------------------------------+
1 row in set, 1 warning (0.00 sec)
+----------------------------------------+
1 row in set (0.00 sec)
mysql> select extract(DAY_MICROSECOND FROM ""01 23:45:56.89"");
+------------------------------------------------+
| extract(DAY_MICROSECOND FROM ""01 23:45:56.89"") |
+------------------------------------------------+
| NULL |
+------------------------------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> select extract(DAY_SECOND FROM ""01 23:45:56.89"");
+-------------------------------------------+
| extract(DAY_SECOND FROM ""01 23:45:56.89"") |
+-------------------------------------------+
| NULL |
+-------------------------------------------+
1 row in set, 1 warning (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v3.0.0-beta-212-g0681b8125
Git Commit Hash: 0681b8125080045ee0d4747ce61923164c6f2dd1
Git Branch: master
UTC Build Time: 2019-03-14 04:39:19
GoVersion: go version go1.12 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
## SIG slack channel
[#sig-exec](https://tidbcommunity.slack.com/archives/CMRD79DRR)
## Score
- 300
## Mentor
* @XuHuaiyu
",True,"Function `extract` is incompatible with Mysql - ## Description
## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
select extract(DAY_MINUTE FROM ""01 23:45:56.89"");
select extract(DAY_HOUR FROM ""01 23:45:56.89"");
select extract(DAY_MICROSECOND FROM ""01 23:45:56.89"");
select extract(DAY_SECOND FROM ""01 23:45:56.89"");
```
2. What did you expect to see?
In Mysql
```
mysql> select extract(DAY_MINUTE FROM ""01 23:45:56.89"");
+-------------------------------------------+
| extract(DAY_MINUTE FROM ""01 23:45:56.89"") |
+-------------------------------------------+
| 4745 |
+-------------------------------------------+
1 row in set (0.00 sec)
mysql> select extract(DAY_HOUR FROM ""01 23:45:56.89"");
+-----------------------------------------+
| extract(DAY_HOUR FROM ""01 23:45:56.89"") |
+-----------------------------------------+
| 47 |
+-----------------------------------------+
1 row in set (0.00 sec)
mysql> select extract(DAY_MICROSECOND FROM ""01 23:45:56.89"");
+------------------------------------------------+
| extract(DAY_MICROSECOND FROM ""01 23:45:56.89"") |
+------------------------------------------------+
| 474556890000 |
+------------------------------------------------+
1 row in set (0.00 sec)
mysql> select extract(DAY_SECOND FROM ""01 23:45:56.89"");
+-------------------------------------------+
| extract(DAY_SECOND FROM ""01 23:45:56.89"") |
+-------------------------------------------+
| 474556 |
+-------------------------------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
In TiDB
```
mysql> select extract(DAY_MINUTE FROM ""01 23:45:56.89"");
+-------------------------------------------+
| extract(DAY_MINUTE FROM ""01 23:45:56.89"") |
+-------------------------------------------+
| NULL |
+-------------------------------------------+
1 row in set, 1 warning (0.01 sec)
mysql> select extract(DAY_HOUR FROM ""01 23:45:56.89"");
+-----------------------------------------+
| extract(DAY_HOUR FROM ""01 23:45:56.89"") |
+-----------------------------------------+
| NULL |
+-----------------------------------------+
1 row in set, 1 warning (0.00 sec)
+----------------------------------------+
1 row in set (0.00 sec)
mysql> select extract(DAY_MICROSECOND FROM ""01 23:45:56.89"");
+------------------------------------------------+
| extract(DAY_MICROSECOND FROM ""01 23:45:56.89"") |
+------------------------------------------------+
| NULL |
+------------------------------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> select extract(DAY_SECOND FROM ""01 23:45:56.89"");
+-------------------------------------------+
| extract(DAY_SECOND FROM ""01 23:45:56.89"") |
+-------------------------------------------+
| NULL |
+-------------------------------------------+
1 row in set, 1 warning (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v3.0.0-beta-212-g0681b8125
Git Commit Hash: 0681b8125080045ee0d4747ce61923164c6f2dd1
Git Branch: master
UTC Build Time: 2019-03-14 04:39:19
GoVersion: go version go1.12 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
## SIG slack channel
[#sig-exec](https://tidbcommunity.slack.com/archives/CMRD79DRR)
## Score
- 300
## Mentor
* @XuHuaiyu
",1,function extract is incompatible with mysql description bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error select extract day minute from select extract day hour from select extract day microsecond from select extract day second from what did you expect to see in mysql mysql select extract day minute from extract day minute from row in set sec mysql select extract day hour from extract day hour from row in set sec mysql select extract day microsecond from extract day microsecond from row in set sec mysql select extract day second from extract day second from row in set sec what did you see instead in tidb mysql select extract day minute from extract day minute from null row in set warning sec mysql select extract day hour from extract day hour from null row in set warning sec row in set sec mysql select extract day microsecond from extract day microsecond from null row in set warning sec mysql select extract day second from extract day second from null row in set warning sec what version of tidb are you using tidb server v or run select tidb version on tidb tidb version release version beta git commit hash git branch master utc build time goversion go version darwin race enabled false tikv min version alpha check table before drop false row in set sec sig slack channel score mentor xuhuaiyu ,1
6132,8555627141.0,IssuesEvent,2018-11-08 10:35:16,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,`SELECT ROW` result different from mysql,type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
execute `SELECT ROW(1,2,3)<>ROW(2+1,2,3);`
2. What did you expect to see?
```
mysql> SELECT ROW(1,2,3)<>ROW(2+1,2,3);
+--------------------------+
| ROW(1,2,3)<>ROW(2+1,2,3) |
+--------------------------+
| 1 |
+--------------------------+
1 row in set (0.01 sec)
```
3. What did you see instead?
```
mysql> SELECT ROW(1,2,3)ROW(2+1,2,3) |
+-------------------------+
| 0 |
+-------------------------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
master
",True,"`SELECT ROW` result different from mysql - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
execute `SELECT ROW(1,2,3)<>ROW(2+1,2,3);`
2. What did you expect to see?
```
mysql> SELECT ROW(1,2,3)<>ROW(2+1,2,3);
+--------------------------+
| ROW(1,2,3)<>ROW(2+1,2,3) |
+--------------------------+
| 1 |
+--------------------------+
1 row in set (0.01 sec)
```
3. What did you see instead?
```
mysql> SELECT ROW(1,2,3)ROW(2+1,2,3) |
+-------------------------+
| 0 |
+-------------------------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
master
",1, select row result different from mysql bug report please answer these questions before submitting your issue thanks what did you do execute select row row what did you expect to see mysql select row row row row row in set sec what did you see instead mysql select row row row row row in set sec what version of tidb are you using tidb server v or run select tidb version on tidb master ,1
6054,8489350550.0,IssuesEvent,2018-10-26 19:36:28,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,LOAD DATA LOCAL INFILE does not update processlist,type/compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
I imported sample data in 8 threads into TiDB using `LOAD DATA LOCAL INFILE` (script called from an xargs on ls):
```
#!/bin/sh
echo $1
mysql bikeshare -e ""LOAD DATA LOCAL INFILE '$1' INTO TABLE trips FIELDS TERMINATED BY ',' ENCLOSED BY '\""' LINES TERMINATED BY '\r\n' (duration, start_date, end_date, start_station_number, start_station, end_station_number, end_station, bike_number, member_type)"";
```
I was trying to see the status of the files in `SHOW PROCESSLIST` or `SHOW FULL PROCESSLIST`:
```
mysql> show full processlist;
+------+------+-----------+-----------+---------+------+-------+-----------------------+------+
| Id | User | Host | db | Command | Time | State | Info | Mem |
+------+------+-----------+-----------+---------+------+-------+-----------------------+------+
| 58 | root | 127.0.0.1 | bikeshare | Query | 0 | 2 | | 0 |
| 60 | root | 127.0.0.1 | bikeshare | Query | 0 | 2 | | 0 |
| 7 | root | 127.0.0.1 | bikeshare | Query | 0 | 2 | | 0 |
| 63 | root | 127.0.0.1 | bikeshare | Query | 0 | 2 | | 0 |
| 52 | root | 127.0.0.1 | | Query | 0 | 2 | show full processlist | 0 |
| 64 | root | 127.0.0.1 | bikeshare | Query | 0 | 2 | | 0 |
| 65 | root | 127.0.0.1 | bikeshare | Query | 0 | 2 | | 0 |
| 66 | root | 127.0.0.1 | | Query | 25 | 2 | select sleep(60) | 0 |
| 62 | root | 127.0.0.1 | bikeshare | Query | 0 | 2 | | 0 |
| 54 | root | 127.0.0.1 | bikeshare | Query | 0 | 2 | | 0 |
+------+------+-----------+-----------+---------+------+-------+-----------------------+------+
10 rows in set (0.00 sec)
```
2. What did you expect to see?
It looks like the `Time` and `Info` columns are not updated for `LOAD DATA LOCAL INFILE`. There is an existing bug report on `State` not updating. For a normal select query, `Time` and `Info` update fine.
3. What did you see instead?
Same behavior as a long-running select. Here is a MySQL 8.0 example (it is useful to see `info` populated):
```
mysql [localhost] {msandbox} ((none)) > show processlist;
+----+-----------------+-----------+-----------+---------+------+------------------------+------------------------------------------------------------------------------------------------------+
| Id | User | Host | db | Command | Time | State | Info |
+----+-----------------+-----------+-----------+---------+------+------------------------+------------------------------------------------------------------------------------------------------+
| 4 | event_scheduler | localhost | NULL | Daemon | 1439 | Waiting on empty queue | NULL |
| 37 | msandbox | localhost | NULL | Query | 0 | starting | show processlist |
| 55 | msandbox | localhost | bikeshare | Query | 439 | query end | LOAD DATA LOCAL INFILE '2016Q3-capitalbikeshare-tripdata.csv' INTO TABLE trips FIELDS TERMINATED BY |
| 60 | msandbox | localhost | bikeshare | Query | 439 | executing | LOAD DATA LOCAL INFILE '2017Q3-capitalbikeshare-tripdata.csv' INTO TABLE trips FIELDS TERMINATED BY |
| 62 | msandbox | localhost | bikeshare | Query | 439 | executing | LOAD DATA LOCAL INFILE '2017Q2-capitalbikeshare-tripdata.csv' INTO TABLE trips FIELDS TERMINATED BY |
+----+-----------------+-----------+-----------+---------+------+------------------------+------------------------------------------------------------------------------------------------------+
5 rows in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
I'm running a branch which has tracing. I built it today:
```
mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: rc1-3104-g51046aa7
Git Commit Hash: 51046aa717e782d3843ae2c91f0a0952de05a4e5
Git Branch: tidb_tracing_prototype
UTC Build Time: 2018-08-23 08:21:06
GoVersion: go version go1.10.1 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
1 row in set (0.00 sec)
```",True,"LOAD DATA LOCAL INFILE does not update processlist - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
I imported sample data in 8 threads into TiDB using `LOAD DATA LOCAL INFILE` (script called from an xargs on ls):
```
#!/bin/sh
echo $1
mysql bikeshare -e ""LOAD DATA LOCAL INFILE '$1' INTO TABLE trips FIELDS TERMINATED BY ',' ENCLOSED BY '\""' LINES TERMINATED BY '\r\n' (duration, start_date, end_date, start_station_number, start_station, end_station_number, end_station, bike_number, member_type)"";
```
I was trying to see the status of the files in `SHOW PROCESSLIST` or `SHOW FULL PROCESSLIST`:
```
mysql> show full processlist;
+------+------+-----------+-----------+---------+------+-------+-----------------------+------+
| Id | User | Host | db | Command | Time | State | Info | Mem |
+------+------+-----------+-----------+---------+------+-------+-----------------------+------+
| 58 | root | 127.0.0.1 | bikeshare | Query | 0 | 2 | | 0 |
| 60 | root | 127.0.0.1 | bikeshare | Query | 0 | 2 | | 0 |
| 7 | root | 127.0.0.1 | bikeshare | Query | 0 | 2 | | 0 |
| 63 | root | 127.0.0.1 | bikeshare | Query | 0 | 2 | | 0 |
| 52 | root | 127.0.0.1 | | Query | 0 | 2 | show full processlist | 0 |
| 64 | root | 127.0.0.1 | bikeshare | Query | 0 | 2 | | 0 |
| 65 | root | 127.0.0.1 | bikeshare | Query | 0 | 2 | | 0 |
| 66 | root | 127.0.0.1 | | Query | 25 | 2 | select sleep(60) | 0 |
| 62 | root | 127.0.0.1 | bikeshare | Query | 0 | 2 | | 0 |
| 54 | root | 127.0.0.1 | bikeshare | Query | 0 | 2 | | 0 |
+------+------+-----------+-----------+---------+------+-------+-----------------------+------+
10 rows in set (0.00 sec)
```
2. What did you expect to see?
It looks like the `Time` and `Info` columns are not updated for `LOAD DATA LOCAL INFILE`. There is an existing bug report on `State` not updating. For a normal select query, `Time` and `Info` update fine.
3. What did you see instead?
Same behavior as a long-running select. Here is a MySQL 8.0 example (it is useful to see `info` populated):
```
mysql [localhost] {msandbox} ((none)) > show processlist;
+----+-----------------+-----------+-----------+---------+------+------------------------+------------------------------------------------------------------------------------------------------+
| Id | User | Host | db | Command | Time | State | Info |
+----+-----------------+-----------+-----------+---------+------+------------------------+------------------------------------------------------------------------------------------------------+
| 4 | event_scheduler | localhost | NULL | Daemon | 1439 | Waiting on empty queue | NULL |
| 37 | msandbox | localhost | NULL | Query | 0 | starting | show processlist |
| 55 | msandbox | localhost | bikeshare | Query | 439 | query end | LOAD DATA LOCAL INFILE '2016Q3-capitalbikeshare-tripdata.csv' INTO TABLE trips FIELDS TERMINATED BY |
| 60 | msandbox | localhost | bikeshare | Query | 439 | executing | LOAD DATA LOCAL INFILE '2017Q3-capitalbikeshare-tripdata.csv' INTO TABLE trips FIELDS TERMINATED BY |
| 62 | msandbox | localhost | bikeshare | Query | 439 | executing | LOAD DATA LOCAL INFILE '2017Q2-capitalbikeshare-tripdata.csv' INTO TABLE trips FIELDS TERMINATED BY |
+----+-----------------+-----------+-----------+---------+------+------------------------+------------------------------------------------------------------------------------------------------+
5 rows in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
I'm running a branch which has tracing. I built it today:
```
mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: rc1-3104-g51046aa7
Git Commit Hash: 51046aa717e782d3843ae2c91f0a0952de05a4e5
Git Branch: tidb_tracing_prototype
UTC Build Time: 2018-08-23 08:21:06
GoVersion: go version go1.10.1 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
1 row in set (0.00 sec)
```",1,load data local infile does not update processlist please answer these questions before submitting your issue thanks what did you do i imported sample data in threads into tidb using load data local infile script called from an xargs on ls bin sh echo mysql bikeshare e load data local infile into table trips fields terminated by enclosed by lines terminated by r n duration start date end date start station number start station end station number end station bike number member type i was trying to see the status of the files in show processlist or show full processlist mysql show full processlist id user host db command time state info mem root bikeshare query root bikeshare query root bikeshare query root bikeshare query root query show full processlist root bikeshare query root bikeshare query root query select sleep root bikeshare query root bikeshare query rows in set sec what did you expect to see it looks like the time and info columns are not updated for load data local infile there is an existing bug report on state not updating for a normal select query time and info update fine what did you see instead same behavior as a long running select here is a mysql example it is useful to see info populated mysql msandbox none show processlist id user host db command time state info event scheduler localhost null daemon waiting on empty queue null msandbox localhost null query starting show processlist msandbox localhost bikeshare query query end load data local infile capitalbikeshare tripdata csv into table trips fields terminated by msandbox localhost bikeshare query executing load data local infile capitalbikeshare tripdata csv into table trips fields terminated by msandbox localhost bikeshare query executing load data local infile capitalbikeshare tripdata csv into table trips fields terminated by rows in set sec what version of tidb are you using tidb server v or run select tidb version on tidb i m running a branch which has tracing i built it today mysql select tidb version g row tidb version release version git commit hash git branch tidb tracing prototype utc build time goversion go version linux race enabled false tikv min version alpha row in set sec ,1
3380,6346700935.0,IssuesEvent,2017-07-28 03:27:37,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,Built-in function SOUNDEX not supported,compatibility rc3.1,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```
create table t1 (id integer, a varchar(100) character set utf8 collate utf8_unicode_ci);
insert into t1 values (1, 'Test');
select * from t1 where soundex(a) = soundex('Test');
```
2. What did you expect to see?
```
+------+------+
| id | a |
+------+------+
| 1 | Test |
+------+------+
1 row in set (0.01 sec)
```
3. What did you see instead?
```
ERROR 1105 (HY000): line 0 column 31 near ""a) = soundex('Test')"" (total length 51)
```
4. What version of TiDB are you using (`tidb-server -V`)?
",True,"Built-in function SOUNDEX not supported - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```
create table t1 (id integer, a varchar(100) character set utf8 collate utf8_unicode_ci);
insert into t1 values (1, 'Test');
select * from t1 where soundex(a) = soundex('Test');
```
2. What did you expect to see?
```
+------+------+
| id | a |
+------+------+
| 1 | Test |
+------+------+
1 row in set (0.01 sec)
```
3. What did you see instead?
```
ERROR 1105 (HY000): line 0 column 31 near ""a) = soundex('Test')"" (total length 51)
```
4. What version of TiDB are you using (`tidb-server -V`)?
",1,built in function soundex not supported please answer these questions before submitting your issue thanks what did you do create table id integer a varchar character set collate unicode ci insert into values test select from where soundex a soundex test what did you expect to see id a test row in set sec what did you see instead error line column near a soundex test total length what version of tidb are you using tidb server v ,1
8169,10262802910.0,IssuesEvent,2019-08-22 13:08:05,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,can not text prepare a stmt in variable,type/compatibility,"got error `Can not prepare multiple statements.`
MySQL:
```
mysql> SET @c = ""a"";
Query OK, 0 rows affected (0.00 sec)
mysql> SET @s = CONCAT(""SELECT "", @c, "" FROM t"");
Query OK, 0 rows affected (0.01 sec)
mysql> PREPARE stmt FROM @s;
Query OK, 0 rows affected (0.00 sec)
Statement prepared
mysql> EXECUTE stmt;
+------+
| a |
+------+
| 1 |
+------+
1 row in set (0.00 sec)
```
TiDB:
```
mysql> SET @c = ""a"";
Query OK, 0 rows affected (0.00 sec)
mysql> SET @s = CONCAT(""SELECT "", @c, "" FROM t"");
Query OK, 0 rows affected (0.01 sec)
mysql> PREPARE stmt FROM @s;
ERROR 1105 (HY000): Can not prepare multiple statements
```
shecma `t` is:
```
mysql> show create table t;
+-------+-------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+-------------------------------------------------------------------------------------+
| t | CREATE TABLE `t` (
`a` int(11) DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+-------+-------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
",True,"can not text prepare a stmt in variable - got error `Can not prepare multiple statements.`
MySQL:
```
mysql> SET @c = ""a"";
Query OK, 0 rows affected (0.00 sec)
mysql> SET @s = CONCAT(""SELECT "", @c, "" FROM t"");
Query OK, 0 rows affected (0.01 sec)
mysql> PREPARE stmt FROM @s;
Query OK, 0 rows affected (0.00 sec)
Statement prepared
mysql> EXECUTE stmt;
+------+
| a |
+------+
| 1 |
+------+
1 row in set (0.00 sec)
```
TiDB:
```
mysql> SET @c = ""a"";
Query OK, 0 rows affected (0.00 sec)
mysql> SET @s = CONCAT(""SELECT "", @c, "" FROM t"");
Query OK, 0 rows affected (0.01 sec)
mysql> PREPARE stmt FROM @s;
ERROR 1105 (HY000): Can not prepare multiple statements
```
shecma `t` is:
```
mysql> show create table t;
+-------+-------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+-------------------------------------------------------------------------------------+
| t | CREATE TABLE `t` (
`a` int(11) DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+-------+-------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
",1,can not text prepare a stmt in variable got error can not prepare multiple statements mysql mysql set c a query ok rows affected sec mysql set s concat select c from t query ok rows affected sec mysql prepare stmt from s query ok rows affected sec statement prepared mysql execute stmt a row in set sec tidb mysql set c a query ok rows affected sec mysql set s concat select c from t query ok rows affected sec mysql prepare stmt from s error can not prepare multiple statements shecma t is mysql show create table t table create table t create table t a int default engine innodb default charset row in set sec ,1
8080,10208742730.0,IssuesEvent,2019-08-14 10:54:16,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,JDBC to TiDB useCursorFetch error...,component/mysql-protocol type/bug type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
the jdbc url is :
jdbc:mysql://xxx?serverTimezone=Asia/Shanghai&max_allowed_packet=-1&autoReconnect=true&useUnicode=true&characterEncoding=utf8&useSSL=true&useCursorFetch=true&defaultFetchSize=10000
org.springframework.jdbc.UncategorizedSQLException: StatementCallback; uncategorized SQLException for SQL [select max(marstime) from xxx.Account]; SQL state [HY000]; error code [1105]; ERROR 1105 (HY000): unsupported flag 1; nested exception is java.sql.SQLException: ERROR 1105 (HY000): unsupported flag 1
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:89)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
at org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1414)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:388)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:452)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:462)
at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:473)
at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:480)
at com.netease.mars.source.AccountSource.run(AccountSource.java:106)
at org.apache.flink.streaming.api.operators.StreamSource.run(StreamSource.java:94)
at org.apache.flink.streaming.api.operators.StreamSource.run(StreamSource.java:58)
at org.apache.flink.streaming.runtime.tasks.SourceStreamTask.run(SourceStreamTask.java:99)
at org.apache.flink.streaming.runtime.tasks.StoppableSourceStreamTask.run(StoppableSourceStreamTask.java:45)
at org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:300)
at org.apache.flink.runtime.taskmanager.Task.run(Task.java:704)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.sql.SQLException: ERROR 1105 (HY000): unsupported flag 1
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
at com.mysql.cj.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:633)
at com.mysql.cj.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:414)
at com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:392)
at com.mysql.cj.jdbc.StatementImpl.createResultSetUsingServerFetch(StatementImpl.java:582)
at com.mysql.cj.jdbc.StatementImpl.executeQuery(StatementImpl.java:1158)
at com.alibaba.druid.pool.DruidPooledStatement.executeQuery(DruidPooledStatement.java:230)
at org.springframework.jdbc.core.JdbcTemplate$1QueryStatementCallback.doInStatement(JdbcTemplate.java:439)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:376)
2. What did you expect to see?
3. What did you see instead?
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
mysql> select tidb_version();
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v2.0.11
Git Commit Hash: 83889a5d821f40412be1af2ad2f2393737f517fd
Git Branch: release-2.0
UTC Build Time: 2019-01-03 09:27:12
GoVersion: go version go1.11.2 linux/amd64
TiKV Min Version: 2.0.0-rc.4.1
",True,"JDBC to TiDB useCursorFetch error... - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
the jdbc url is :
jdbc:mysql://xxx?serverTimezone=Asia/Shanghai&max_allowed_packet=-1&autoReconnect=true&useUnicode=true&characterEncoding=utf8&useSSL=true&useCursorFetch=true&defaultFetchSize=10000
org.springframework.jdbc.UncategorizedSQLException: StatementCallback; uncategorized SQLException for SQL [select max(marstime) from xxx.Account]; SQL state [HY000]; error code [1105]; ERROR 1105 (HY000): unsupported flag 1; nested exception is java.sql.SQLException: ERROR 1105 (HY000): unsupported flag 1
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:89)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
at org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1414)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:388)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:452)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:462)
at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:473)
at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:480)
at com.netease.mars.source.AccountSource.run(AccountSource.java:106)
at org.apache.flink.streaming.api.operators.StreamSource.run(StreamSource.java:94)
at org.apache.flink.streaming.api.operators.StreamSource.run(StreamSource.java:58)
at org.apache.flink.streaming.runtime.tasks.SourceStreamTask.run(SourceStreamTask.java:99)
at org.apache.flink.streaming.runtime.tasks.StoppableSourceStreamTask.run(StoppableSourceStreamTask.java:45)
at org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:300)
at org.apache.flink.runtime.taskmanager.Task.run(Task.java:704)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.sql.SQLException: ERROR 1105 (HY000): unsupported flag 1
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
at com.mysql.cj.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:633)
at com.mysql.cj.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:414)
at com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:392)
at com.mysql.cj.jdbc.StatementImpl.createResultSetUsingServerFetch(StatementImpl.java:582)
at com.mysql.cj.jdbc.StatementImpl.executeQuery(StatementImpl.java:1158)
at com.alibaba.druid.pool.DruidPooledStatement.executeQuery(DruidPooledStatement.java:230)
at org.springframework.jdbc.core.JdbcTemplate$1QueryStatementCallback.doInStatement(JdbcTemplate.java:439)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:376)
2. What did you expect to see?
3. What did you see instead?
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
mysql> select tidb_version();
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v2.0.11
Git Commit Hash: 83889a5d821f40412be1af2ad2f2393737f517fd
Git Branch: release-2.0
UTC Build Time: 2019-01-03 09:27:12
GoVersion: go version go1.11.2 linux/amd64
TiKV Min Version: 2.0.0-rc.4.1
",1,jdbc to tidb usecursorfetch error bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error the jdbc url is : jdbc mysql xxx servertimezone asia shanghai max allowed packet autoreconnect true useunicode true characterencoding usessl true usecursorfetch true defaultfetchsize org springframework jdbc uncategorizedsqlexception statementcallback uncategorized sqlexception for sql sql state error code error unsupported flag nested exception is java sql sqlexception error unsupported flag at org springframework jdbc support abstractfallbacksqlexceptiontranslator translate abstractfallbacksqlexceptiontranslator java at org springframework jdbc support abstractfallbacksqlexceptiontranslator translate abstractfallbacksqlexceptiontranslator java at org springframework jdbc support abstractfallbacksqlexceptiontranslator translate abstractfallbacksqlexceptiontranslator java at org springframework jdbc core jdbctemplate translateexception jdbctemplate java at org springframework jdbc core jdbctemplate execute jdbctemplate java at org springframework jdbc core jdbctemplate query jdbctemplate java at org springframework jdbc core jdbctemplate query jdbctemplate java at org springframework jdbc core jdbctemplate queryforobject jdbctemplate java at org springframework jdbc core jdbctemplate queryforobject jdbctemplate java at com netease mars source accountsource run accountsource java at org apache flink streaming api operators streamsource run streamsource java at org apache flink streaming api operators streamsource run streamsource java at org apache flink streaming runtime tasks sourcestreamtask run sourcestreamtask java at org apache flink streaming runtime tasks stoppablesourcestreamtask run stoppablesourcestreamtask java at org apache flink streaming runtime tasks streamtask invoke streamtask java at org apache flink runtime taskmanager task run task java at java lang thread run thread java caused by java sql sqlexception error unsupported flag at com mysql cj jdbc exceptions sqlerror createsqlexception sqlerror java at com mysql cj jdbc exceptions sqlerror createsqlexception sqlerror java at com mysql cj jdbc exceptions sqlexceptionsmapping translateexception sqlexceptionsmapping java at com mysql cj jdbc serverpreparedstatement serverexecute serverpreparedstatement java at com mysql cj jdbc serverpreparedstatement executeinternal serverpreparedstatement java at com mysql cj jdbc clientpreparedstatement execute clientpreparedstatement java at com mysql cj jdbc statementimpl createresultsetusingserverfetch statementimpl java at com mysql cj jdbc statementimpl executequery statementimpl java at com alibaba druid pool druidpooledstatement executequery druidpooledstatement java at org springframework jdbc core jdbctemplate doinstatement jdbctemplate java at org springframework jdbc core jdbctemplate execute jdbctemplate java what did you expect to see what did you see instead what version of tidb are you using tidb server v or run select tidb version on tidb mysql select tidb version tidb version release version git commit hash git branch release utc build time goversion go version linux tikv min version rc ,1
7013,9301980842.0,IssuesEvent,2019-03-24 04:20:05,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,`select constants which have a plus prefix` is not same with MySQL,help wanted type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
In TiDB:
mysql> select +1000;
+-------+
| +1000 |
+-------+
| 1000 |
+-------+
1 row in set (0.00 sec)
In MySQL:
mysql> select +1000;
+------+
| 1000 |
+------+
| 1000 |
+------+
1 row in set (0.00 sec)
2. What did you expect to see?
No plus display before column name.
3. What did you see instead?
A plus before column name.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
mysql> select tidb_version();
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v3.0.0-beta-202-g85b1cd7-dirty
Git Commit Hash: 85b1cd7aa2d21119e39d4cc9a317557aaf7aa13c
Git Branch: master
UTC Build Time: 2019-03-12 12:17:58
GoVersion: go version go1.12 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
",True,"`select constants which have a plus prefix` is not same with MySQL - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
In TiDB:
mysql> select +1000;
+-------+
| +1000 |
+-------+
| 1000 |
+-------+
1 row in set (0.00 sec)
In MySQL:
mysql> select +1000;
+------+
| 1000 |
+------+
| 1000 |
+------+
1 row in set (0.00 sec)
2. What did you expect to see?
No plus display before column name.
3. What did you see instead?
A plus before column name.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
mysql> select tidb_version();
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v3.0.0-beta-202-g85b1cd7-dirty
Git Commit Hash: 85b1cd7aa2d21119e39d4cc9a317557aaf7aa13c
Git Branch: master
UTC Build Time: 2019-03-12 12:17:58
GoVersion: go version go1.12 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
",1, select constants which have a plus prefix is not same with mysql bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error in tidb mysql select row in set sec in mysql mysql select row in set sec what did you expect to see no plus display before column name what did you see instead a plus before column name what version of tidb are you using tidb server v or run select tidb version on tidb mysql select tidb version tidb version release version beta dirty git commit hash git branch master utc build time goversion go version linux race enabled false tikv min version alpha check table before drop false row in set sec ,1
10620,12527666743.0,IssuesEvent,2020-06-04 08:18:41,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,The decimal type calculation result is not compatbile,type/bug type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
The sum result of two decimal type is not decimal, it's compatible with MySQL 5.7 but not with TiDB 4.0 and MySQL 8.0. Return the decimal result type seems better.
```
create table t(c1 int, ld decimal(32,4), rd decimal(32,4));
insert into t values(1, -100.0000, 100.0000);
select sum(ld + rd) + 1 from t;
```
### 2. What did you expect to see? (Required)
```
mysql> select sum(ld + rd) + 1 from t;
+------------------+
| sum(ld + rd) + 1 |
+------------------+
| 1.0000 |
+------------------+
1 row in set (0.00 sec)
```
### 3. What did you see instead (Required)
```
mysql> select sum(ld + rd) + 1 from t;
+------------------+
| sum(ld + rd) + 1 |
+------------------+
| 1 |
+------------------+
1 row in set (0.00 sec)
```
### 4. Affected version (Required)
v3.0.12
### 5. Root Cause Analysis
",True,"The decimal type calculation result is not compatbile - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
The sum result of two decimal type is not decimal, it's compatible with MySQL 5.7 but not with TiDB 4.0 and MySQL 8.0. Return the decimal result type seems better.
```
create table t(c1 int, ld decimal(32,4), rd decimal(32,4));
insert into t values(1, -100.0000, 100.0000);
select sum(ld + rd) + 1 from t;
```
### 2. What did you expect to see? (Required)
```
mysql> select sum(ld + rd) + 1 from t;
+------------------+
| sum(ld + rd) + 1 |
+------------------+
| 1.0000 |
+------------------+
1 row in set (0.00 sec)
```
### 3. What did you see instead (Required)
```
mysql> select sum(ld + rd) + 1 from t;
+------------------+
| sum(ld + rd) + 1 |
+------------------+
| 1 |
+------------------+
1 row in set (0.00 sec)
```
### 4. Affected version (Required)
v3.0.12
### 5. Root Cause Analysis
",1,the decimal type calculation result is not compatbile bug report please answer these questions before submitting your issue thanks minimal reproduce step required the sum result of two decimal type is not decimal it s compatible with mysql but not with tidb and mysql return the decimal result type seems better create table t int ld decimal rd decimal insert into t values select sum ld rd from t what did you expect to see required mysql select sum ld rd from t sum ld rd row in set sec what did you see instead required mysql select sum ld rd from t sum ld rd row in set sec affected version required root cause analysis ,1
5751,8205166684.0,IssuesEvent,2018-09-03 09:16:04,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,type bit could have null as its default value,type/compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
CREATE TABLE testAllTypes (
field_1 BIT NULL DEFAULT NULL
,field_2 TINYINT NULL DEFAULT NULL
,field_3 TINYINT UNSIGNED NULL DEFAULT NULL
,field_4 BIGINT NULL DEFAULT NULL
,field_5 BIGINT UNSIGNED NULL DEFAULT NULL
,field_6 MEDIUMBLOB NULL DEFAULT NULL
,field_7 LONGBLOB NULL DEFAULT NULL
,field_8 BLOB NULL DEFAULT NULL
,field_9 TINYBLOB NULL DEFAULT NULL
,field_10 VARBINARY(255) NULL DEFAULT NULL
,field_11 BINARY(255) NULL DEFAULT NULL
,field_12 MEDIUMTEXT NULL DEFAULT NULL
,field_13 LONGTEXT NULL DEFAULT NULL
,field_14 TEXT NULL DEFAULT NULL
,field_15 TINYTEXT NULL DEFAULT NULL
,field_16 CHAR(255) NULL DEFAULT NULL
,field_17 NUMERIC NULL DEFAULT NULL
,field_18 DECIMAL NULL DEFAULT NULL
,field_19 INTEGER NULL DEFAULT NULL
,field_20 INTEGER UNSIGNED NULL DEFAULT NULL
,field_21 INT NULL DEFAULT NULL
,field_22 INT UNSIGNED NULL DEFAULT NULL
,field_23 MEDIUMINT NULL DEFAULT NULL
,field_24 MEDIUMINT UNSIGNED NULL DEFAULT NULL
,field_25 SMALLINT NULL DEFAULT NULL
,field_26 SMALLINT UNSIGNED NULL DEFAULT NULL
,field_27 FLOAT NULL DEFAULT NULL
,field_28 DOUBLE NULL DEFAULT NULL
,field_29 DOUBLE PRECISION NULL DEFAULT NULL
,field_30 REAL NULL DEFAULT NULL
,field_31 VARCHAR(255) NULL DEFAULT NULL
,field_32 DATE NULL DEFAULT NULL
,field_33 TIME NULL DEFAULT NULL
,field_34 DATETIME NULL DEFAULT NULL
,field_35 TIMESTAMP NULL DEFAULT NULL
);
```
2. What did you expect to see?
No error.
3. What did you see instead?
ERROR 1067 (42000): Invalid default value for 'field_1'
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
e04f74b031f5b47dba79537e7780356bc96745c5
",True,"type bit could have null as its default value - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
CREATE TABLE testAllTypes (
field_1 BIT NULL DEFAULT NULL
,field_2 TINYINT NULL DEFAULT NULL
,field_3 TINYINT UNSIGNED NULL DEFAULT NULL
,field_4 BIGINT NULL DEFAULT NULL
,field_5 BIGINT UNSIGNED NULL DEFAULT NULL
,field_6 MEDIUMBLOB NULL DEFAULT NULL
,field_7 LONGBLOB NULL DEFAULT NULL
,field_8 BLOB NULL DEFAULT NULL
,field_9 TINYBLOB NULL DEFAULT NULL
,field_10 VARBINARY(255) NULL DEFAULT NULL
,field_11 BINARY(255) NULL DEFAULT NULL
,field_12 MEDIUMTEXT NULL DEFAULT NULL
,field_13 LONGTEXT NULL DEFAULT NULL
,field_14 TEXT NULL DEFAULT NULL
,field_15 TINYTEXT NULL DEFAULT NULL
,field_16 CHAR(255) NULL DEFAULT NULL
,field_17 NUMERIC NULL DEFAULT NULL
,field_18 DECIMAL NULL DEFAULT NULL
,field_19 INTEGER NULL DEFAULT NULL
,field_20 INTEGER UNSIGNED NULL DEFAULT NULL
,field_21 INT NULL DEFAULT NULL
,field_22 INT UNSIGNED NULL DEFAULT NULL
,field_23 MEDIUMINT NULL DEFAULT NULL
,field_24 MEDIUMINT UNSIGNED NULL DEFAULT NULL
,field_25 SMALLINT NULL DEFAULT NULL
,field_26 SMALLINT UNSIGNED NULL DEFAULT NULL
,field_27 FLOAT NULL DEFAULT NULL
,field_28 DOUBLE NULL DEFAULT NULL
,field_29 DOUBLE PRECISION NULL DEFAULT NULL
,field_30 REAL NULL DEFAULT NULL
,field_31 VARCHAR(255) NULL DEFAULT NULL
,field_32 DATE NULL DEFAULT NULL
,field_33 TIME NULL DEFAULT NULL
,field_34 DATETIME NULL DEFAULT NULL
,field_35 TIMESTAMP NULL DEFAULT NULL
);
```
2. What did you expect to see?
No error.
3. What did you see instead?
ERROR 1067 (42000): Invalid default value for 'field_1'
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
e04f74b031f5b47dba79537e7780356bc96745c5
",1,type bit could have null as its default value please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error sql create table testalltypes field bit null default null field tinyint null default null field tinyint unsigned null default null field bigint null default null field bigint unsigned null default null field mediumblob null default null field longblob null default null field blob null default null field tinyblob null default null field varbinary null default null field binary null default null field mediumtext null default null field longtext null default null field text null default null field tinytext null default null field char null default null field numeric null default null field decimal null default null field integer null default null field integer unsigned null default null field int null default null field int unsigned null default null field mediumint null default null field mediumint unsigned null default null field smallint null default null field smallint unsigned null default null field float null default null field double null default null field double precision null default null field real null default null field varchar null default null field date null default null field time null default null field datetime null default null field timestamp null default null what did you expect to see no error what did you see instead error invalid default value for field what version of tidb are you using tidb server v or run select tidb version on tidb ,1
9161,11195210011.0,IssuesEvent,2020-01-03 05:16:10,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Support ALTER TABLE .. RENAME COLUMN,component/DDL-need-LGT3 type/compatibility,"## Feature Request
**Is your feature request related to a problem? Please describe:**
TiDB does not currently support rename column. Rename index works fine though!
**Describe the feature you'd like:**
```
CREATE TABLE t1 (id int not null primary key auto_increment, col1 INT);
ALTER TABLE t1 RENAME COLUMN col1 to col2;
```
tidb:
```
mysql> CREATE TABLE t1 (id int not null primary key auto_increment, col1 INT);
Query OK, 0 rows affected (0.12 sec)
mysql> ALTER TABLE t1 RENAME COLUMN col1 to col2;
ERROR 1064 (42000): 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 28 near ""COLUMN col1 to col2""
```
mysql:
```
mysql80> CREATE TABLE t1 (id int not null primary key auto_increment, col1 INT);
Query OK, 0 rows affected (0.05 sec)
mysql80> ALTER TABLE t1 RENAME COLUMN col1 to col2;
Query OK, 0 rows affected (0.02 sec)
Records: 0 Duplicates: 0 Warnings: 0
```
**Describe alternatives you've considered:**
It is possible to workaround this with `CHANGE`, so the plumbing to rename obviously exists within the server:
```
mysql> ALTER TABLE t1 CHANGE col1 col2 INT;
Query OK, 0 rows affected (0.10 sec)
mysql> show create table t1\G
*************************** 1. row ***************************
Table: t1
Create Table: CREATE TABLE `t1` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`col2` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
1 row in set (0.00 sec)
```
**Teachability, Documentation, Adoption, Migration Strategy:**
MySQL compatible behavior",True,"Support ALTER TABLE .. RENAME COLUMN - ## Feature Request
**Is your feature request related to a problem? Please describe:**
TiDB does not currently support rename column. Rename index works fine though!
**Describe the feature you'd like:**
```
CREATE TABLE t1 (id int not null primary key auto_increment, col1 INT);
ALTER TABLE t1 RENAME COLUMN col1 to col2;
```
tidb:
```
mysql> CREATE TABLE t1 (id int not null primary key auto_increment, col1 INT);
Query OK, 0 rows affected (0.12 sec)
mysql> ALTER TABLE t1 RENAME COLUMN col1 to col2;
ERROR 1064 (42000): 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 28 near ""COLUMN col1 to col2""
```
mysql:
```
mysql80> CREATE TABLE t1 (id int not null primary key auto_increment, col1 INT);
Query OK, 0 rows affected (0.05 sec)
mysql80> ALTER TABLE t1 RENAME COLUMN col1 to col2;
Query OK, 0 rows affected (0.02 sec)
Records: 0 Duplicates: 0 Warnings: 0
```
**Describe alternatives you've considered:**
It is possible to workaround this with `CHANGE`, so the plumbing to rename obviously exists within the server:
```
mysql> ALTER TABLE t1 CHANGE col1 col2 INT;
Query OK, 0 rows affected (0.10 sec)
mysql> show create table t1\G
*************************** 1. row ***************************
Table: t1
Create Table: CREATE TABLE `t1` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`col2` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
1 row in set (0.00 sec)
```
**Teachability, Documentation, Adoption, Migration Strategy:**
MySQL compatible behavior",1,support alter table rename column feature request is your feature request related to a problem please describe tidb does not currently support rename column rename index works fine though describe the feature you d like create table id int not null primary key auto increment int alter table rename column to tidb mysql create table id int not null primary key auto increment int query ok rows affected sec mysql alter table rename column to error you have an error in your sql syntax check the manual that corresponds to your tidb version for the right syntax to use line column near column to mysql create table id int not null primary key auto increment int query ok rows affected sec alter table rename column to query ok rows affected sec records duplicates warnings describe alternatives you ve considered it is possible to workaround this with change so the plumbing to rename obviously exists within the server mysql alter table change int query ok rows affected sec mysql show create table g row table create table create table id int not null auto increment int default null primary key id engine innodb default charset collate bin row in set sec teachability documentation adoption migration strategy mysql compatible behavior,1
3849,6705903836.0,IssuesEvent,2017-10-12 03:25:33,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,group by with alias variable not consistent with MySQL.,compatibility,"test.sql:
```
DROP TABLE IF EXISTS t1;
SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
CREATE TABLE t1 (
cont_nr int(11) NOT NULL auto_increment,
ver_nr int(11) NOT NULL default '0',
aufnr int(11) NOT NULL default '0',
username varchar(50) NOT NULL default '',
hdl_nr int(11) NOT NULL default '0',
eintrag date NOT NULL default '0000-00-00',
st_klasse varchar(40) NOT NULL default '',
st_wert varchar(40) NOT NULL default '',
st_zusatz varchar(40) NOT NULL default '',
st_bemerkung varchar(255) NOT NULL default '',
kunden_art varchar(40) NOT NULL default '',
mcbs_knr int(11) default NULL,
mcbs_aufnr int(11) NOT NULL default '0',
schufa_status char(1) default '?',
bemerkung text,
wirknetz text,
wf_igz int(11) NOT NULL default '0',
tarifcode varchar(80) default NULL,
recycle char(1) default NULL,
sim varchar(30) default NULL,
mcbs_tpl varchar(30) default NULL,
emp_nr int(11) NOT NULL default '0',
laufzeit int(11) default NULL,
hdl_name varchar(30) default NULL,
prov_hdl_nr int(11) NOT NULL default '0',
auto_wirknetz varchar(50) default NULL,
auto_billing varchar(50) default NULL,
touch timestamp NOT NULL,
kategorie varchar(50) default NULL,
kundentyp varchar(20) NOT NULL default '',
sammel_rech_msisdn varchar(30) NOT NULL default '',
p_nr varchar(9) NOT NULL default '',
suffix char(3) NOT NULL default '',
PRIMARY KEY (cont_nr),
KEY idx_aufnr(aufnr),
KEY idx_hdl_nr(hdl_nr),
KEY idx_st_klasse(st_klasse),
KEY ver_nr(ver_nr),
KEY eintrag_idx(eintrag),
KEY emp_nr_idx(emp_nr),
KEY wf_igz(wf_igz),
KEY touch(touch),
KEY hdl_tag(eintrag,hdl_nr),
KEY prov_hdl_nr(prov_hdl_nr),
KEY mcbs_aufnr(mcbs_aufnr),
KEY kundentyp(kundentyp),
KEY p_nr(p_nr,suffix)
);
INSERT INTO t1 VALUES (3359356,405,3359356,'Mustermann Musterfrau',52500,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und gepr�ft','','privat',1485525,2122316,'+','','N',1909160,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',3,24,'MobilCom Shop Koeln',52500,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
INSERT INTO t1 VALUES (3359357,468,3359357,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und gepr�ft','','privat',1503580,2139699,'+','','P',1909171,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
INSERT INTO t1 VALUES (3359358,407,3359358,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und gepr�ft','','privat',1501358,2137473,'N','','N',1909159,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
INSERT INTO t1 VALUES (3359359,468,3359359,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und gepr�ft','','privat',1507831,2143894,'+','','P',1909162,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
INSERT INTO t1 VALUES (3359360,0,0,'Mustermann Musterfrau',29674907,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und gepr�ft','','privat',1900169997,2414578,'+',NULL,'N',1909148,'',NULL,NULL,'RV99066_2',20,NULL,'POS',29674907,NULL,NULL,20010202105916,'Mobilfunk','','','97317481','007');
INSERT INTO t1 VALUES (3359361,406,3359361,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag storniert','','(7001-84):Storno, Kd. m�chte nicht mehr','privat',NULL,0,'+','','P',1909150,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
INSERT INTO t1 VALUES (3359362,406,3359362,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und gepr�ft','','privat',1509984,2145874,'+','','P',1909154,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
SELECT ELT(FIELD(kundentyp,'PP','PPA','PG','PGA','FK','FKA','FP','FPA','K','KA','V','VA',''), 'Privat (Private Nutzung)','Privat (Private Nutzung) Sitz im Ausland','Privat (geschaeftliche Nutzung)','Privat (geschaeftliche Nutzung) Sitz im Ausland','Firma (Kapitalgesellschaft)','Firma (Kapitalgesellschaft) Sitz im Ausland','Firma (Personengesellschaft)','Firma (Personengesellschaft) Sitz im Ausland','oeff. rechtl. Koerperschaft','oeff. rechtl. Koerperschaft Sitz im Ausland','Eingetragener Verein','Eingetragener Verein Sitz im Ausland','Typ unbekannt') AS Kundentyp ,kategorie FROM t1 WHERE hdl_nr < 2000000 AND kategorie IN ('Prepaid','Mobilfunk') AND st_klasse = 'Workflow' GROUP BY kundentyp ORDER BY kategorie;
```
MySQL got:
```
+--------------------------+-----------+
| Kundentyp | kategorie |
+--------------------------+-----------+
| Privat (Private Nutzung) | Mobilfunk |
+--------------------------+-----------+
1 row in set, 1 warning (0.00 sec)
mysql> show warnings;
+---------+------+----------------------------------------------------+
| Level | Code | Message |
+---------+------+----------------------------------------------------+
| Warning | 1052 | Column 'kundentyp' in group statement is ambiguous |
+---------+------+----------------------------------------------------+
1 row in set (0.00 sec)
```
but TiDB got empty set;
",True,"group by with alias variable not consistent with MySQL. - test.sql:
```
DROP TABLE IF EXISTS t1;
SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
CREATE TABLE t1 (
cont_nr int(11) NOT NULL auto_increment,
ver_nr int(11) NOT NULL default '0',
aufnr int(11) NOT NULL default '0',
username varchar(50) NOT NULL default '',
hdl_nr int(11) NOT NULL default '0',
eintrag date NOT NULL default '0000-00-00',
st_klasse varchar(40) NOT NULL default '',
st_wert varchar(40) NOT NULL default '',
st_zusatz varchar(40) NOT NULL default '',
st_bemerkung varchar(255) NOT NULL default '',
kunden_art varchar(40) NOT NULL default '',
mcbs_knr int(11) default NULL,
mcbs_aufnr int(11) NOT NULL default '0',
schufa_status char(1) default '?',
bemerkung text,
wirknetz text,
wf_igz int(11) NOT NULL default '0',
tarifcode varchar(80) default NULL,
recycle char(1) default NULL,
sim varchar(30) default NULL,
mcbs_tpl varchar(30) default NULL,
emp_nr int(11) NOT NULL default '0',
laufzeit int(11) default NULL,
hdl_name varchar(30) default NULL,
prov_hdl_nr int(11) NOT NULL default '0',
auto_wirknetz varchar(50) default NULL,
auto_billing varchar(50) default NULL,
touch timestamp NOT NULL,
kategorie varchar(50) default NULL,
kundentyp varchar(20) NOT NULL default '',
sammel_rech_msisdn varchar(30) NOT NULL default '',
p_nr varchar(9) NOT NULL default '',
suffix char(3) NOT NULL default '',
PRIMARY KEY (cont_nr),
KEY idx_aufnr(aufnr),
KEY idx_hdl_nr(hdl_nr),
KEY idx_st_klasse(st_klasse),
KEY ver_nr(ver_nr),
KEY eintrag_idx(eintrag),
KEY emp_nr_idx(emp_nr),
KEY wf_igz(wf_igz),
KEY touch(touch),
KEY hdl_tag(eintrag,hdl_nr),
KEY prov_hdl_nr(prov_hdl_nr),
KEY mcbs_aufnr(mcbs_aufnr),
KEY kundentyp(kundentyp),
KEY p_nr(p_nr,suffix)
);
INSERT INTO t1 VALUES (3359356,405,3359356,'Mustermann Musterfrau',52500,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und gepr�ft','','privat',1485525,2122316,'+','','N',1909160,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',3,24,'MobilCom Shop Koeln',52500,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
INSERT INTO t1 VALUES (3359357,468,3359357,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und gepr�ft','','privat',1503580,2139699,'+','','P',1909171,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
INSERT INTO t1 VALUES (3359358,407,3359358,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und gepr�ft','','privat',1501358,2137473,'N','','N',1909159,'MobilComSuper92000D2',NULL,NULL,'MS9ND2',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
INSERT INTO t1 VALUES (3359359,468,3359359,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und gepr�ft','','privat',1507831,2143894,'+','','P',1909162,'MobilComSuper9D1T10SFreisprech(Akquise)',NULL,NULL,'MS9NS1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
INSERT INTO t1 VALUES (3359360,0,0,'Mustermann Musterfrau',29674907,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und gepr�ft','','privat',1900169997,2414578,'+',NULL,'N',1909148,'',NULL,NULL,'RV99066_2',20,NULL,'POS',29674907,NULL,NULL,20010202105916,'Mobilfunk','','','97317481','007');
INSERT INTO t1 VALUES (3359361,406,3359361,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag storniert','','(7001-84):Storno, Kd. m�chte nicht mehr','privat',NULL,0,'+','','P',1909150,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',325,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
INSERT INTO t1 VALUES (3359362,406,3359362,'Mustermann Musterfrau',7001,'2000-05-20','workflow','Auftrag erledigt','Originalvertrag eingegangen und gepr�ft','','privat',1509984,2145874,'+','','P',1909154,'MobilComSuper92000D1(Akquise)',NULL,NULL,'MS9ND1',327,24,'MobilCom Intern',7003,NULL,'auto',20010202105916,'Mobilfunk','PP','','','');
SELECT ELT(FIELD(kundentyp,'PP','PPA','PG','PGA','FK','FKA','FP','FPA','K','KA','V','VA',''), 'Privat (Private Nutzung)','Privat (Private Nutzung) Sitz im Ausland','Privat (geschaeftliche Nutzung)','Privat (geschaeftliche Nutzung) Sitz im Ausland','Firma (Kapitalgesellschaft)','Firma (Kapitalgesellschaft) Sitz im Ausland','Firma (Personengesellschaft)','Firma (Personengesellschaft) Sitz im Ausland','oeff. rechtl. Koerperschaft','oeff. rechtl. Koerperschaft Sitz im Ausland','Eingetragener Verein','Eingetragener Verein Sitz im Ausland','Typ unbekannt') AS Kundentyp ,kategorie FROM t1 WHERE hdl_nr < 2000000 AND kategorie IN ('Prepaid','Mobilfunk') AND st_klasse = 'Workflow' GROUP BY kundentyp ORDER BY kategorie;
```
MySQL got:
```
+--------------------------+-----------+
| Kundentyp | kategorie |
+--------------------------+-----------+
| Privat (Private Nutzung) | Mobilfunk |
+--------------------------+-----------+
1 row in set, 1 warning (0.00 sec)
mysql> show warnings;
+---------+------+----------------------------------------------------+
| Level | Code | Message |
+---------+------+----------------------------------------------------+
| Warning | 1052 | Column 'kundentyp' in group statement is ambiguous |
+---------+------+----------------------------------------------------+
1 row in set (0.00 sec)
```
but TiDB got empty set;
",1,group by with alias variable not consistent with mysql test sql drop table if exists set sql mode no engine substitution create table cont nr int not null auto increment ver nr int not null default aufnr int not null default username varchar not null default hdl nr int not null default eintrag date not null default st klasse varchar not null default st wert varchar not null default st zusatz varchar not null default st bemerkung varchar not null default kunden art varchar not null default mcbs knr int default null mcbs aufnr int not null default schufa status char default bemerkung text wirknetz text wf igz int not null default tarifcode varchar default null recycle char default null sim varchar default null mcbs tpl varchar default null emp nr int not null default laufzeit int default null hdl name varchar default null prov hdl nr int not null default auto wirknetz varchar default null auto billing varchar default null touch timestamp not null kategorie varchar default null kundentyp varchar not null default sammel rech msisdn varchar not null default p nr varchar not null default suffix char not null default primary key cont nr key idx aufnr aufnr key idx hdl nr hdl nr key idx st klasse st klasse key ver nr ver nr key eintrag idx eintrag key emp nr idx emp nr key wf igz wf igz key touch touch key hdl tag eintrag hdl nr key prov hdl nr prov hdl nr key mcbs aufnr mcbs aufnr key kundentyp kundentyp key p nr p nr suffix insert into values mustermann musterfrau workflow auftrag erledigt originalvertrag eingegangen und gepr�ft privat n null null mobilcom shop koeln null auto mobilfunk pp insert into values mustermann musterfrau workflow auftrag erledigt originalvertrag eingegangen und gepr�ft privat p akquise null null mobilcom intern null auto mobilfunk pp insert into values mustermann musterfrau workflow auftrag erledigt originalvertrag eingegangen und gepr�ft privat n n null null mobilcom intern null auto mobilfunk pp insert into values mustermann musterfrau workflow auftrag erledigt originalvertrag eingegangen und gepr�ft privat p akquise null null mobilcom intern null auto mobilfunk pp insert into values mustermann musterfrau workflow auftrag erledigt originalvertrag eingegangen und gepr�ft privat null n null null null pos null null mobilfunk insert into values mustermann musterfrau workflow auftrag storniert storno kd m�chte nicht mehr privat null p akquise null null mobilcom intern null auto mobilfunk pp insert into values mustermann musterfrau workflow auftrag erledigt originalvertrag eingegangen und gepr�ft privat p akquise null null mobilcom intern null auto mobilfunk pp select elt field kundentyp pp ppa pg pga fk fka fp fpa k ka v va privat private nutzung privat private nutzung sitz im ausland privat geschaeftliche nutzung privat geschaeftliche nutzung sitz im ausland firma kapitalgesellschaft firma kapitalgesellschaft sitz im ausland firma personengesellschaft firma personengesellschaft sitz im ausland oeff rechtl koerperschaft oeff rechtl koerperschaft sitz im ausland eingetragener verein eingetragener verein sitz im ausland typ unbekannt as kundentyp kategorie from where hdl nr and kategorie in prepaid mobilfunk and st klasse workflow group by kundentyp order by kategorie mysql got kundentyp kategorie privat private nutzung mobilfunk row in set warning sec mysql show warnings level code message warning column kundentyp in group statement is ambiguous row in set sec but tidb got empty set ,1
3360,6329346129.0,IssuesEvent,2017-07-26 02:30:56,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,"""CREATE INDEX USING btree"" failed",compatibility todo,"1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
CREATE INDEX `index_ali_logs_on_action_type` USING btree ON `ali_logs` (`action_type`);
```
2. What did you expect to see?
3. What did you see instead?
it says
```
line 0 column 51 near "" btree ON `ali_logs` (`action_type`)"" (total length 87)
```
4. What version of TiDB are you using (`tidb-server -V`)?
```
Git Commit Hash: 64830c93b74356f2a6ab37a95a9c9f4113d1db7d
UTC Build Time: 2017-05-27 08:43:18
```",True,"""CREATE INDEX USING btree"" failed - 1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
CREATE INDEX `index_ali_logs_on_action_type` USING btree ON `ali_logs` (`action_type`);
```
2. What did you expect to see?
3. What did you see instead?
it says
```
line 0 column 51 near "" btree ON `ali_logs` (`action_type`)"" (total length 87)
```
4. What version of TiDB are you using (`tidb-server -V`)?
```
Git Commit Hash: 64830c93b74356f2a6ab37a95a9c9f4113d1db7d
UTC Build Time: 2017-05-27 08:43:18
```",1, create index using btree failed what did you do if possible provide a recipe for reproducing the error sql create index index ali logs on action type using btree on ali logs action type what did you expect to see what did you see instead it says line column near btree on ali logs action type total length what version of tidb are you using tidb server v git commit hash utc build time ,1
15138,19026934339.0,IssuesEvent,2021-11-24 05:35:51,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,`rand_seed` system variable does not support replication of the RAND() function,type/bug type/compatibility sig/sql-infra severity/moderate,"## Bug Report
In TiDB, rand_seed variables are ignored. The result should always respond 0.02887.
### 1. Minimal reproduce step
Repeat this several times.
```sql
set @@rand_seed1=10000000,@@rand_seed2=1000000;
select ROUND(RAND(),5);
```
### 2. What did you expect to see?
In MySQL
```sql
mysql> set @@rand_seed1=10000000,@@rand_seed2=1000000;
Query OK, 0 rows affected (0.00 sec)
mysql> select ROUND(RAND(),5);
+-----------------+
| ROUND(RAND(),5) |
+-----------------+
| 0.02887 |
+-----------------+
1 row in set (0.00 sec)
mysql> set @@rand_seed1=10000000,@@rand_seed2=1000000;
Query OK, 0 rows affected (0.00 sec)
mysql> select ROUND(RAND(),5);
+-----------------+
| ROUND(RAND(),5) |
+-----------------+
| 0.02887 |
+-----------------+
1 row in set (0.00 sec)
```
### 3. What did you see instead
In TiDB
```sql
mysql> set @@rand_seed1=10000000,@@rand_seed2=1000000;
Query OK, 0 rows affected (0.03 sec)
mysql> select ROUND(RAND(),5);
+-----------------+
| ROUND(RAND(),5) |
+-----------------+
| 0.27441 |
+-----------------+
1 row in set (0.01 sec)
mysql> set @@rand_seed1=10000000,@@rand_seed2=1000000;
Query OK, 0 rows affected (0.00 sec)
mysql> select ROUND(RAND(),5);
+-----------------+
| ROUND(RAND(),5) |
+-----------------+
| 0.34586 |
+-----------------+
1 row in set (0.01 sec)
mysql> show variables like '%rand_seed%';
+---------------+----------+
| Variable_name | Value |
+---------------+----------+
| rand_seed1 | 10000000 |
| rand_seed2 | 1000000 |
+---------------+----------+
2 rows in set (0.00 sec)
```
### 4. What is your TiDB version?
```sql
tidb_version(): Release Version: v5.2.2
Edition: Community
Git Commit Hash: da1c21fd45a4ea5900ac16d2f4a248143f378d18
Git Branch: heads/refs/tags/v5.2.2
UTC Build Time: 2021-10-20 06:03:29
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
```",True,"`rand_seed` system variable does not support replication of the RAND() function - ## Bug Report
In TiDB, rand_seed variables are ignored. The result should always respond 0.02887.
### 1. Minimal reproduce step
Repeat this several times.
```sql
set @@rand_seed1=10000000,@@rand_seed2=1000000;
select ROUND(RAND(),5);
```
### 2. What did you expect to see?
In MySQL
```sql
mysql> set @@rand_seed1=10000000,@@rand_seed2=1000000;
Query OK, 0 rows affected (0.00 sec)
mysql> select ROUND(RAND(),5);
+-----------------+
| ROUND(RAND(),5) |
+-----------------+
| 0.02887 |
+-----------------+
1 row in set (0.00 sec)
mysql> set @@rand_seed1=10000000,@@rand_seed2=1000000;
Query OK, 0 rows affected (0.00 sec)
mysql> select ROUND(RAND(),5);
+-----------------+
| ROUND(RAND(),5) |
+-----------------+
| 0.02887 |
+-----------------+
1 row in set (0.00 sec)
```
### 3. What did you see instead
In TiDB
```sql
mysql> set @@rand_seed1=10000000,@@rand_seed2=1000000;
Query OK, 0 rows affected (0.03 sec)
mysql> select ROUND(RAND(),5);
+-----------------+
| ROUND(RAND(),5) |
+-----------------+
| 0.27441 |
+-----------------+
1 row in set (0.01 sec)
mysql> set @@rand_seed1=10000000,@@rand_seed2=1000000;
Query OK, 0 rows affected (0.00 sec)
mysql> select ROUND(RAND(),5);
+-----------------+
| ROUND(RAND(),5) |
+-----------------+
| 0.34586 |
+-----------------+
1 row in set (0.01 sec)
mysql> show variables like '%rand_seed%';
+---------------+----------+
| Variable_name | Value |
+---------------+----------+
| rand_seed1 | 10000000 |
| rand_seed2 | 1000000 |
+---------------+----------+
2 rows in set (0.00 sec)
```
### 4. What is your TiDB version?
```sql
tidb_version(): Release Version: v5.2.2
Edition: Community
Git Commit Hash: da1c21fd45a4ea5900ac16d2f4a248143f378d18
Git Branch: heads/refs/tags/v5.2.2
UTC Build Time: 2021-10-20 06:03:29
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
```",1, rand seed system variable does not support replication of the rand function bug report in tidb rand seed variables are ignored the result should always respond minimal reproduce step repeat this several times sql set rand rand select round rand what did you expect to see in mysql sql mysql set rand rand query ok rows affected sec mysql select round rand round rand row in set sec mysql set rand rand query ok rows affected sec mysql select round rand round rand row in set sec what did you see instead in tidb sql mysql set rand rand query ok rows affected sec mysql select round rand round rand row in set sec mysql set rand rand query ok rows affected sec mysql select round rand round rand row in set sec mysql show variables like rand seed variable name value rand rand rows in set sec what is your tidb version sql tidb version release version edition community git commit hash git branch heads refs tags utc build time goversion race enabled false tikv min version check table before drop false ,1
6408,8709522594.0,IssuesEvent,2018-12-06 14:12:20,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,show processlist 'mem' column always zero,type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
In TiDB, the `show processlist` command has a column for 'mem'. It is always zero:
```
mysql> show processlist;
+------+------+-----------+------+---------+------+-------+------------------+------+
| Id | User | Host | db | Command | Time | State | Info | Mem |
+------+------+-----------+------+---------+------+-------+------------------+------+
| 1 | root | 127.0.0.1 | test | Query | 0 | 2 | show processlist | 0 |
+------+------+-----------+------+---------+------+-------+------------------+------+
1 row in set (0.00 sec)
```
2. What did you expect to see?
I suggest we remove it, since it is not a MySQL compatibility requirement (MySQL uses performance schema to show memory), and looks bad that it is always zero.
Long term when views exist, it would be nice to add a sys-like feature to TiDB.
3. What did you see instead?
Mem column.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
mysql> SELECT tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v2.1.0-rc.3-241-ge5dc251dd
Git Commit Hash: e5dc251dd3e6826f8c23bef645ea2a3b10a970f7
Git Branch: newmaster
UTC Build Time: 2018-11-27 04:41:52
GoVersion: go version go1.11 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
1 row in set (0.00 sec)
```",True,"show processlist 'mem' column always zero - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
In TiDB, the `show processlist` command has a column for 'mem'. It is always zero:
```
mysql> show processlist;
+------+------+-----------+------+---------+------+-------+------------------+------+
| Id | User | Host | db | Command | Time | State | Info | Mem |
+------+------+-----------+------+---------+------+-------+------------------+------+
| 1 | root | 127.0.0.1 | test | Query | 0 | 2 | show processlist | 0 |
+------+------+-----------+------+---------+------+-------+------------------+------+
1 row in set (0.00 sec)
```
2. What did you expect to see?
I suggest we remove it, since it is not a MySQL compatibility requirement (MySQL uses performance schema to show memory), and looks bad that it is always zero.
Long term when views exist, it would be nice to add a sys-like feature to TiDB.
3. What did you see instead?
Mem column.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
mysql> SELECT tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v2.1.0-rc.3-241-ge5dc251dd
Git Commit Hash: e5dc251dd3e6826f8c23bef645ea2a3b10a970f7
Git Branch: newmaster
UTC Build Time: 2018-11-27 04:41:52
GoVersion: go version go1.11 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
1 row in set (0.00 sec)
```",1,show processlist mem column always zero bug report please answer these questions before submitting your issue thanks what did you do in tidb the show processlist command has a column for mem it is always zero mysql show processlist id user host db command time state info mem root test query show processlist row in set sec what did you expect to see i suggest we remove it since it is not a mysql compatibility requirement mysql uses performance schema to show memory and looks bad that it is always zero long term when views exist it would be nice to add a sys like feature to tidb what did you see instead mem column what version of tidb are you using tidb server v or run select tidb version on tidb mysql select tidb version g row tidb version release version rc git commit hash git branch newmaster utc build time goversion go version linux race enabled false tikv min version alpha check table before drop false row in set sec ,1
13293,15683544813.0,IssuesEvent,2021-03-25 08:55:14,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,count() is incompatible with mysql and tidb,type/bug type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```mysql
CREATE TABLE `t1` (
`COL1` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
insert into t1 values(""tidb"");
```
### 2. What did you expect to see? (Required)
```mysql
mysql:
mysql> select col1 from t1 group by col1 having count(col1) = ""1e64"";
Empty set
```
### 3. What did you see instead (Required)
```mysql
tidb:
mysql> select col1 from t1 group by col1 having count(col1) = ""1e20"";
Empty set
mysql> select col1 from t1 group by col1 having count(col1) = ""1e64"";
+------+
| col1 |
+------+
| tidb |
+------+
1 row in set (0.59 sec)
```
### 4. What is your TiDB version? (Required)
```mysql
Release Version: v4.0.0-beta.2-2444-g5715eefd2-dirty
Edition: Community
Git Commit Hash: 5715eefd2b2febdd6e3b64413bb066f4d425a3dc
Git Branch: master
UTC Build Time: 2021-03-24 14:28:28
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
```
",True,"count() is incompatible with mysql and tidb - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```mysql
CREATE TABLE `t1` (
`COL1` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
insert into t1 values(""tidb"");
```
### 2. What did you expect to see? (Required)
```mysql
mysql:
mysql> select col1 from t1 group by col1 having count(col1) = ""1e64"";
Empty set
```
### 3. What did you see instead (Required)
```mysql
tidb:
mysql> select col1 from t1 group by col1 having count(col1) = ""1e20"";
Empty set
mysql> select col1 from t1 group by col1 having count(col1) = ""1e64"";
+------+
| col1 |
+------+
| tidb |
+------+
1 row in set (0.59 sec)
```
### 4. What is your TiDB version? (Required)
```mysql
Release Version: v4.0.0-beta.2-2444-g5715eefd2-dirty
Edition: Community
Git Commit Hash: 5715eefd2b2febdd6e3b64413bb066f4d425a3dc
Git Branch: master
UTC Build Time: 2021-03-24 14:28:28
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
```
",1,count is incompatible with mysql and tidb bug report please answer these questions before submitting your issue thanks minimal reproduce step required mysql create table varchar character set collate general ci not null engine innodb character set collate general ci row format dynamic insert into values tidb what did you expect to see required mysql mysql mysql select from group by having count empty set what did you see instead required mysql tidb mysql select from group by having count empty set mysql select from group by having count tidb row in set sec what is your tidb version required mysql release version beta dirty edition community git commit hash git branch master utc build time goversion race enabled false tikv min version check table before drop false ,1
7751,9983037801.0,IssuesEvent,2019-07-10 11:23:03,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,Function SUBTIME should return NULL with a warning if its argument is an invalid time value.,type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```mysql
SELECT SUBTIME(-32073, 0);
SELECT SUBTIME(0, -32073);
```
2. What did you expect to see?
In MySQL 5.7 and MySQL 8.0,
```mysql
mysql> SELECT SUBTIME(-32073, 0); show warnings;
+--------------------+
| SUBTIME(-32073, 0) |
+--------------------+
| NULL |
+--------------------+
1 row in set, 1 warning (0.00 sec)
+---------+------+------------------------------------------+
| Level | Code | Message |
+---------+------+------------------------------------------+
| Warning | 1292 | Truncated incorrect time value: '-32073' |
+---------+------+------------------------------------------+
1 row in set (0.00 sec)
mysql> SELECT SUBTIME(0, -32073); show warnings;
+--------------------+
| SUBTIME(0, -32073) |
+--------------------+
| NULL |
+--------------------+
1 row in set, 1 warning (0.00 sec)
+---------+------+------------------------------------------+
| Level | Code | Message |
+---------+------+------------------------------------------+
| Warning | 1292 | Truncated incorrect time value: '-32073' |
+---------+------+------------------------------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
In TiDB,
```mysql
mysql> SELECT SUBTIME(-32073, 0);
ERROR 1292 (22007): Truncated incorrect time value: '-32073'
mysql> SELECT SUBTIME(0, -32073);
ERROR 1292 (22007): Truncated incorrect time value: '-32073'
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
fdbc149b72db7034d024acf1209e455c0ad4ca9d",True,"Function SUBTIME should return NULL with a warning if its argument is an invalid time value. - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```mysql
SELECT SUBTIME(-32073, 0);
SELECT SUBTIME(0, -32073);
```
2. What did you expect to see?
In MySQL 5.7 and MySQL 8.0,
```mysql
mysql> SELECT SUBTIME(-32073, 0); show warnings;
+--------------------+
| SUBTIME(-32073, 0) |
+--------------------+
| NULL |
+--------------------+
1 row in set, 1 warning (0.00 sec)
+---------+------+------------------------------------------+
| Level | Code | Message |
+---------+------+------------------------------------------+
| Warning | 1292 | Truncated incorrect time value: '-32073' |
+---------+------+------------------------------------------+
1 row in set (0.00 sec)
mysql> SELECT SUBTIME(0, -32073); show warnings;
+--------------------+
| SUBTIME(0, -32073) |
+--------------------+
| NULL |
+--------------------+
1 row in set, 1 warning (0.00 sec)
+---------+------+------------------------------------------+
| Level | Code | Message |
+---------+------+------------------------------------------+
| Warning | 1292 | Truncated incorrect time value: '-32073' |
+---------+------+------------------------------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
In TiDB,
```mysql
mysql> SELECT SUBTIME(-32073, 0);
ERROR 1292 (22007): Truncated incorrect time value: '-32073'
mysql> SELECT SUBTIME(0, -32073);
ERROR 1292 (22007): Truncated incorrect time value: '-32073'
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
fdbc149b72db7034d024acf1209e455c0ad4ca9d",1,function subtime should return null with a warning if its argument is an invalid time value bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error mysql select subtime select subtime what did you expect to see in mysql and mysql mysql mysql select subtime show warnings subtime null row in set warning sec level code message warning truncated incorrect time value row in set sec mysql select subtime show warnings subtime null row in set warning sec level code message warning truncated incorrect time value row in set sec what did you see instead in tidb mysql mysql select subtime error truncated incorrect time value mysql select subtime error truncated incorrect time value what version of tidb are you using tidb server v or run select tidb version on tidb ,1
16214,21768030594.0,IssuesEvent,2022-05-13 05:48:33,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,SET SESSION TRANSACTION READ ONLY return error,type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```sql
mysql>SET SESSION TRANSACTION READ ONLY;
(1235, 'function READ ONLY has only noop implementation in tidb now, use tidb_enable_noop_functions to enable these functions')
```
### 2. What did you expect to see? (Required)
```sql
mysql>SET SESSION TRANSACTION READ ONLY;
Query OK, 0 rows affected
```
### 3. What did you see instead (Required)
Execute error.
### 4. What is your TiDB version? (Required)
```sql
***************************[ 1. row ]***************************
tidb_version() | Release Version: v6.1.0-alpha-398-g0703a64f76
Edition: Community
Git Commit Hash: 0703a64f76baf8f79126ee45780310737f55df0b
Git Branch: master
UTC Build Time: 2022-05-13 05:38:58
GoVersion: go1.18
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
```
#### Reason
Since we not support read-only transcation now, so https://github.com/pingcap/tidb/pull/23818 protect read only noop via tidb_enable_noop_functions. But it breaks the compatibility with MySQL.
",True,"SET SESSION TRANSACTION READ ONLY return error - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```sql
mysql>SET SESSION TRANSACTION READ ONLY;
(1235, 'function READ ONLY has only noop implementation in tidb now, use tidb_enable_noop_functions to enable these functions')
```
### 2. What did you expect to see? (Required)
```sql
mysql>SET SESSION TRANSACTION READ ONLY;
Query OK, 0 rows affected
```
### 3. What did you see instead (Required)
Execute error.
### 4. What is your TiDB version? (Required)
```sql
***************************[ 1. row ]***************************
tidb_version() | Release Version: v6.1.0-alpha-398-g0703a64f76
Edition: Community
Git Commit Hash: 0703a64f76baf8f79126ee45780310737f55df0b
Git Branch: master
UTC Build Time: 2022-05-13 05:38:58
GoVersion: go1.18
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
```
#### Reason
Since we not support read-only transcation now, so https://github.com/pingcap/tidb/pull/23818 protect read only noop via tidb_enable_noop_functions. But it breaks the compatibility with MySQL.
",1,set session transaction read only return error bug report please answer these questions before submitting your issue thanks minimal reproduce step required sql mysql set session transaction read only function read only has only noop implementation in tidb now use tidb enable noop functions to enable these functions what did you expect to see required sql mysql set session transaction read only query ok rows affected what did you see instead required execute error what is your tidb version required sql tidb version release version alpha edition community git commit hash git branch master utc build time goversion race enabled false tikv min version check table before drop false reason since we not support read only transcation now so protect read only noop via tidb enable noop functions but it breaks the compatibility with mysql ,1
7072,9359139000.0,IssuesEvent,2019-04-02 05:45:06,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Function `dayname` is incompatible with Mysql,type/bug type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
select dayname(""1962-03-01"")+0;
select dayname(""1962-03-02"")+0;
select dayname(""1962-03-03"")+0;
select dayname(""1962-03-04"")+0;
select dayname(""1962-03-05"")+0;
select dayname(""1962-03-06"")+0;
select dayname(""1962-03-07"")+0;
select dayname(""1962-03-08"")+0;
select dayname(""1962-03-01"")+1;
select dayname(""1962-03-01"")+2;
select dayname(""1962-03-01"")+3;
select dayname(""1962-03-01"")+4;
select dayname(""1962-03-01"")+5;
select dayname(""1962-03-01"")+6;
select dayname(""1962-03-01"")+7;
select dayname(""1962-03-01"")+2333;
select dayname(""1962-03-01"")+2.333;
select dayname(""1962-03-01"")>2;
select dayname(""1962-03-01"")<2;
select dayname(""1962-03-01"")=3;
select dayname(""1962-03-01"")!=3;
select dayname(""1962-03-01"")<4;
select dayname(""1962-03-01"")>4;
select !dayname(""1962-03-01"");
select dayname(""1962-03-01"")&1;
select dayname(""1962-03-01"")&3;
select dayname(""1962-03-01"")&7;
select dayname(""1962-03-01"")|1;
select dayname(""1962-03-01"")|3;
select dayname(""1962-03-01"")|7;
select dayname(""1962-03-01"")^1;
select dayname(""1962-03-01"")^3;
select dayname(""1962-03-01"")^7;
```
2. What did you expect to see?
```
mysql> select dayname(""1962-03-01"")+0;
+-------------------------+
| dayname(""1962-03-01"")+0 |
+-------------------------+
| 3 |
+-------------------------+
1 row in set (0.00 sec)
mysql> select dayname(""1962-03-02"")+0;
+-------------------------+
| dayname(""1962-03-02"")+0 |
+-------------------------+
| 4 |
+-------------------------+
1 row in set (0.00 sec)
mysql> select dayname(""1962-03-03"")+0;
+-------------------------+
| dayname(""1962-03-03"")+0 |
+-------------------------+
| 5 |
+-------------------------+
1 row in set (0.00 sec)
mysql> select dayname(""1962-03-04"")+0;
+-------------------------+
| dayname(""1962-03-04"")+0 |
+-------------------------+
| 6 |
+-------------------------+
1 row in set (0.00 sec)
mysql> select dayname(""1962-03-05"")+0;
+-------------------------+
| dayname(""1962-03-05"")+0 |
+-------------------------+
| 0 |
+-------------------------+
1 row in set (0.00 sec)
mysql> select dayname(""1962-03-06"")+0;
+-------------------------+
| dayname(""1962-03-06"")+0 |
+-------------------------+
| 1 |
+-------------------------+
1 row in set (0.00 sec)
mysql> select dayname(""1962-03-07"")+0;
+-------------------------+
| dayname(""1962-03-07"")+0 |
+-------------------------+
| 2 |
+-------------------------+
1 row in set (0.00 sec)
mysql> select dayname(""1962-03-08"")+0;
+-------------------------+
| dayname(""1962-03-08"")+0 |
+-------------------------+
| 3 |
+-------------------------+
1 row in set (0.00 sec)
mysql> select dayname(""1962-03-01"")+1;
+-------------------------+
| dayname(""1962-03-01"")+1 |
+-------------------------+
| 4 |
+-------------------------+
1 row in set (0.00 sec)
mysql> select dayname(""1962-03-01"")+2;
+-------------------------+
| dayname(""1962-03-01"")+2 |
+-------------------------+
| 5 |
+-------------------------+
1 row in set (0.00 sec)
mysql> select dayname(""1962-03-01"")+3;
+-------------------------+
| dayname(""1962-03-01"")+3 |
+-------------------------+
| 6 |
+-------------------------+
1 row in set (0.00 sec)
mysql> select dayname(""1962-03-01"")+4;
+-------------------------+
| dayname(""1962-03-01"")+4 |
+-------------------------+
| 7 |
+-------------------------+
1 row in set (0.00 sec)
mysql> select dayname(""1962-03-01"")+5;
+-------------------------+
| dayname(""1962-03-01"")+5 |
+-------------------------+
| 8 |
+-------------------------+
1 row in set (0.00 sec)
mysql> select dayname(""1962-03-01"")+6;
+-------------------------+
| dayname(""1962-03-01"")+6 |
+-------------------------+
| 9 |
+-------------------------+
1 row in set (0.00 sec)
mysql> select dayname(""1962-03-01"")+7;
+-------------------------+
| dayname(""1962-03-01"")+7 |
+-------------------------+
| 10 |
+-------------------------+
1 row in set (0.00 sec)
mysql> select dayname(""1962-03-01"")+2333;
+----------------------------+
| dayname(""1962-03-01"")+2333 |
+----------------------------+
| 2336 |
+----------------------------+
1 row in set (0.00 sec)
mysql> select dayname(""1962-03-01"")+2.333;
+-----------------------------+
| dayname(""1962-03-01"")+2.333 |
+-----------------------------+
| 5.333 |
+-----------------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
In TiDB
```
mysql> select dayname(""1962-03-01"")+0;
+-------------------------+
| dayname(""1962-03-01"")+0 |
+-------------------------+
| 0 |
+-------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> select dayname(""1962-03-02"")+0;
+-------------------------+
| dayname(""1962-03-02"")+0 |
+-------------------------+
| 0 |
+-------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> select dayname(""1962-03-03"")+0;
+-------------------------+
| dayname(""1962-03-03"")+0 |
+-------------------------+
| 0 |
+-------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> select dayname(""1962-03-04"")+0;
+-------------------------+
| dayname(""1962-03-04"")+0 |
+-------------------------+
| 0 |
+-------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> select dayname(""1962-03-05"")+0;
+-------------------------+
| dayname(""1962-03-05"")+0 |
+-------------------------+
| 0 |
+-------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> select dayname(""1962-03-06"")+0;
+-------------------------+
| dayname(""1962-03-06"")+0 |
+-------------------------+
| 0 |
+-------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> select dayname(""1962-03-07"")+0;
+-------------------------+
| dayname(""1962-03-07"")+0 |
+-------------------------+
| 0 |
+-------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> select dayname(""1962-03-08"")+0;
+-------------------------+
| dayname(""1962-03-08"")+0 |
+-------------------------+
| 0 |
+-------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> select dayname(""1962-03-01"")+1;
+-------------------------+
| dayname(""1962-03-01"")+1 |
+-------------------------+
| 1 |
+-------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> select dayname(""1962-03-01"")+2;
+-------------------------+
| dayname(""1962-03-01"")+2 |
+-------------------------+
| 2 |
+-------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> select dayname(""1962-03-01"")+3;
+-------------------------+
| dayname(""1962-03-01"")+3 |
+-------------------------+
| 3 |
+-------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> select dayname(""1962-03-01"")+4;
+-------------------------+
| dayname(""1962-03-01"")+4 |
+-------------------------+
| 4 |
+-------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> select dayname(""1962-03-01"")+5;
+-------------------------+
| dayname(""1962-03-01"")+5 |
+-------------------------+
| 5 |
+-------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> select dayname(""1962-03-01"")+6;
+-------------------------+
| dayname(""1962-03-01"")+6 |
+-------------------------+
| 6 |
+-------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> select dayname(""1962-03-01"")+7;
+-------------------------+
| dayname(""1962-03-01"")+7 |
+-------------------------+
| 7 |
+-------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> select dayname(""1962-03-01"")+2333;
+----------------------------+
| dayname(""1962-03-01"")+2333 |
+----------------------------+
| 2333 |
+----------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> select dayname(""1962-03-01"")+2.333;
+-----------------------------+
| dayname(""1962-03-01"")+2.333 |
+-----------------------------+
| 2.333 |
+-----------------------------+
1 row in set, 1 warning (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v3.0.0-beta-212-g0681b8125
Git Commit Hash: 0681b8125080045ee0d4747ce61923164c6f2dd1
Git Branch: master
UTC Build Time: 2019-03-14 04:39:19
GoVersion: go version go1.12 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
",True,"Function `dayname` is incompatible with Mysql - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
select dayname(""1962-03-01"")+0;
select dayname(""1962-03-02"")+0;
select dayname(""1962-03-03"")+0;
select dayname(""1962-03-04"")+0;
select dayname(""1962-03-05"")+0;
select dayname(""1962-03-06"")+0;
select dayname(""1962-03-07"")+0;
select dayname(""1962-03-08"")+0;
select dayname(""1962-03-01"")+1;
select dayname(""1962-03-01"")+2;
select dayname(""1962-03-01"")+3;
select dayname(""1962-03-01"")+4;
select dayname(""1962-03-01"")+5;
select dayname(""1962-03-01"")+6;
select dayname(""1962-03-01"")+7;
select dayname(""1962-03-01"")+2333;
select dayname(""1962-03-01"")+2.333;
select dayname(""1962-03-01"")>2;
select dayname(""1962-03-01"")<2;
select dayname(""1962-03-01"")=3;
select dayname(""1962-03-01"")!=3;
select dayname(""1962-03-01"")<4;
select dayname(""1962-03-01"")>4;
select !dayname(""1962-03-01"");
select dayname(""1962-03-01"")&1;
select dayname(""1962-03-01"")&3;
select dayname(""1962-03-01"")&7;
select dayname(""1962-03-01"")|1;
select dayname(""1962-03-01"")|3;
select dayname(""1962-03-01"")|7;
select dayname(""1962-03-01"")^1;
select dayname(""1962-03-01"")^3;
select dayname(""1962-03-01"")^7;
```
2. What did you expect to see?
```
mysql> select dayname(""1962-03-01"")+0;
+-------------------------+
| dayname(""1962-03-01"")+0 |
+-------------------------+
| 3 |
+-------------------------+
1 row in set (0.00 sec)
mysql> select dayname(""1962-03-02"")+0;
+-------------------------+
| dayname(""1962-03-02"")+0 |
+-------------------------+
| 4 |
+-------------------------+
1 row in set (0.00 sec)
mysql> select dayname(""1962-03-03"")+0;
+-------------------------+
| dayname(""1962-03-03"")+0 |
+-------------------------+
| 5 |
+-------------------------+
1 row in set (0.00 sec)
mysql> select dayname(""1962-03-04"")+0;
+-------------------------+
| dayname(""1962-03-04"")+0 |
+-------------------------+
| 6 |
+-------------------------+
1 row in set (0.00 sec)
mysql> select dayname(""1962-03-05"")+0;
+-------------------------+
| dayname(""1962-03-05"")+0 |
+-------------------------+
| 0 |
+-------------------------+
1 row in set (0.00 sec)
mysql> select dayname(""1962-03-06"")+0;
+-------------------------+
| dayname(""1962-03-06"")+0 |
+-------------------------+
| 1 |
+-------------------------+
1 row in set (0.00 sec)
mysql> select dayname(""1962-03-07"")+0;
+-------------------------+
| dayname(""1962-03-07"")+0 |
+-------------------------+
| 2 |
+-------------------------+
1 row in set (0.00 sec)
mysql> select dayname(""1962-03-08"")+0;
+-------------------------+
| dayname(""1962-03-08"")+0 |
+-------------------------+
| 3 |
+-------------------------+
1 row in set (0.00 sec)
mysql> select dayname(""1962-03-01"")+1;
+-------------------------+
| dayname(""1962-03-01"")+1 |
+-------------------------+
| 4 |
+-------------------------+
1 row in set (0.00 sec)
mysql> select dayname(""1962-03-01"")+2;
+-------------------------+
| dayname(""1962-03-01"")+2 |
+-------------------------+
| 5 |
+-------------------------+
1 row in set (0.00 sec)
mysql> select dayname(""1962-03-01"")+3;
+-------------------------+
| dayname(""1962-03-01"")+3 |
+-------------------------+
| 6 |
+-------------------------+
1 row in set (0.00 sec)
mysql> select dayname(""1962-03-01"")+4;
+-------------------------+
| dayname(""1962-03-01"")+4 |
+-------------------------+
| 7 |
+-------------------------+
1 row in set (0.00 sec)
mysql> select dayname(""1962-03-01"")+5;
+-------------------------+
| dayname(""1962-03-01"")+5 |
+-------------------------+
| 8 |
+-------------------------+
1 row in set (0.00 sec)
mysql> select dayname(""1962-03-01"")+6;
+-------------------------+
| dayname(""1962-03-01"")+6 |
+-------------------------+
| 9 |
+-------------------------+
1 row in set (0.00 sec)
mysql> select dayname(""1962-03-01"")+7;
+-------------------------+
| dayname(""1962-03-01"")+7 |
+-------------------------+
| 10 |
+-------------------------+
1 row in set (0.00 sec)
mysql> select dayname(""1962-03-01"")+2333;
+----------------------------+
| dayname(""1962-03-01"")+2333 |
+----------------------------+
| 2336 |
+----------------------------+
1 row in set (0.00 sec)
mysql> select dayname(""1962-03-01"")+2.333;
+-----------------------------+
| dayname(""1962-03-01"")+2.333 |
+-----------------------------+
| 5.333 |
+-----------------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
In TiDB
```
mysql> select dayname(""1962-03-01"")+0;
+-------------------------+
| dayname(""1962-03-01"")+0 |
+-------------------------+
| 0 |
+-------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> select dayname(""1962-03-02"")+0;
+-------------------------+
| dayname(""1962-03-02"")+0 |
+-------------------------+
| 0 |
+-------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> select dayname(""1962-03-03"")+0;
+-------------------------+
| dayname(""1962-03-03"")+0 |
+-------------------------+
| 0 |
+-------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> select dayname(""1962-03-04"")+0;
+-------------------------+
| dayname(""1962-03-04"")+0 |
+-------------------------+
| 0 |
+-------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> select dayname(""1962-03-05"")+0;
+-------------------------+
| dayname(""1962-03-05"")+0 |
+-------------------------+
| 0 |
+-------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> select dayname(""1962-03-06"")+0;
+-------------------------+
| dayname(""1962-03-06"")+0 |
+-------------------------+
| 0 |
+-------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> select dayname(""1962-03-07"")+0;
+-------------------------+
| dayname(""1962-03-07"")+0 |
+-------------------------+
| 0 |
+-------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> select dayname(""1962-03-08"")+0;
+-------------------------+
| dayname(""1962-03-08"")+0 |
+-------------------------+
| 0 |
+-------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> select dayname(""1962-03-01"")+1;
+-------------------------+
| dayname(""1962-03-01"")+1 |
+-------------------------+
| 1 |
+-------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> select dayname(""1962-03-01"")+2;
+-------------------------+
| dayname(""1962-03-01"")+2 |
+-------------------------+
| 2 |
+-------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> select dayname(""1962-03-01"")+3;
+-------------------------+
| dayname(""1962-03-01"")+3 |
+-------------------------+
| 3 |
+-------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> select dayname(""1962-03-01"")+4;
+-------------------------+
| dayname(""1962-03-01"")+4 |
+-------------------------+
| 4 |
+-------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> select dayname(""1962-03-01"")+5;
+-------------------------+
| dayname(""1962-03-01"")+5 |
+-------------------------+
| 5 |
+-------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> select dayname(""1962-03-01"")+6;
+-------------------------+
| dayname(""1962-03-01"")+6 |
+-------------------------+
| 6 |
+-------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> select dayname(""1962-03-01"")+7;
+-------------------------+
| dayname(""1962-03-01"")+7 |
+-------------------------+
| 7 |
+-------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> select dayname(""1962-03-01"")+2333;
+----------------------------+
| dayname(""1962-03-01"")+2333 |
+----------------------------+
| 2333 |
+----------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> select dayname(""1962-03-01"")+2.333;
+-----------------------------+
| dayname(""1962-03-01"")+2.333 |
+-----------------------------+
| 2.333 |
+-----------------------------+
1 row in set, 1 warning (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v3.0.0-beta-212-g0681b8125
Git Commit Hash: 0681b8125080045ee0d4747ce61923164c6f2dd1
Git Branch: master
UTC Build Time: 2019-03-14 04:39:19
GoVersion: go version go1.12 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
",1,function dayname is incompatible with mysql bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error select dayname select dayname select dayname select dayname select dayname select dayname select dayname select dayname select dayname select dayname select dayname select dayname select dayname select dayname select dayname select dayname select dayname select dayname select dayname select dayname select dayname select dayname select dayname select dayname select dayname select dayname select dayname select dayname select dayname select dayname select dayname select dayname select dayname what did you expect to see mysql select dayname dayname row in set sec mysql select dayname dayname row in set sec mysql select dayname dayname row in set sec mysql select dayname dayname row in set sec mysql select dayname dayname row in set sec mysql select dayname dayname row in set sec mysql select dayname dayname row in set sec mysql select dayname dayname row in set sec mysql select dayname dayname row in set sec mysql select dayname dayname row in set sec mysql select dayname dayname row in set sec mysql select dayname dayname row in set sec mysql select dayname dayname row in set sec mysql select dayname dayname row in set sec mysql select dayname dayname row in set sec mysql select dayname dayname row in set sec mysql select dayname dayname row in set sec what did you see instead in tidb mysql select dayname dayname row in set warning sec mysql select dayname dayname row in set warning sec mysql select dayname dayname row in set warning sec mysql select dayname dayname row in set warning sec mysql select dayname dayname row in set warning sec mysql select dayname dayname row in set warning sec mysql select dayname dayname row in set warning sec mysql select dayname dayname row in set warning sec mysql select dayname dayname row in set warning sec mysql select dayname dayname row in set warning sec mysql select dayname dayname row in set warning sec mysql select dayname dayname row in set warning sec mysql select dayname dayname row in set warning sec mysql select dayname dayname row in set warning sec mysql select dayname dayname row in set warning sec mysql select dayname dayname row in set warning sec mysql select dayname dayname row in set warning sec what version of tidb are you using tidb server v or run select tidb version on tidb tidb version release version beta git commit hash git branch master utc build time goversion go version darwin race enabled false tikv min version alpha check table before drop false row in set sec ,1
6995,9292267154.0,IssuesEvent,2019-03-22 02:17:36,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,ERROR 1105 (HY000): privilege check fail (with GRANT OPTION set),component/privilege type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
user `root`:
```
MySQL [test]> CREATE USER test_test_u1@localhost;
Query OK, 1 row affected (0.009 sec)
MySQL [test]> CREATE DATABASE test_test_db1;
Query OK, 0 rows affected (0.014 sec)
MySQL [test]> CREATE DATABASE test_test_db2;
Query OK, 0 rows affected (0.014 sec)
MySQL [test]> GRANT ALL ON test_test_db1.* TO test_test_u1@localhost WITH GRANT OPTION;
Query OK, 0 rows affected (0.010 sec)
MySQL [test]> CREATE USER test_test_u2@localhost;
Query OK, 1 row affected (0.007 sec)
MySQL [test]> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
MySQL [mysql]> select db;
ERROR 1054 (42S22): Unknown column 'db' in 'field list'
MySQL [mysql]> select * from db;
+-----------+---------------+--------------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----------------+------------+------------+-----------------------+------------------+------------------+----------------+---------------------+--------------------+--------------+------------+--------------+
| Host | DB | User | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Grant_priv | References_priv | Index_priv | Alter_priv | Create_tmp_table_priv | Lock_tables_priv | Create_view_priv | Show_view_priv | Create_routine_priv | Alter_routine_priv | Execute_priv | Event_priv | Trigger_priv |
+-----------+---------------+--------------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----------------+------------+------------+-----------------------+------------------+------------------+----------------+---------------------+--------------------+--------------+------------+--------------+
| localhost | test_test_db1 | test_test_u1 | Y | Y | Y | Y | Y | Y | Y | N | Y | Y | N | N | Y | Y | N | N | Y | N | N |
+-----------+---------------+--------------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----------------+------------+------------+-----------------------+------------------+------------------+----------------+---------------------+--------------------+--------------+------------+--------------+
2 rows in set (0.002 sec)
MySQL [mysql]>
```
user `test_test_u1`
```
MySQL [(none)]> use test_test_db1
Database changed
MySQL [test_test_db1]> GRANT SELECT ON v1 TO test_test_u2@localhost;
ERROR 1105 (HY000): privilege check fail
MySQL [test_test_db1]> GRANT SELECT ON t2 TO test_test_u2@localhost;
ERROR 1105 (HY000): privilege check fail
MySQL [test_test_db1]>
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
`Server version: 5.7.25-TiDB-v3.0.0-beta-231-g20463d6da-dirty`",True,"ERROR 1105 (HY000): privilege check fail (with GRANT OPTION set) - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
user `root`:
```
MySQL [test]> CREATE USER test_test_u1@localhost;
Query OK, 1 row affected (0.009 sec)
MySQL [test]> CREATE DATABASE test_test_db1;
Query OK, 0 rows affected (0.014 sec)
MySQL [test]> CREATE DATABASE test_test_db2;
Query OK, 0 rows affected (0.014 sec)
MySQL [test]> GRANT ALL ON test_test_db1.* TO test_test_u1@localhost WITH GRANT OPTION;
Query OK, 0 rows affected (0.010 sec)
MySQL [test]> CREATE USER test_test_u2@localhost;
Query OK, 1 row affected (0.007 sec)
MySQL [test]> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
MySQL [mysql]> select db;
ERROR 1054 (42S22): Unknown column 'db' in 'field list'
MySQL [mysql]> select * from db;
+-----------+---------------+--------------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----------------+------------+------------+-----------------------+------------------+------------------+----------------+---------------------+--------------------+--------------+------------+--------------+
| Host | DB | User | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Grant_priv | References_priv | Index_priv | Alter_priv | Create_tmp_table_priv | Lock_tables_priv | Create_view_priv | Show_view_priv | Create_routine_priv | Alter_routine_priv | Execute_priv | Event_priv | Trigger_priv |
+-----------+---------------+--------------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----------------+------------+------------+-----------------------+------------------+------------------+----------------+---------------------+--------------------+--------------+------------+--------------+
| localhost | test_test_db1 | test_test_u1 | Y | Y | Y | Y | Y | Y | Y | N | Y | Y | N | N | Y | Y | N | N | Y | N | N |
+-----------+---------------+--------------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----------------+------------+------------+-----------------------+------------------+------------------+----------------+---------------------+--------------------+--------------+------------+--------------+
2 rows in set (0.002 sec)
MySQL [mysql]>
```
user `test_test_u1`
```
MySQL [(none)]> use test_test_db1
Database changed
MySQL [test_test_db1]> GRANT SELECT ON v1 TO test_test_u2@localhost;
ERROR 1105 (HY000): privilege check fail
MySQL [test_test_db1]> GRANT SELECT ON t2 TO test_test_u2@localhost;
ERROR 1105 (HY000): privilege check fail
MySQL [test_test_db1]>
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
`Server version: 5.7.25-TiDB-v3.0.0-beta-231-g20463d6da-dirty`",1,error privilege check fail with grant option set bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error user root mysql create user test test localhost query ok row affected sec mysql create database test test query ok rows affected sec mysql create database test test query ok rows affected sec mysql grant all on test test to test test localhost with grant option query ok rows affected sec mysql create user test test localhost query ok row affected sec mysql use mysql reading table information for completion of table and column names you can turn off this feature to get a quicker startup with a database changed mysql select db error unknown column db in field list mysql select from db host db user select priv insert priv update priv delete priv create priv drop priv grant priv references priv index priv alter priv create tmp table priv lock tables priv create view priv show view priv create routine priv alter routine priv execute priv event priv trigger priv localhost test test test test y y y y y y y n y y n n y y n n y n n rows in set sec mysql user test test mysql use test test database changed mysql grant select on to test test localhost error privilege check fail mysql grant select on to test test localhost error privilege check fail mysql what version of tidb are you using tidb server v or run select tidb version on tidb server version tidb beta dirty ,1
7954,10135099629.0,IssuesEvent,2019-08-02 09:17:59,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,union result is not same as mysql ,type/bug type/compatibility,"## Bug Report
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
create table t(a int);
create table s(a int unsigned);
insert into t value(-1);
insert into s value(1);
```
2. What did you expect to see?
```
select * from t union all select * from s;
+------+
| a |
+------+
| -1 |
| 1 |
+------+
select * from s union all select * from t;
+------+
| a |
+------+
| -1 |
| 1 |
+------+
```
3. What did you see instead?
```
select * from t union all select * from s;
+------+
| a |
+------+
| -1 |
| 1 |
+------+
select * from s union all select * from t;
+------+
| a |
+------+
| 0 |
| 1 |
+------+
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
Release Version: v4.0.0-alpha-15-gd2b538718
Git Commit Hash: d2b5387183a591847f952aa4e3a3c4597c34dcba
Git Branch: HEAD
UTC Build Time: 2019-08-02 08:50:35
GoVersion: go version go1.12.6 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
```
```
mysqld Ver 8.0.13 for linux-glibc2.12 on x86_64 (MySQL Community Server - GPL)
````
5. relate issue
https://github.com/pingcap/tidb/issues/7075
",True,"union result is not same as mysql - ## Bug Report
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
create table t(a int);
create table s(a int unsigned);
insert into t value(-1);
insert into s value(1);
```
2. What did you expect to see?
```
select * from t union all select * from s;
+------+
| a |
+------+
| -1 |
| 1 |
+------+
select * from s union all select * from t;
+------+
| a |
+------+
| -1 |
| 1 |
+------+
```
3. What did you see instead?
```
select * from t union all select * from s;
+------+
| a |
+------+
| -1 |
| 1 |
+------+
select * from s union all select * from t;
+------+
| a |
+------+
| 0 |
| 1 |
+------+
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
Release Version: v4.0.0-alpha-15-gd2b538718
Git Commit Hash: d2b5387183a591847f952aa4e3a3c4597c34dcba
Git Branch: HEAD
UTC Build Time: 2019-08-02 08:50:35
GoVersion: go version go1.12.6 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
```
```
mysqld Ver 8.0.13 for linux-glibc2.12 on x86_64 (MySQL Community Server - GPL)
````
5. relate issue
https://github.com/pingcap/tidb/issues/7075
",1,union result is not same as mysql bug report what did you do if possible provide a recipe for reproducing the error sql create table t a int create table s a int unsigned insert into t value insert into s value what did you expect to see select from t union all select from s a select from s union all select from t a what did you see instead select from t union all select from s a select from s union all select from t a what version of tidb are you using tidb server v or run select tidb version on tidb release version alpha git commit hash git branch head utc build time goversion go version linux race enabled false tikv min version alpha check table before drop false mysqld ver for linux on mysql community server gpl relate issue ,1
11028,13065141780.0,IssuesEvent,2020-07-30 19:17:43,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,grant privilege for database with certain option is not valid,component/privilege status/help-wanted type/compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
when i use dts to transfer data from rds to local tidb, it need to check privileges; and the following grant command is valid in mysql, but invalid in tidb.
2. What did you expect to see?
```
// in mysql
mysql> grant ALTER,DELETE,CREATE,TRIGGER,CREATE ROUTINE,INSERT,INDEX,CREATE VIEW,SELECT on `12345-datavisualization`.* TO 'root'@'%';
Query OK, 0 rows affected (0.07 秒)
```
3. What did you see instead?
```
// in tidb
mysql> grant ALTER,DELETE,CREATE,TRIGGER,CREATE ROUTINE,INSERT,INDEX,CREATE VIEW,SELECT on `12345-datavisualization`.* TO 'root'@'%';
ERROR 1105 (HY000): line 0 column 48 near "",INSERT,INDEX,CREATE VIEW,SELECT on `12345-datavisualization`.* TO 'root'@'%'"" (total length 125)
```
4. What version of TiDB are you using (`tidb-server -V`)?
Git Commit Hash: 18f84dd3c673616c1edd546002ecbfb3dd324a20
UTC Build Time: 2017-08-08 02:32:12
",True,"grant privilege for database with certain option is not valid - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
when i use dts to transfer data from rds to local tidb, it need to check privileges; and the following grant command is valid in mysql, but invalid in tidb.
2. What did you expect to see?
```
// in mysql
mysql> grant ALTER,DELETE,CREATE,TRIGGER,CREATE ROUTINE,INSERT,INDEX,CREATE VIEW,SELECT on `12345-datavisualization`.* TO 'root'@'%';
Query OK, 0 rows affected (0.07 秒)
```
3. What did you see instead?
```
// in tidb
mysql> grant ALTER,DELETE,CREATE,TRIGGER,CREATE ROUTINE,INSERT,INDEX,CREATE VIEW,SELECT on `12345-datavisualization`.* TO 'root'@'%';
ERROR 1105 (HY000): line 0 column 48 near "",INSERT,INDEX,CREATE VIEW,SELECT on `12345-datavisualization`.* TO 'root'@'%'"" (total length 125)
```
4. What version of TiDB are you using (`tidb-server -V`)?
Git Commit Hash: 18f84dd3c673616c1edd546002ecbfb3dd324a20
UTC Build Time: 2017-08-08 02:32:12
",1,grant privilege for database with certain option is not valid please answer these questions before submitting your issue thanks what did you do when i use dts to transfer data from rds to local tidb it need to check privileges and the following grant command is valid in mysql but invalid in tidb what did you expect to see in mysql mysql grant alter delete create trigger create routine insert index create view select on datavisualization to root query ok rows affected 秒 what did you see instead in tidb mysql grant alter delete create trigger create routine insert index create view select on datavisualization to root error line column near insert index create view select on datavisualization to root total length what version of tidb are you using tidb server v git commit hash utc build time ,1
8816,10764654481.0,IssuesEvent,2019-11-01 08:56:17,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,Support use `on duplicate key update b=default` in generated columns,type/bug type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
mysql> create table t1 (a int unique,
-> b int generated always as (-a) virtual,
-> c int generated always as (-a) stored);
Query OK, 0 rows affected (0.01 sec)
mysql> insert into t1 values (1,default,default);
Query OK, 1 row affected (0.01 sec)
mysql> insert into t1 values (1,default,default)
-> on duplicate key update a=2, b=default;
```
2. What did you expect to see?
```
ERROR 3105 (HY000): The value specified for generated column 'b' in table 't1' is not allowed.
```
3. What did you see instead?
```
Query OK, 1 row affected (0.01 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
Release Version: v4.0.0-alpha-693-gada724a2a
```
",True,"Support use `on duplicate key update b=default` in generated columns - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
mysql> create table t1 (a int unique,
-> b int generated always as (-a) virtual,
-> c int generated always as (-a) stored);
Query OK, 0 rows affected (0.01 sec)
mysql> insert into t1 values (1,default,default);
Query OK, 1 row affected (0.01 sec)
mysql> insert into t1 values (1,default,default)
-> on duplicate key update a=2, b=default;
```
2. What did you expect to see?
```
ERROR 3105 (HY000): The value specified for generated column 'b' in table 't1' is not allowed.
```
3. What did you see instead?
```
Query OK, 1 row affected (0.01 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
Release Version: v4.0.0-alpha-693-gada724a2a
```
",1,support use on duplicate key update b default in generated columns bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error mysql create table a int unique b int generated always as a virtual c int generated always as a stored query ok rows affected sec mysql insert into values default default query ok row affected sec mysql insert into values default default on duplicate key update a b default what did you expect to see error the value specified for generated column b in table is not allowed what did you see instead query ok row affected sec what version of tidb are you using tidb server v or run select tidb version on tidb release version alpha ,1
7028,9305281659.0,IssuesEvent,2019-03-25 05:47:18,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,`TIME_FORMAT` is not compatible with MySQL,for new contributors help wanted type/bug type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
SELECT TIME_FORMAT(""24:00:00"", '%r');
SELECT TIME_FORMAT(""25:00:00"", '%r');
SELECT TIME_FORMAT(""24:00:00"", '%l %p');
```
2. What did you expect to see?
In Mysql
```
mysql> SELECT TIME_FORMAT(""24:00:00"", '%r');
+-------------------------------+
| TIME_FORMAT(""24:00:00"", '%r') |
+-------------------------------+
| 12:00:00 AM |
+-------------------------------+
1 row in set (0.00 sec)
mysql> SELECT TIME_FORMAT(""25:00:00"", '%r');
+-------------------------------+
| TIME_FORMAT(""25:00:00"", '%r') |
+-------------------------------+
| 01:00:00 AM |
+-------------------------------+
1 row in set (0.00 sec)
mysql> SELECT TIME_FORMAT(""24:00:00"", '%l %p');
+----------------------------------+
| TIME_FORMAT(""24:00:00"", '%l %p') |
+----------------------------------+
| 12 AM |
+----------------------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
In TiDB
```
mysql> SELECT TIME_FORMAT(""24:00:00"", '%r');
+-------------------------------+
| TIME_FORMAT(""24:00:00"", '%r') |
+-------------------------------+
| 12:00:00 PM |
+-------------------------------+
1 row in set (0.00 sec)
mysql> SELECT TIME_FORMAT(""25:00:00"", '%r');
+-------------------------------+
| TIME_FORMAT(""25:00:00"", '%r') |
+-------------------------------+
| 13:00:00 PM |
+-------------------------------+
1 row in set (0.00 sec)
mysql> SELECT TIME_FORMAT(""24:00:00"", '%l %p');
+----------------------------------+
| TIME_FORMAT(""24:00:00"", '%l %p') |
+----------------------------------+
| 0 AM |
+----------------------------------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v3.0.0-beta-227-g06183393e-dirty
Git Commit Hash: 06183393ed536aa248248b72d4bf9f5010947f66
Git Branch: master
UTC Build Time: 2019-03-15 08:22:53
GoVersion: go version go1.12 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
```
",True,"`TIME_FORMAT` is not compatible with MySQL - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
SELECT TIME_FORMAT(""24:00:00"", '%r');
SELECT TIME_FORMAT(""25:00:00"", '%r');
SELECT TIME_FORMAT(""24:00:00"", '%l %p');
```
2. What did you expect to see?
In Mysql
```
mysql> SELECT TIME_FORMAT(""24:00:00"", '%r');
+-------------------------------+
| TIME_FORMAT(""24:00:00"", '%r') |
+-------------------------------+
| 12:00:00 AM |
+-------------------------------+
1 row in set (0.00 sec)
mysql> SELECT TIME_FORMAT(""25:00:00"", '%r');
+-------------------------------+
| TIME_FORMAT(""25:00:00"", '%r') |
+-------------------------------+
| 01:00:00 AM |
+-------------------------------+
1 row in set (0.00 sec)
mysql> SELECT TIME_FORMAT(""24:00:00"", '%l %p');
+----------------------------------+
| TIME_FORMAT(""24:00:00"", '%l %p') |
+----------------------------------+
| 12 AM |
+----------------------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
In TiDB
```
mysql> SELECT TIME_FORMAT(""24:00:00"", '%r');
+-------------------------------+
| TIME_FORMAT(""24:00:00"", '%r') |
+-------------------------------+
| 12:00:00 PM |
+-------------------------------+
1 row in set (0.00 sec)
mysql> SELECT TIME_FORMAT(""25:00:00"", '%r');
+-------------------------------+
| TIME_FORMAT(""25:00:00"", '%r') |
+-------------------------------+
| 13:00:00 PM |
+-------------------------------+
1 row in set (0.00 sec)
mysql> SELECT TIME_FORMAT(""24:00:00"", '%l %p');
+----------------------------------+
| TIME_FORMAT(""24:00:00"", '%l %p') |
+----------------------------------+
| 0 AM |
+----------------------------------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v3.0.0-beta-227-g06183393e-dirty
Git Commit Hash: 06183393ed536aa248248b72d4bf9f5010947f66
Git Branch: master
UTC Build Time: 2019-03-15 08:22:53
GoVersion: go version go1.12 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
```
",1, time format is not compatible with mysql bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error select time format r select time format r select time format l p what did you expect to see in mysql mysql select time format r time format r am row in set sec mysql select time format r time format r am row in set sec mysql select time format l p time format l p am row in set sec what did you see instead in tidb mysql select time format r time format r pm row in set sec mysql select time format r time format r pm row in set sec mysql select time format l p time format l p am row in set sec what version of tidb are you using tidb server v or run select tidb version on tidb tidb version release version beta dirty git commit hash git branch master utc build time goversion go version darwin race enabled false tikv min version alpha check table before drop false ,1
11075,13099262913.0,IssuesEvent,2020-08-03 21:13:09,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,"I defined a table field as varchar(50), but I got 66 when I query field length with ResultSetMetaData .getPrecision()",type/compatibility,"## Bug Report
I create a table named t_test with statement ,
```
CREATE TABLE t_test (
id varchar(50) NOT NULL ,
name varchar(50) NULL ,
PRIMARY KEY (id)
)
```
then I use jdbc driver to get the fields metadata of table t_test,
```
Class.forName(driverClassName);
Connection connection = DriverManager.getConnection(url, user, password);
PreparedStatement ps = connection.prepareStatement(""select * from t_test"");
ResultSet rs = ps.executeQuery();
ResultSetMetaData metaData = rs.getMetaData();
int precision = metaData.getPrecision(i);
```
I get a number 66.But when I do this in mysql, I get a number 50.
my tidb_version() is
```
Release Version: v2.0.8
Git Commit Hash: 1ca8e99f05f39fc5e0921f169ba397f71ff6b7fb
Git Branch: release-2.0
UTC Build Time: 2018-10-16 09:35:16
GoVersion: go version go1.11 linux/amd64
TiKV Min Version: 2.0.0-rc.4.1
```
and my mysql driver version is `mysql-connector-java-5.1.52.jar`
",True,"I defined a table field as varchar(50), but I got 66 when I query field length with ResultSetMetaData .getPrecision() - ## Bug Report
I create a table named t_test with statement ,
```
CREATE TABLE t_test (
id varchar(50) NOT NULL ,
name varchar(50) NULL ,
PRIMARY KEY (id)
)
```
then I use jdbc driver to get the fields metadata of table t_test,
```
Class.forName(driverClassName);
Connection connection = DriverManager.getConnection(url, user, password);
PreparedStatement ps = connection.prepareStatement(""select * from t_test"");
ResultSet rs = ps.executeQuery();
ResultSetMetaData metaData = rs.getMetaData();
int precision = metaData.getPrecision(i);
```
I get a number 66.But when I do this in mysql, I get a number 50.
my tidb_version() is
```
Release Version: v2.0.8
Git Commit Hash: 1ca8e99f05f39fc5e0921f169ba397f71ff6b7fb
Git Branch: release-2.0
UTC Build Time: 2018-10-16 09:35:16
GoVersion: go version go1.11 linux/amd64
TiKV Min Version: 2.0.0-rc.4.1
```
and my mysql driver version is `mysql-connector-java-5.1.52.jar`
",1,i defined a table field as varchar but i got when i query field length with resultsetmetadata getprecision bug report i create a table named t test with statement create table t test id varchar not null name varchar null primary key id then i use jdbc driver to get the fields metadata of table t test class forname driverclassname connection connection drivermanager getconnection url user password preparedstatement ps connection preparestatement select from t test resultset rs ps executequery resultsetmetadata metadata rs getmetadata int precision metadata getprecision i i get a number but when i do this in mysql i get a number my tidb version is release version git commit hash git branch release utc build time goversion go version linux tikv min version rc and my mysql driver version is mysql connector java jar ,1
20723,30812356317.0,IssuesEvent,2023-08-01 11:17:30,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,WEIGHT_STRING() behaviour differs from MySQL,type/bug type/compatibility severity/minor compatibility-mysql8,"## Bug Report
### 1. Minimal reproduce step (Required)
Run this with `mysqlsh --column-type-info ...`:
```sql
SELECT WEIGHT_STRING('aéè€☺');
```
### 2. What did you expect to see? (Required)
This is with MySQL 8.1.0:
```
sql> SELECT WEIGHT_STRING('aéè€☺');
Field 1
Name: `WEIGHT_STRING('aéè€☺')`
Org_name: ``
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: Bytes
DbType: VAR_STRING
Collation: binary (63)
Length: 320
Decimals: 31
Flags: BINARY
+------------------------+
| WEIGHT_STRING('aéè€☺') |
+------------------------+
| 0x1C471CAA1CAA1C2A094A |
+------------------------+
1 row in set (0.0003 sec)
```
This is with MySQL 8.0.33 (and MySQL Client instead of MySQL Shell):
```
root [(none)] > SELECT WEIGHT_STRING('aéè€☺');
Field 1: `WEIGHT_STRING('aéè€☺')`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: VAR_STRING
Collation: binary (63)
Length: 320
Max_length: 10
Decimals: 31
Flags: BINARY
+------------------------------------------------------------+
| WEIGHT_STRING('aéè€☺') |
+------------------------------------------------------------+
| 0x1C471CAA1CAA1C2A094A |
+------------------------------------------------------------+
1 row in set (0.01 sec)
```
### 3. What did you see instead (Required)
```
sql> SELECT WEIGHT_STRING('aéè€☺');
Field 1
Name: `WEIGHT_STRING('aéè€☺')`
Org_name: ``
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: String ← Different, MySQL has Bytes
DbType: VAR_STRING
Collation: utf8mb4_bin (46) ← Different, MySQL has ""binary (63)""
Length: 0 ← Different, MySQL has 320
Decimals: 31
Flags: NOT_NULL ← Different, MySQL has ""BINARY""
+------------------------+
| WEIGHT_STRING('aéè€☺') |
+------------------------+
| aéè€☺ |
+------------------------+
1 row in set (0.0005 sec)
```
### 4. What is your TiDB version? (Required)
```
Release Version: v7.3.0-alpha-224-g941415cfd0
Edition: Community
Git Commit Hash: 941415cfd007161df099c0d701140dd3962b87c2
Git Branch: utf8mb4-0900-ai-ci
UTC Build Time: 2023-08-01 10:58:52
GoVersion: go1.20.6
Race Enabled: false
Check Table Before Drop: false
Store: unistore
```
",True,"WEIGHT_STRING() behaviour differs from MySQL - ## Bug Report
### 1. Minimal reproduce step (Required)
Run this with `mysqlsh --column-type-info ...`:
```sql
SELECT WEIGHT_STRING('aéè€☺');
```
### 2. What did you expect to see? (Required)
This is with MySQL 8.1.0:
```
sql> SELECT WEIGHT_STRING('aéè€☺');
Field 1
Name: `WEIGHT_STRING('aéè€☺')`
Org_name: ``
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: Bytes
DbType: VAR_STRING
Collation: binary (63)
Length: 320
Decimals: 31
Flags: BINARY
+------------------------+
| WEIGHT_STRING('aéè€☺') |
+------------------------+
| 0x1C471CAA1CAA1C2A094A |
+------------------------+
1 row in set (0.0003 sec)
```
This is with MySQL 8.0.33 (and MySQL Client instead of MySQL Shell):
```
root [(none)] > SELECT WEIGHT_STRING('aéè€☺');
Field 1: `WEIGHT_STRING('aéè€☺')`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: VAR_STRING
Collation: binary (63)
Length: 320
Max_length: 10
Decimals: 31
Flags: BINARY
+------------------------------------------------------------+
| WEIGHT_STRING('aéè€☺') |
+------------------------------------------------------------+
| 0x1C471CAA1CAA1C2A094A |
+------------------------------------------------------------+
1 row in set (0.01 sec)
```
### 3. What did you see instead (Required)
```
sql> SELECT WEIGHT_STRING('aéè€☺');
Field 1
Name: `WEIGHT_STRING('aéè€☺')`
Org_name: ``
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: String ← Different, MySQL has Bytes
DbType: VAR_STRING
Collation: utf8mb4_bin (46) ← Different, MySQL has ""binary (63)""
Length: 0 ← Different, MySQL has 320
Decimals: 31
Flags: NOT_NULL ← Different, MySQL has ""BINARY""
+------------------------+
| WEIGHT_STRING('aéè€☺') |
+------------------------+
| aéè€☺ |
+------------------------+
1 row in set (0.0005 sec)
```
### 4. What is your TiDB version? (Required)
```
Release Version: v7.3.0-alpha-224-g941415cfd0
Edition: Community
Git Commit Hash: 941415cfd007161df099c0d701140dd3962b87c2
Git Branch: utf8mb4-0900-ai-ci
UTC Build Time: 2023-08-01 10:58:52
GoVersion: go1.20.6
Race Enabled: false
Check Table Before Drop: false
Store: unistore
```
",1,weight string behaviour differs from mysql bug report minimal reproduce step required run this with mysqlsh column type info sql select weight string aéè€☺ what did you expect to see required this is with mysql sql select weight string aéè€☺ field name weight string aéè€☺ org name catalog def database table org table type bytes dbtype var string collation binary length decimals flags binary weight string aéè€☺ row in set sec this is with mysql and mysql client instead of mysql shell root select weight string aéè€☺ field weight string aéè€☺ catalog def database table org table type var string collation binary length max length decimals flags binary weight string aéè€☺ row in set sec what did you see instead required sql select weight string aéè€☺ field name weight string aéè€☺ org name catalog def database table org table type string ← different mysql has bytes dbtype var string collation bin ← different mysql has binary length ← different mysql has decimals flags not null ← different mysql has binary weight string aéè€☺ aéè€☺ row in set sec what is your tidb version required release version alpha edition community git commit hash git branch ai ci utc build time goversion race enabled false check table before drop false store unistore ,1
4324,7045264520.0,IssuesEvent,2018-01-01 17:09:00,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,[compatibility] select cast(121 as date);,compatibility,"## 1. What did you do?
```sql
select cast(121 as date);
```
## 2. What did you expect to see?
```sql
MySQL > select cast(121 as date);
+-------------------+
| cast(121 as date) |
+-------------------+
| 2000-01-21 |
+-------------------+
1 row in set (0.00 sec)
```
## 3. What did you see instead?
```sql
TiDB > select cast(121 as date);
ERROR 1105 (HY000): invalid time format
```
## 4. What version of TiDB are you using (`tidb-server -V`)?
```sh
$./bin/tidb-server -V
Release Version: 0.8.0
Git Commit Hash: 986fb645f3654801afb4da7e1fc72a6aff5fa2e3
Git Commit Branch: master
UTC Build Time: 2017-08-24 05:22:35
```
",True,"[compatibility] select cast(121 as date); - ## 1. What did you do?
```sql
select cast(121 as date);
```
## 2. What did you expect to see?
```sql
MySQL > select cast(121 as date);
+-------------------+
| cast(121 as date) |
+-------------------+
| 2000-01-21 |
+-------------------+
1 row in set (0.00 sec)
```
## 3. What did you see instead?
```sql
TiDB > select cast(121 as date);
ERROR 1105 (HY000): invalid time format
```
## 4. What version of TiDB are you using (`tidb-server -V`)?
```sh
$./bin/tidb-server -V
Release Version: 0.8.0
Git Commit Hash: 986fb645f3654801afb4da7e1fc72a6aff5fa2e3
Git Commit Branch: master
UTC Build Time: 2017-08-24 05:22:35
```
",1, select cast as date what did you do sql select cast as date what did you expect to see sql mysql select cast as date cast as date row in set sec what did you see instead sql tidb select cast as date error invalid time format what version of tidb are you using tidb server v sh bin tidb server v release version git commit hash git commit branch master utc build time ,1
13067,15367279426.0,IssuesEvent,2021-03-02 02:56:56,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,prefixed column clustered index's duplicate error message differ to mysql,status/help-wanted type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```
set @@tidb_enable_clustered_index=1;
create table t(name varchar(255), b int, c int, primary key(name(2)));
insert into t(name, b) values(""cha"", 3);
insert into t(name, b) values(""chb"", 3);
```
### 2. What did you expect to see? (Required)
```
ERROR 1062 (23000): Duplicate entry 'ch' for key 'PRIMARY'
```
### 3. What did you see instead (Required)
```
ERROR 1062 (23000): Duplicate entry 'chb' for key 'PRIMARY'
```
### 4. What is your TiDB version? (Required)
```
Release Version: None
Edition: Community
Git Commit Hash: None
Git Branch: None
UTC Build Time: None
GoVersion: go1.15
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
```
",True,"prefixed column clustered index's duplicate error message differ to mysql - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```
set @@tidb_enable_clustered_index=1;
create table t(name varchar(255), b int, c int, primary key(name(2)));
insert into t(name, b) values(""cha"", 3);
insert into t(name, b) values(""chb"", 3);
```
### 2. What did you expect to see? (Required)
```
ERROR 1062 (23000): Duplicate entry 'ch' for key 'PRIMARY'
```
### 3. What did you see instead (Required)
```
ERROR 1062 (23000): Duplicate entry 'chb' for key 'PRIMARY'
```
### 4. What is your TiDB version? (Required)
```
Release Version: None
Edition: Community
Git Commit Hash: None
Git Branch: None
UTC Build Time: None
GoVersion: go1.15
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
```
",1,prefixed column clustered index s duplicate error message differ to mysql bug report please answer these questions before submitting your issue thanks minimal reproduce step required set tidb enable clustered index create table t name varchar b int c int primary key name insert into t name b values cha insert into t name b values chb what did you expect to see required error duplicate entry ch for key primary what did you see instead required error duplicate entry chb for key primary what is your tidb version required release version none edition community git commit hash none git branch none utc build time none goversion race enabled false tikv min version check table before drop false ,1
7999,10147683342.0,IssuesEvent,2019-08-05 11:14:30,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Inconsisitent Behaviour with Mysql When Col Name is too Long ,for new contributors help wanted type/compatibility,"## Bug Report
When col name is too long, mysql will cut a part of it. But inTiDB, col name will not be cut
1. What did you do?
```sql
SELECT COALESCE(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
```
2. What did you expect to see?
tidb will output the same with mysql.
3. What did you see instead?
mysql cut the col name, but tidb not.
As follow. left is mysql and right is tidb.
![big col name](https://user-images.githubusercontent.com/23725000/57836043-762d9300-77f2-11e9-8683-1f6c44a8c08d.png)
the col name mysql output:
```sql
COALESCE(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
```
but col name tidb output:
```sql
COALESCE(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
Release Version: v3.0.0-beta-111-g266ff4b6f
Git Commit Hash: 266ff4b6f37e721cf3d777a4e1d94b692f235d60
Git Branch: master
UTC Build Time: 2019-02-22 10:50:48
GoVersion: go version go1.11.2 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
```
Mysql version is 5.7",True,"Inconsisitent Behaviour with Mysql When Col Name is too Long - ## Bug Report
When col name is too long, mysql will cut a part of it. But inTiDB, col name will not be cut
1. What did you do?
```sql
SELECT COALESCE(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
```
2. What did you expect to see?
tidb will output the same with mysql.
3. What did you see instead?
mysql cut the col name, but tidb not.
As follow. left is mysql and right is tidb.
![big col name](https://user-images.githubusercontent.com/23725000/57836043-762d9300-77f2-11e9-8683-1f6c44a8c08d.png)
the col name mysql output:
```sql
COALESCE(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
```
but col name tidb output:
```sql
COALESCE(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
Release Version: v3.0.0-beta-111-g266ff4b6f
Git Commit Hash: 266ff4b6f37e721cf3d777a4e1d94b692f235d60
Git Branch: master
UTC Build Time: 2019-02-22 10:50:48
GoVersion: go version go1.11.2 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
```
Mysql version is 5.7",1,inconsisitent behaviour with mysql when col name is too long bug report when col name is too long mysql will cut a part of it but intidb col name will not be cut what did you do sql select coalesce what did you expect to see tidb will output the same with mysql what did you see instead mysql cut the col name but tidb not as follow left is mysql and right is tidb the col name mysql output sql coalesce but col name tidb output sql coalesce what version of tidb are you using tidb server v or run select tidb version on tidb release version beta git commit hash git branch master utc build time goversion go version linux race enabled false tikv min version alpha check table before drop false mysql version is ,1
9296,11306791735.0,IssuesEvent,2020-01-18 16:31:55,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,"Add MySQL datatype aliases serial, dec, fixed",type/compatibility,"`serial` is an alias for BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE.
`dec` and `fixed` are alias for decimal.
",True,"Add MySQL datatype aliases serial, dec, fixed - `serial` is an alias for BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE.
`dec` and `fixed` are alias for decimal.
",1,add mysql datatype aliases serial dec fixed serial is an alias for bigint unsigned not null auto increment unique dec and fixed are alias for decimal ,1
12247,14478089401.0,IssuesEvent,2020-12-10 07:48:04,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Can not swap values by a multi-tables update,severity/major sig/execution type/bug type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```sql
drop table if exists t1, t2;
create table t1 (c_str varchar(40));
create table t2 (c_str varchar(40));
insert into t1 values ('Alice');
insert into t2 values ('Bob');
select t1.c_str, t2.c_str from t1, t2 where t1.c_str <= t2.c_str;
update t1, t2 set t1.c_str = t2.c_str, t2.c_str = t1.c_str where t1.c_str <= t2.c_str;
select t1.c_str, t2.c_str from t1, t2 where t1.c_str <= t2.c_str;
```
### 2. What did you expect to see? (Required)
The values of `t1.c_str` and `t2.c_str` should be swapped in the above case, that is, the last selection should return an empty set.
### 3. What did you see instead (Required)
```
mysql> select t1.c_str, t2.c_str from t1, t2 where t1.c_str <= t2.c_str;
+-------+-------+
| c_str | c_str |
+-------+-------+
| Alice | Bob |
+-------+-------+
1 row in set (0.06 sec)
mysql> update t1, t2 set t1.c_str = t2.c_str, t2.c_str = t1.c_str where t1.c_str <= t2.c_str;
Query OK, 1 row affected (0.06 sec)
Rows matched: 2 Changed: 1 Warnings: 0
mysql> select t1.c_str, t2.c_str from t1, t2 where t1.c_str <= t2.c_str;
+-------+-------+
| c_str | c_str |
+-------+-------+
| Bob | Bob |
+-------+-------+
1 row in set (0.05 sec)
```
### 4. What is your TiDB version? (Required)
master @ 8978773f5e3d43a100550e6babea9904a99e5938
release-4.0 @ 3948c7ba7b5d4a081abf2162b791ab67fe650882
",True,"Can not swap values by a multi-tables update - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```sql
drop table if exists t1, t2;
create table t1 (c_str varchar(40));
create table t2 (c_str varchar(40));
insert into t1 values ('Alice');
insert into t2 values ('Bob');
select t1.c_str, t2.c_str from t1, t2 where t1.c_str <= t2.c_str;
update t1, t2 set t1.c_str = t2.c_str, t2.c_str = t1.c_str where t1.c_str <= t2.c_str;
select t1.c_str, t2.c_str from t1, t2 where t1.c_str <= t2.c_str;
```
### 2. What did you expect to see? (Required)
The values of `t1.c_str` and `t2.c_str` should be swapped in the above case, that is, the last selection should return an empty set.
### 3. What did you see instead (Required)
```
mysql> select t1.c_str, t2.c_str from t1, t2 where t1.c_str <= t2.c_str;
+-------+-------+
| c_str | c_str |
+-------+-------+
| Alice | Bob |
+-------+-------+
1 row in set (0.06 sec)
mysql> update t1, t2 set t1.c_str = t2.c_str, t2.c_str = t1.c_str where t1.c_str <= t2.c_str;
Query OK, 1 row affected (0.06 sec)
Rows matched: 2 Changed: 1 Warnings: 0
mysql> select t1.c_str, t2.c_str from t1, t2 where t1.c_str <= t2.c_str;
+-------+-------+
| c_str | c_str |
+-------+-------+
| Bob | Bob |
+-------+-------+
1 row in set (0.05 sec)
```
### 4. What is your TiDB version? (Required)
master @ 8978773f5e3d43a100550e6babea9904a99e5938
release-4.0 @ 3948c7ba7b5d4a081abf2162b791ab67fe650882
",1,can not swap values by a multi tables update bug report please answer these questions before submitting your issue thanks minimal reproduce step required sql drop table if exists create table c str varchar create table c str varchar insert into values alice insert into values bob select c str c str from where c str c str update set c str c str c str c str where c str c str select c str c str from where c str c str what did you expect to see required the values of c str and c str should be swapped in the above case that is the last selection should return an empty set what did you see instead required mysql select c str c str from where c str c str c str c str alice bob row in set sec mysql update set c str c str c str c str where c str c str query ok row affected sec rows matched changed warnings mysql select c str c str from where c str c str c str c str bob bob row in set sec what is your tidb version required master release ,1
14776,18164594851.0,IssuesEvent,2021-09-27 13:26:49,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,GRANT ALL ON performance_schema.* succeeds,type/bug help wanted type/compatibility good first issue sig/sql-infra severity/moderate,"## Bug Report
### 1. Minimal reproduce step (Required)
```sql
create user u1;
grant all on performance_schema.* to u1;
```
### 2. What did you expect to see? (Required)
Error:
```sql
mysql> create user u1;
Query OK, 0 rows affected (0,03 sec)
mysql> grant all on performance_schema.* to u1;
ERROR 1044 (42000): Access denied for user 'root'@'localhost' to database 'performance_schema'
```
### 3. What did you see instead (Required)
Success
```sql
tidb> create user u1;
Query OK, 0 rows affected (0,01 sec)
tidb> grant all on performance_schema.* to u1;
Query OK, 0 rows affected (0,01 sec)
```
### 4. What is your TiDB version? (Required)
```sql
tidb> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v5.3.0-alpha-36-gceaf67047
Edition: Community
Git Commit Hash: ceaf6704774e6dee9a04b50f75338d51cf3ed7e7
Git Branch: master
UTC Build Time: 2021-09-07 13:06:06
GoVersion: go1.16.2
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0,00 sec)
```",True,"GRANT ALL ON performance_schema.* succeeds - ## Bug Report
### 1. Minimal reproduce step (Required)
```sql
create user u1;
grant all on performance_schema.* to u1;
```
### 2. What did you expect to see? (Required)
Error:
```sql
mysql> create user u1;
Query OK, 0 rows affected (0,03 sec)
mysql> grant all on performance_schema.* to u1;
ERROR 1044 (42000): Access denied for user 'root'@'localhost' to database 'performance_schema'
```
### 3. What did you see instead (Required)
Success
```sql
tidb> create user u1;
Query OK, 0 rows affected (0,01 sec)
tidb> grant all on performance_schema.* to u1;
Query OK, 0 rows affected (0,01 sec)
```
### 4. What is your TiDB version? (Required)
```sql
tidb> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v5.3.0-alpha-36-gceaf67047
Edition: Community
Git Commit Hash: ceaf6704774e6dee9a04b50f75338d51cf3ed7e7
Git Branch: master
UTC Build Time: 2021-09-07 13:06:06
GoVersion: go1.16.2
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0,00 sec)
```",1,grant all on performance schema succeeds bug report minimal reproduce step required sql create user grant all on performance schema to what did you expect to see required error sql mysql create user query ok rows affected sec mysql grant all on performance schema to error access denied for user root localhost to database performance schema what did you see instead required success sql tidb create user query ok rows affected sec tidb grant all on performance schema to query ok rows affected sec what is your tidb version required sql tidb select tidb version g row tidb version release version alpha edition community git commit hash git branch master utc build time goversion race enabled false tikv min version check table before drop false row in set sec ,1
6689,8967144933.0,IssuesEvent,2019-01-29 01:59:17,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Float'precision is different from MySQL,type/compatibility,"## Feature Request
**Is your feature request related to a problem? Please describe:**
```
CREATE TABLE test_float (
uuid char(32) NOT NULL,
average float DEFAULT '0',
PRIMARY KEY (uuid)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
insert into test_float value('0a6f9d012f98467f8e671e9870044528', 208.867);
SELECT
CONCAT_WS( ',', average)
FROM
test_float
WHERE
uuid = '0a6f9d012f98467f8e671e9870044528';
```
+ MySQL OUTPUT:
```
+----------------------------+
| CONCAT_WS( ',', `average`) |
+----------------------------+
| 208.867 |
+----------------------------+
```
+ TiDB OUTPUT:
```
+----------------------------+
| CONCAT_WS( ',', `average`) |
+----------------------------+
| 208.86700439 |
+----------------------------+
```
+ [Related Issues](https://github.com/pingcap/tidb/issues/6882)",True,"Float'precision is different from MySQL - ## Feature Request
**Is your feature request related to a problem? Please describe:**
```
CREATE TABLE test_float (
uuid char(32) NOT NULL,
average float DEFAULT '0',
PRIMARY KEY (uuid)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
insert into test_float value('0a6f9d012f98467f8e671e9870044528', 208.867);
SELECT
CONCAT_WS( ',', average)
FROM
test_float
WHERE
uuid = '0a6f9d012f98467f8e671e9870044528';
```
+ MySQL OUTPUT:
```
+----------------------------+
| CONCAT_WS( ',', `average`) |
+----------------------------+
| 208.867 |
+----------------------------+
```
+ TiDB OUTPUT:
```
+----------------------------+
| CONCAT_WS( ',', `average`) |
+----------------------------+
| 208.86700439 |
+----------------------------+
```
+ [Related Issues](https://github.com/pingcap/tidb/issues/6882)",1,float precision is different from mysql feature request is your feature request related to a problem please describe create table test float uuid char not null average float default primary key uuid engine innodb default charset insert into test float value select concat ws average from test float where uuid mysql output concat ws average tidb output concat ws average ,1
3381,6346720339.0,IssuesEvent,2017-07-28 03:33:37,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,Built-in function CHARSET not supported,compatibility rc3.1,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```sql
CREATE TABLE t1 (user varchar(255) NOT NULL default '') ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO t1 VALUES ('one'),('two');
SELECT CHARSET('a');
```
2. What did you expect to see?
```
+--------------+
| CHARSET('a') |
+--------------+
| utf8 |
+--------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
```
ERROR 1305 (42000): FUNCTION CHARSET does not exist
```
4. What version of TiDB are you using (`tidb-server -V`)?
",True,"Built-in function CHARSET not supported - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```sql
CREATE TABLE t1 (user varchar(255) NOT NULL default '') ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO t1 VALUES ('one'),('two');
SELECT CHARSET('a');
```
2. What did you expect to see?
```
+--------------+
| CHARSET('a') |
+--------------+
| utf8 |
+--------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
```
ERROR 1305 (42000): FUNCTION CHARSET does not exist
```
4. What version of TiDB are you using (`tidb-server -V`)?
",1,built in function charset not supported please answer these questions before submitting your issue thanks what did you do sql create table user varchar not null default engine myisam default charset insert into values one two select charset a what did you expect to see charset a row in set sec what did you see instead error function charset does not exist what version of tidb are you using tidb server v ,1
5749,8205081047.0,IssuesEvent,2018-09-03 08:59:40,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,insert a id > 9223372036854775807 should not raise an error,type/compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
create table bug43196 (`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY, `a` bigint(20) unsigned NOT NULL);
insert into bug43196(id,a) values(18446744073709551200,1);
```
2. What did you expect to see?
No error.
3. What did you see instead?
ERROR 1690 (22003): constant 18446744073709551200 overflows bigint
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
e04f74b031f5b47dba79537e7780356bc96745c5
",True,"insert a id > 9223372036854775807 should not raise an error - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
create table bug43196 (`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY, `a` bigint(20) unsigned NOT NULL);
insert into bug43196(id,a) values(18446744073709551200,1);
```
2. What did you expect to see?
No error.
3. What did you see instead?
ERROR 1690 (22003): constant 18446744073709551200 overflows bigint
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
e04f74b031f5b47dba79537e7780356bc96745c5
",1,insert a id should not raise an error please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error sql create table id bigint unsigned not null auto increment primary key a bigint unsigned not null insert into id a values what did you expect to see no error what did you see instead error constant overflows bigint what version of tidb are you using tidb server v or run select tidb version on tidb ,1
17231,23759511348.0,IssuesEvent,2022-09-01 07:40:17,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,`order by` of json value is different with MySQL,type/enhancement type/compatibility component/json,"## Enhancement
```sql
create table t(i INT, j JSON);
insert into t values (0,'[1,2,3,4]');
insert into t values (0,'[1,2,3]');
insert into t values (0,'[5]');
```
Then consider the following two query:
```sql
select j from t order by j;
select j from t where j > json_array(5);
```
The first line returns:
```
+--------------+
| j |
+--------------+
| [5] |
| [1, 2, 3] |
| [1, 2, 3, 4] |
+--------------+
```
It indicates that `[5]` is the smallest one. However, the second one returns:
```
Empty Set
```
It shows no one is greater than `[5]`. It's not consistent :cry: .
For TiDB, it follows the json order, and returns:
```
+--------------+
| j |
+--------------+
| [1, 2, 3] |
| [1, 2, 3, 4] |
| [5] |
+--------------+
```
For the first selection.
",True,"`order by` of json value is different with MySQL - ## Enhancement
```sql
create table t(i INT, j JSON);
insert into t values (0,'[1,2,3,4]');
insert into t values (0,'[1,2,3]');
insert into t values (0,'[5]');
```
Then consider the following two query:
```sql
select j from t order by j;
select j from t where j > json_array(5);
```
The first line returns:
```
+--------------+
| j |
+--------------+
| [5] |
| [1, 2, 3] |
| [1, 2, 3, 4] |
+--------------+
```
It indicates that `[5]` is the smallest one. However, the second one returns:
```
Empty Set
```
It shows no one is greater than `[5]`. It's not consistent :cry: .
For TiDB, it follows the json order, and returns:
```
+--------------+
| j |
+--------------+
| [1, 2, 3] |
| [1, 2, 3, 4] |
| [5] |
+--------------+
```
For the first selection.
",1, order by of json value is different with mysql enhancement sql create table t i int j json insert into t values insert into t values insert into t values then consider the following two query sql select j from t order by j select j from t where j json array the first line returns j it indicates that is the smallest one however the second one returns empty set it shows no one is greater than it s not consistent cry for tidb it follows the json order and returns j for the first selection ,1
5630,8114859545.0,IssuesEvent,2018-08-15 03:05:44,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,LOAD DATA does not support to set character set,type/compatibility,"Part of MySQL syntax looks like below:
```
LOAD DATA [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE 'file_name'
[REPLACE | IGNORE]
INTO TABLE tbl_name
[PARTITION (partition_name [, partition_name] ...)]
[CHARACTER SET charset_name]
```
It has a character set option in it, but TiDB not.
TiDB version: 0d18ac2c18c31d7d2fcf85ab7828359df0408c7f
",True,"LOAD DATA does not support to set character set - Part of MySQL syntax looks like below:
```
LOAD DATA [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE 'file_name'
[REPLACE | IGNORE]
INTO TABLE tbl_name
[PARTITION (partition_name [, partition_name] ...)]
[CHARACTER SET charset_name]
```
It has a character set option in it, but TiDB not.
TiDB version: 0d18ac2c18c31d7d2fcf85ab7828359df0408c7f
",1,load data does not support to set character set part of mysql syntax looks like below load data infile file name into table tbl name it has a character set option in it but tidb not tidb version ,1
3476,6460255882.0,IssuesEvent,2017-08-16 03:12:06,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Built-in function TIME_FORMAT not supported,compatibility rc3.1,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
select TIME_FORMAT(""24:00:00"", '%r');
```
2. What did you expect to see?
```
+-------------------------------+
| TIME_FORMAT(""24:00:00"", '%r') |
+-------------------------------+
| 12:00:00 AM |
+-------------------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
ERROR 1305 (42000): FUNCTION TIME_FORMAT does not exist
4. What version of TiDB are you using (`tidb-server -V`)?
",True,"Built-in function TIME_FORMAT not supported - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
select TIME_FORMAT(""24:00:00"", '%r');
```
2. What did you expect to see?
```
+-------------------------------+
| TIME_FORMAT(""24:00:00"", '%r') |
+-------------------------------+
| 12:00:00 AM |
+-------------------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
ERROR 1305 (42000): FUNCTION TIME_FORMAT does not exist
4. What version of TiDB are you using (`tidb-server -V`)?
",1,built in function time format not supported please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error sql select time format r what did you expect to see time format r am row in set sec what did you see instead error function time format does not exist what version of tidb are you using tidb server v ,1
3592,6505422239.0,IssuesEvent,2017-08-24 02:51:00,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,[compatibility] SYSDATE() is different from mysql,compatibility,"1. What did you do?
If possible, provide a recipe for reproducing the error.
`SELECT SYSDATE(), SLEEP(1), SYSDATE(), SLEEP(2), SYSDATE();`
2. What did you expect to see?
```
mysql> SELECT SYSDATE(), SLEEP(1), SYSDATE(), SLEEP(2), SYSDATE();
+---------------------+----------+---------------------+----------+---------------------+
| SYSDATE() | SLEEP(1) | SYSDATE() | SLEEP(2) | SYSDATE() |
+---------------------+----------+---------------------+----------+---------------------+
| 2017-08-18 22:33:51 | 0 | 2017-08-18 22:33:52 | 0 | 2017-08-18 22:33:54 |
+---------------------+----------+---------------------+----------+---------------------+
1 row in set (3.01 sec)
```
3. What did you see instead?
in TiDB SYSDATE() behaves the same as now(), it returns statement begin time but not execute time
```
MySQL [(none)]> SELECT SYSDATE(), SLEEP(1), SYSDATE(), SLEEP(2), SYSDATE();
+---------------------+----------+---------------------+----------+---------------------+
| SYSDATE() | SLEEP(1) | SYSDATE() | SLEEP(2) | SYSDATE() |
+---------------------+----------+---------------------+----------+---------------------+
| 2017-08-18 22:33:44 | 0 | 2017-08-18 22:33:44 | 0 | 2017-08-18 22:33:44 |
+---------------------+----------+---------------------+----------+---------------------+
1 row in set (3.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V`)?
Git Commit Hash: 365e4ab491b683a69c2004f30b1ae4f86256e2ad
Git Commit Branch: master
UTC Build Time: 2017-08-16 01:24:27
",True,"[compatibility] SYSDATE() is different from mysql - 1. What did you do?
If possible, provide a recipe for reproducing the error.
`SELECT SYSDATE(), SLEEP(1), SYSDATE(), SLEEP(2), SYSDATE();`
2. What did you expect to see?
```
mysql> SELECT SYSDATE(), SLEEP(1), SYSDATE(), SLEEP(2), SYSDATE();
+---------------------+----------+---------------------+----------+---------------------+
| SYSDATE() | SLEEP(1) | SYSDATE() | SLEEP(2) | SYSDATE() |
+---------------------+----------+---------------------+----------+---------------------+
| 2017-08-18 22:33:51 | 0 | 2017-08-18 22:33:52 | 0 | 2017-08-18 22:33:54 |
+---------------------+----------+---------------------+----------+---------------------+
1 row in set (3.01 sec)
```
3. What did you see instead?
in TiDB SYSDATE() behaves the same as now(), it returns statement begin time but not execute time
```
MySQL [(none)]> SELECT SYSDATE(), SLEEP(1), SYSDATE(), SLEEP(2), SYSDATE();
+---------------------+----------+---------------------+----------+---------------------+
| SYSDATE() | SLEEP(1) | SYSDATE() | SLEEP(2) | SYSDATE() |
+---------------------+----------+---------------------+----------+---------------------+
| 2017-08-18 22:33:44 | 0 | 2017-08-18 22:33:44 | 0 | 2017-08-18 22:33:44 |
+---------------------+----------+---------------------+----------+---------------------+
1 row in set (3.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V`)?
Git Commit Hash: 365e4ab491b683a69c2004f30b1ae4f86256e2ad
Git Commit Branch: master
UTC Build Time: 2017-08-16 01:24:27
",1, sysdate is different from mysql what did you do if possible provide a recipe for reproducing the error select sysdate sleep sysdate sleep sysdate what did you expect to see mysql select sysdate sleep sysdate sleep sysdate sysdate sleep sysdate sleep sysdate row in set sec what did you see instead in tidb sysdate behaves the same as now it returns statement begin time but not execute time mysql select sysdate sleep sysdate sleep sysdate sysdate sleep sysdate sleep sysdate row in set sec what version of tidb are you using tidb server v git commit hash git commit branch master utc build time ,1
7073,9359184963.0,IssuesEvent,2019-04-02 05:56:37,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,JSON_EXTRACT is not same with MySQL,type/bug type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```SQL
SELECT JSON_EXTRACT('{ ""a"" : ""foo"", ""b"" : [ true, { ""c"" : 123, ""c"" : 456 } ] }',
'$.b[ 1 ].c');
```
2. What did you expect to see?
## In MySQL
```sql
mysql> SELECT JSON_EXTRACT('{ ""a"" : ""foo"", ""b"" : [ true, { ""c"" : 123, ""c"" : 456 } ] }',
-> '$.b[ 1 ].c');
+------------------------------------------------------------------------------------------------------------+
| JSON_EXTRACT('{ ""a"" : ""foo"", ""b"" : [ true, { ""c"" : 123, ""c"" : 456 } ] }',
'$.b[ 1 ].c') |
+------------------------------------------------------------------------------------------------------------+
| 123 |
+------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> select version();
+-------------------------+
| version() |
+-------------------------+
| 5.7.25-0ubuntu0.18.04.2 |
+-------------------------+
1 row in set (0.00 sec)
mysql>
```
3. What did you see instead?
## In TiDB
```SQL
mysql> SELECT JSON_EXTRACT('{ ""a"" : ""foo"", ""b"" : [ true, { ""c"" : 123, ""c"" : 456 } ] }',
-> '$.b[ 1 ].c');
+------------------------------------------------------------------------------------------------------------+
| JSON_EXTRACT('{ ""a"" : ""foo"", ""b"" : [ true, { ""c"" : 123, ""c"" : 456 } ] }',
'$.b[ 1 ].c') |
+------------------------------------------------------------------------------------------------------------+
| 456 |
+------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v3.0.0-beta-321-gc6a757b24
Git Commit Hash: c6a757b2435965a72ada9d61ea8b7a367bd89b5f
Git Branch: master
UTC Build Time: 2019-04-02 02:38:04
GoVersion: go version go1.12.1 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
1 row in set (0.00 sec)
mysql>
```
",True,"JSON_EXTRACT is not same with MySQL - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```SQL
SELECT JSON_EXTRACT('{ ""a"" : ""foo"", ""b"" : [ true, { ""c"" : 123, ""c"" : 456 } ] }',
'$.b[ 1 ].c');
```
2. What did you expect to see?
## In MySQL
```sql
mysql> SELECT JSON_EXTRACT('{ ""a"" : ""foo"", ""b"" : [ true, { ""c"" : 123, ""c"" : 456 } ] }',
-> '$.b[ 1 ].c');
+------------------------------------------------------------------------------------------------------------+
| JSON_EXTRACT('{ ""a"" : ""foo"", ""b"" : [ true, { ""c"" : 123, ""c"" : 456 } ] }',
'$.b[ 1 ].c') |
+------------------------------------------------------------------------------------------------------------+
| 123 |
+------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> select version();
+-------------------------+
| version() |
+-------------------------+
| 5.7.25-0ubuntu0.18.04.2 |
+-------------------------+
1 row in set (0.00 sec)
mysql>
```
3. What did you see instead?
## In TiDB
```SQL
mysql> SELECT JSON_EXTRACT('{ ""a"" : ""foo"", ""b"" : [ true, { ""c"" : 123, ""c"" : 456 } ] }',
-> '$.b[ 1 ].c');
+------------------------------------------------------------------------------------------------------------+
| JSON_EXTRACT('{ ""a"" : ""foo"", ""b"" : [ true, { ""c"" : 123, ""c"" : 456 } ] }',
'$.b[ 1 ].c') |
+------------------------------------------------------------------------------------------------------------+
| 456 |
+------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v3.0.0-beta-321-gc6a757b24
Git Commit Hash: c6a757b2435965a72ada9d61ea8b7a367bd89b5f
Git Branch: master
UTC Build Time: 2019-04-02 02:38:04
GoVersion: go version go1.12.1 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
1 row in set (0.00 sec)
mysql>
```
",1,json extract is not same with mysql bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error sql select json extract a foo b b c what did you expect to see in mysql sql mysql select json extract a foo b b c json extract a foo b b c row in set sec mysql select version version row in set sec mysql what did you see instead in tidb sql mysql select json extract a foo b b c json extract a foo b b c row in set sec mysql select tidb version g row tidb version release version beta git commit hash git branch master utc build time goversion go version linux race enabled false tikv min version alpha check table before drop false row in set sec mysql ,1
13559,16075766162.0,IssuesEvent,2021-04-25 10:15:47,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,Incompatible behaviour for insert ignore processing incorrect time value,severity/minor sig/execution type/bug type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```
CREATE TABLE `tbl_0` (
`col_0` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`col_1` bigint(20) unsigned NOT NULL,
`col_2` char(231) CHARACTER SET utf8 NOT NULL DEFAULT 'DMj',
`col_3` bit(1) NOT NULL,
`col_4` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`col_1`,`col_0`,`col_4`,`col_2`,`col_3`),
UNIQUE KEY `idx_1` (`col_3`,`col_4`),
KEY `idx_2` (`col_1`,`col_0`)
)
insert ignore into tbl_0 set col_1 = 107571123720455541 on duplicate key update col_3 = 0;
select * from tbl_0;
```
### 2. What did you expect to see? (Required)
```
select * from tbl_0;
+---------------------+--------------------+-------+--------------+-------+
| col_0 | col_1 | col_2 | col_3 | col_4 |
+---------------------+--------------------+-------+--------------+-------+
| 2021-04-25 18:11:38 | 107571123720455541 | DMj | 0x00 | 0 |
+---------------------+--------------------+-------+--------------+-------+
1 row in set (0.00 sec)
```
The result of `col_0` contains a correct time value.
### 3. What did you see instead (Required)
```
mysql> select * from tbl_0;
+---------------------+--------------------+-------+--------------+-------+
| col_0 | col_1 | col_2 | col_3 | col_4 |
+---------------------+--------------------+-------+--------------+-------+
| 0000-00-00 00:00:00 | 107571123720455541 | DMj | 0x00 | 0 |
+---------------------+--------------------+-------+--------------+-------+
```
The result of `col_0` contains a invalid time value.
### 4. What is your TiDB version? (Required)
master branch with 4ac76b4ce5d576231e531472cd061e72cbc1f5ac commit hash
Seems the meaning of `ON UPDATE CURRENT_TIMESTAMP` is not compatible.",True,"Incompatible behaviour for insert ignore processing incorrect time value - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```
CREATE TABLE `tbl_0` (
`col_0` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`col_1` bigint(20) unsigned NOT NULL,
`col_2` char(231) CHARACTER SET utf8 NOT NULL DEFAULT 'DMj',
`col_3` bit(1) NOT NULL,
`col_4` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`col_1`,`col_0`,`col_4`,`col_2`,`col_3`),
UNIQUE KEY `idx_1` (`col_3`,`col_4`),
KEY `idx_2` (`col_1`,`col_0`)
)
insert ignore into tbl_0 set col_1 = 107571123720455541 on duplicate key update col_3 = 0;
select * from tbl_0;
```
### 2. What did you expect to see? (Required)
```
select * from tbl_0;
+---------------------+--------------------+-------+--------------+-------+
| col_0 | col_1 | col_2 | col_3 | col_4 |
+---------------------+--------------------+-------+--------------+-------+
| 2021-04-25 18:11:38 | 107571123720455541 | DMj | 0x00 | 0 |
+---------------------+--------------------+-------+--------------+-------+
1 row in set (0.00 sec)
```
The result of `col_0` contains a correct time value.
### 3. What did you see instead (Required)
```
mysql> select * from tbl_0;
+---------------------+--------------------+-------+--------------+-------+
| col_0 | col_1 | col_2 | col_3 | col_4 |
+---------------------+--------------------+-------+--------------+-------+
| 0000-00-00 00:00:00 | 107571123720455541 | DMj | 0x00 | 0 |
+---------------------+--------------------+-------+--------------+-------+
```
The result of `col_0` contains a invalid time value.
### 4. What is your TiDB version? (Required)
master branch with 4ac76b4ce5d576231e531472cd061e72cbc1f5ac commit hash
Seems the meaning of `ON UPDATE CURRENT_TIMESTAMP` is not compatible.",1,incompatible behaviour for insert ignore processing incorrect time value bug report please answer these questions before submitting your issue thanks minimal reproduce step required create table tbl col timestamp not null default current timestamp col bigint unsigned not null col char character set not null default dmj col bit not null col bigint unsigned not null primary key col col col col col unique key idx col col key idx col col insert ignore into tbl set col on duplicate key update col select from tbl what did you expect to see required select from tbl col col col col col dmj row in set sec the result of col contains a correct time value what did you see instead required mysql select from tbl col col col col col dmj the result of col contains a invalid time value what is your tidb version required master branch with commit hash seems the meaning of on update current timestamp is not compatible ,1
3361,6329602204.0,IssuesEvent,2017-07-26 03:44:04,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,overflow compability,compatibility rc3.1,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
`select -9223372036854775809;`
2. What did you expect to see?
`9223372036854775809` is overflow math.MaxInt64, but mysql convert it to Decimal type.
```
mysql> select -9223372036854775809;
Field 1: `-9223372036854775809`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: NEWDECIMAL
Collation: binary (63)
Length: 20
Max_length: 20
Decimals: 0
Flags: NOT_NULL BINARY NUM
+----------------------+
| -9223372036854775809 |
+----------------------+
| -9223372036854775809 |
+----------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
but TiDB return 9223372036854775807 caused by int overflow, and still use LONGLONG type;
```
mysql> select -9223372036854775809;
Field 1: `-9223372036854775809`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: LONGLONG
Collation: binary (63)
Length: 0
Max_length: 19
Decimals: 31
Flags: BINARY NUM
+----------------------+
| -9223372036854775809 |
+----------------------+
| 9223372036854775807 |
+----------------------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V`)?
",True,"overflow compability - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
`select -9223372036854775809;`
2. What did you expect to see?
`9223372036854775809` is overflow math.MaxInt64, but mysql convert it to Decimal type.
```
mysql> select -9223372036854775809;
Field 1: `-9223372036854775809`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: NEWDECIMAL
Collation: binary (63)
Length: 20
Max_length: 20
Decimals: 0
Flags: NOT_NULL BINARY NUM
+----------------------+
| -9223372036854775809 |
+----------------------+
| -9223372036854775809 |
+----------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
but TiDB return 9223372036854775807 caused by int overflow, and still use LONGLONG type;
```
mysql> select -9223372036854775809;
Field 1: `-9223372036854775809`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: LONGLONG
Collation: binary (63)
Length: 0
Max_length: 19
Decimals: 31
Flags: BINARY NUM
+----------------------+
| -9223372036854775809 |
+----------------------+
| 9223372036854775807 |
+----------------------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V`)?
",1,overflow compability please answer these questions before submitting your issue thanks what did you do select what did you expect to see is overflow math but mysql convert it to decimal type mysql select field catalog def database table org table type newdecimal collation binary length max length decimals flags not null binary num row in set sec what did you see instead but tidb return caused by int overflow and still use longlong type mysql select field catalog def database table org table type longlong collation binary length max length decimals flags binary num row in set sec what version of tidb are you using tidb server v ,1
13897,16624236684.0,IssuesEvent,2021-06-03 07:33:48,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,infer functional dependencies from filters / join conditions and use them for only_full_group_by check,sig/planner type/compatibility type/enhancement,"## Development Task
Below is the output from mysql 5.7:
```
MySQL [test]> create table t1(a int not null);
Query OK, 0 rows affected (0.09 sec)
MySQL [test]> insert into t1 values(1);
Query OK, 1 row affected (0.00 sec)
MySQL [test]> create table t2(a int not null);
Query OK, 0 rows affected (0.02 sec)
MySQL [test]> insert into t2 values(1);
Query OK, 1 row affected (0.00 sec)
MySQL [test]> select t1.a from t1 join t2 on t1.a = t2.a group by t2.a;
+---+
| a |
+---+
| 1 |
+---+
1 row in set (0.01 sec)
MySQL [test]> select t1.a from t1 left join t2 on t1.a = t2.a group by t2.a;
ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'test.t1.a' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
MySQL [test]> select t1.a from t1 join t2 on t1.a = 1 and 2 = t2.a group by t2.a;
Empty set (0.00 sec)
MySQL [test]> select t1.a from t1 join t2 on t1.a = 1 and 2 < t2.a group by t2.a;
Empty set (0.00 sec)
MySQL [test]> select t1.a from t1 join t2 on t1.a > 1 and 2 = t2.a group by t2.a;
ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'test.t1.a' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
MySQL [test]> select t1.a from t1 join t2 using(a) group by t2.a;
+---+
| a |
+---+
| 1 |
+---+
1 row in set (0.00 sec)
MySQL [test]> select t1.a from t1 left join t2 using(a) group by t2.a;
ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'test.t1.a' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
```
We can see that, MySQL infers functional dependencies from filters and join conditions, and uses them for only_full_group_by check. Compared with MySQL, TiDB uses a pretty naive approach for only_full_group_by check, and TiDB would report error for all the above SELECT statements.
PostgreSQL(12 devel) has same loose check as TiDB.",True,"infer functional dependencies from filters / join conditions and use them for only_full_group_by check - ## Development Task
Below is the output from mysql 5.7:
```
MySQL [test]> create table t1(a int not null);
Query OK, 0 rows affected (0.09 sec)
MySQL [test]> insert into t1 values(1);
Query OK, 1 row affected (0.00 sec)
MySQL [test]> create table t2(a int not null);
Query OK, 0 rows affected (0.02 sec)
MySQL [test]> insert into t2 values(1);
Query OK, 1 row affected (0.00 sec)
MySQL [test]> select t1.a from t1 join t2 on t1.a = t2.a group by t2.a;
+---+
| a |
+---+
| 1 |
+---+
1 row in set (0.01 sec)
MySQL [test]> select t1.a from t1 left join t2 on t1.a = t2.a group by t2.a;
ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'test.t1.a' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
MySQL [test]> select t1.a from t1 join t2 on t1.a = 1 and 2 = t2.a group by t2.a;
Empty set (0.00 sec)
MySQL [test]> select t1.a from t1 join t2 on t1.a = 1 and 2 < t2.a group by t2.a;
Empty set (0.00 sec)
MySQL [test]> select t1.a from t1 join t2 on t1.a > 1 and 2 = t2.a group by t2.a;
ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'test.t1.a' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
MySQL [test]> select t1.a from t1 join t2 using(a) group by t2.a;
+---+
| a |
+---+
| 1 |
+---+
1 row in set (0.00 sec)
MySQL [test]> select t1.a from t1 left join t2 using(a) group by t2.a;
ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'test.t1.a' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
```
We can see that, MySQL infers functional dependencies from filters and join conditions, and uses them for only_full_group_by check. Compared with MySQL, TiDB uses a pretty naive approach for only_full_group_by check, and TiDB would report error for all the above SELECT statements.
PostgreSQL(12 devel) has same loose check as TiDB.",1,infer functional dependencies from filters join conditions and use them for only full group by check development task below is the output from mysql mysql create table a int not null query ok rows affected sec mysql insert into values query ok row affected sec mysql create table a int not null query ok rows affected sec mysql insert into values query ok row affected sec mysql select a from join on a a group by a a row in set sec mysql select a from left join on a a group by a error expression of select list is not in group by clause and contains nonaggregated column test a which is not functionally dependent on columns in group by clause this is incompatible with sql mode only full group by mysql select a from join on a and a group by a empty set sec mysql select a from join on a and a group by a empty set sec mysql select a from join on a and a group by a error expression of select list is not in group by clause and contains nonaggregated column test a which is not functionally dependent on columns in group by clause this is incompatible with sql mode only full group by mysql select a from join using a group by a a row in set sec mysql select a from left join using a group by a error expression of select list is not in group by clause and contains nonaggregated column test a which is not functionally dependent on columns in group by clause this is incompatible with sql mode only full group by we can see that mysql infers functional dependencies from filters and join conditions and uses them for only full group by check compared with mysql tidb uses a pretty naive approach for only full group by check and tidb would report error for all the above select statements postgresql devel has same loose check as tidb ,1
4327,7046441221.0,IssuesEvent,2018-01-02 07:56:18,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,Add support for alter table convert to syntax,compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
mysql > create table user(id int);
mysql> alter table user CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
```
2. What did you expect to see?
```
mysql> alter table user CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
Query OK, 0 rows affected (0.09 sec)
Records: 0 Duplicates: 0 Warnings: 0
```
3. What did you see instead?
```
mysql> alter table user CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
ERROR 1105 (HY000): line 1 column 25 near "" TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin"" (total length 70)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
tidb_version(): Release Version: v1.1.0-alpha-293-g0b5c0cf9
Git Commit Hash: 0b5c0cf94d852901f8e2392917a97d85eb851a55
Git Branch: master
UTC Build Time: 2018-01-02 07:53:48
```",True,"Add support for alter table convert to syntax - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
mysql > create table user(id int);
mysql> alter table user CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
```
2. What did you expect to see?
```
mysql> alter table user CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
Query OK, 0 rows affected (0.09 sec)
Records: 0 Duplicates: 0 Warnings: 0
```
3. What did you see instead?
```
mysql> alter table user CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
ERROR 1105 (HY000): line 1 column 25 near "" TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin"" (total length 70)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
tidb_version(): Release Version: v1.1.0-alpha-293-g0b5c0cf9
Git Commit Hash: 0b5c0cf94d852901f8e2392917a97d85eb851a55
Git Branch: master
UTC Build Time: 2018-01-02 07:53:48
```",1,add support for alter table convert to syntax please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error mysql create table user id int mysql alter table user convert to character set collate bin what did you expect to see mysql alter table user convert to character set collate bin query ok rows affected sec records duplicates warnings what did you see instead mysql alter table user convert to character set collate bin error line column near to character set collate bin total length what version of tidb are you using tidb server v or run select tidb version on tidb tidb version release version alpha git commit hash git branch master utc build time ,1
4266,7022768490.0,IssuesEvent,2017-12-22 12:16:12,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,show current auto_increment ID,compatibility help wanted,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```
create table t(id int primary key auto_increment);
insert into t values(1);
show create table t;
```
2. What did you expect to see?
```
+-------+-----------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+-----------------------------------------------------------------------------------------------------------------------------------------+
| t | CREATE TABLE `t` (
`id` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 |
```
3. What did you see instead?
```
+-------+---------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+---------------------------------------------------------------------------------------------------------------------------------------+
| t | CREATE TABLE `t` (
`id` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin |
+-------+---------------------------------------------------------------------------------------------------------------------------------------+
```
4. What version of TiDB are you using (`tidb-server -V`)?
",True,"show current auto_increment ID - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```
create table t(id int primary key auto_increment);
insert into t values(1);
show create table t;
```
2. What did you expect to see?
```
+-------+-----------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+-----------------------------------------------------------------------------------------------------------------------------------------+
| t | CREATE TABLE `t` (
`id` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 |
```
3. What did you see instead?
```
+-------+---------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+---------------------------------------------------------------------------------------------------------------------------------------+
| t | CREATE TABLE `t` (
`id` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin |
+-------+---------------------------------------------------------------------------------------------------------------------------------------+
```
4. What version of TiDB are you using (`tidb-server -V`)?
",1,show current auto increment id please answer these questions before submitting your issue thanks what did you do create table t id int primary key auto increment insert into t values show create table t what did you expect to see table create table t create table t id int not null auto increment primary key id engine innodb auto increment default charset what did you see instead table create table t create table t id int not null auto increment primary key id engine innodb default charset collate bin what version of tidb are you using tidb server v ,1
5816,8269218042.0,IssuesEvent,2018-09-15 02:52:23,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,[bug] Inconsistent behavior of grant command between MySQL and TiDB,question type/compatibility,"
1. What did you do?
when trying to create different user and different databases, I encountered a inconsistent behavior of grant command between MySQL and TiDB.
To reproduce this, follow the steps below
1. `create database db123;`
2. `grant select,insert,delete on db123.* to '123' identified by 'test';`
3. login with `123:test`
4. `show databases;` there are two databases `information_schema`, `db123`
5. `use information_schema;` `select * from tables;`
tables that not belongs to user `123` appears in the result of last command;
while MySQL behaves normal, user `123` cannot see anything belongs to others.
4. What version of TiDB are you using (`tidb-server -V`)?
Git Commit Hash: 37d8ea3e38209d0f49a0f46c649220f8877b9fd8
UTC Build Time: 2017-07-19 02:19:35
",True,"[bug] Inconsistent behavior of grant command between MySQL and TiDB -
1. What did you do?
when trying to create different user and different databases, I encountered a inconsistent behavior of grant command between MySQL and TiDB.
To reproduce this, follow the steps below
1. `create database db123;`
2. `grant select,insert,delete on db123.* to '123' identified by 'test';`
3. login with `123:test`
4. `show databases;` there are two databases `information_schema`, `db123`
5. `use information_schema;` `select * from tables;`
tables that not belongs to user `123` appears in the result of last command;
while MySQL behaves normal, user `123` cannot see anything belongs to others.
4. What version of TiDB are you using (`tidb-server -V`)?
Git Commit Hash: 37d8ea3e38209d0f49a0f46c649220f8877b9fd8
UTC Build Time: 2017-07-19 02:19:35
",1, inconsistent behavior of grant command between mysql and tidb what did you do when trying to create different user and different databases i encountered a inconsistent behavior of grant command between mysql and tidb to reproduce this follow the steps below create database grant select insert delete on to identified by test login with test show databases there are two databases information schema use information schema select from tables tables that not belongs to user appears in the result of last command; while mysql behaves normal user cannot see anything belongs to others what version of tidb are you using tidb server v git commit hash utc build time ,1
13130,15420035529.0,IssuesEvent,2021-03-05 10:58:56,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,The upper limit of `tidb_ddl_reorg_worker_cnt` doesn't work,severity/moderate sig/sql-infra type/bug type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
It seems that we don't set the max value to `maxDDLReorgWorkerCoun`, we can see [code](https://github.com/pingcap/tidb/blob/master/sessionctx/variable/sysvar.go#L679).
And we can update [tidb_ddl_reorg_worker_cnt]( https://docs.pingcap.com/zh/tidb/stable/system-variables#tidb_ddl_reorg_worker_cnt ) too.
### 1. Minimal reproduce step (Required)
```set @@global.tidb_ddl_reorg_worker_cnt=129;```
### 2. What did you expect to see? (Required)
```
tidb> set @@global.tidb_ddl_reorg_worker_cnt=129;
ERROR 1231 (42000): Variable 'tidb_ddl_reorg_worker_cnt' can't be set to the value of '129'
```
### 3. What did you see instead (Required)
```
tidb> set @@global.tidb_ddl_reorg_worker_cnt=129;
Query OK, 0 rows affected (0.00 sec)
```
### 4. What is your TiDB version? (Required)
```
Release Version: v4.0.0-beta.2-2207-gf16801be2
Edition: Community
Git Commit Hash: f16801be23c7923816f05773b7628c176afca368
Git Branch: master
```
",True,"The upper limit of `tidb_ddl_reorg_worker_cnt` doesn't work - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
It seems that we don't set the max value to `maxDDLReorgWorkerCoun`, we can see [code](https://github.com/pingcap/tidb/blob/master/sessionctx/variable/sysvar.go#L679).
And we can update [tidb_ddl_reorg_worker_cnt]( https://docs.pingcap.com/zh/tidb/stable/system-variables#tidb_ddl_reorg_worker_cnt ) too.
### 1. Minimal reproduce step (Required)
```set @@global.tidb_ddl_reorg_worker_cnt=129;```
### 2. What did you expect to see? (Required)
```
tidb> set @@global.tidb_ddl_reorg_worker_cnt=129;
ERROR 1231 (42000): Variable 'tidb_ddl_reorg_worker_cnt' can't be set to the value of '129'
```
### 3. What did you see instead (Required)
```
tidb> set @@global.tidb_ddl_reorg_worker_cnt=129;
Query OK, 0 rows affected (0.00 sec)
```
### 4. What is your TiDB version? (Required)
```
Release Version: v4.0.0-beta.2-2207-gf16801be2
Edition: Community
Git Commit Hash: f16801be23c7923816f05773b7628c176afca368
Git Branch: master
```
",1,the upper limit of tidb ddl reorg worker cnt doesn t work bug report please answer these questions before submitting your issue thanks it seems that we don t set the max value to maxddlreorgworkercoun we can see and we can update too minimal reproduce step required set global tidb ddl reorg worker cnt what did you expect to see required tidb set global tidb ddl reorg worker cnt error variable tidb ddl reorg worker cnt can t be set to the value of what did you see instead required tidb set global tidb ddl reorg worker cnt query ok rows affected sec what is your tidb version required release version beta edition community git commit hash git branch master ,1
7306,9555134683.0,IssuesEvent,2019-05-03 01:21:02,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,`desc` is not compatible with MySQL,for new contributors type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
➜ tidiff git:(master) ✗ tidiff --mysql.db=tt --tidb.db=tt 'select version()'
MySQL(127.0.0.1:3306)> select version()
+-----------+
| version() |
+-----------+
| 8.0.16 |
+-----------+
1 row in set (0.001 sec)
TiDB(127.0.0.1:4000)> select version()
+------------------------------------------+
| version() |
+------------------------------------------+
| 5.7.25-TiDB-v3.0.0-beta.1-187-g5876abd70 |
+------------------------------------------+
1 row in set (0.004 sec)
➜ tidiff git:(master) ✗ tidiff --mysql.db=tt --tidb.db=tt 'create table t2 (a timestamp default current_timestamp on update current_timestamp)'
MySQL(127.0.0.1:3306)> create table t2 (a timestamp default current_timestamp on update current_timestamp)
Empty set
0 row in set (0.007 sec)
TiDB(127.0.0.1:4000)> create table t2 (a timestamp default current_timestamp on update current_timestamp)
Empty set
0 row in set (0.010 sec)
➜ tidiff git:(master) ✗ tidiff --mysql.db=tt --tidb.db=tt desc t2
MySQL(127.0.0.1:3306)> desc t2
+----------------------------------------------------------------------------------------------------+
| Field | Type | Null | Key | Default | Extra |
+----------------------------------------------------------------------------------------------------+
| a | timestamp | YES | | CURRENT_TIMESTAMP | DEFAULT_GENERATED on update CURRENT_TIMESTAMP |
+----------------------------------------------------------------------------------------------------+
1 row in set (0.004 sec)
TiDB(127.0.0.1:4000)> desc t2
+----------------------------------------------------------------------------------+
| Field | Type | Null | Key | Default | Extra |
+----------------------------------------------------------------------------------+
| a | timestamp | YES | | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |
+----------------------------------------------------------------------------------+
1 row in set (0.004 sec)
```
2. What did you expect to see?
The result shoud be same as MySQL
3. What did you see instead?
Showing above.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```TiDB(127.0.0.1:4000)> select tidb_version()
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v3.0.0-beta.1-187-g5876abd70
Git Commit Hash: 5876abd70ccc054704ab0e8cbf02ed129c6efc76
Git Branch: refine-point-get-failpoint
UTC Build Time: 2019-04-30 03:35:49
GoVersion: go version go1.12 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.003 sec)
```
",True,"`desc` is not compatible with MySQL - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
➜ tidiff git:(master) ✗ tidiff --mysql.db=tt --tidb.db=tt 'select version()'
MySQL(127.0.0.1:3306)> select version()
+-----------+
| version() |
+-----------+
| 8.0.16 |
+-----------+
1 row in set (0.001 sec)
TiDB(127.0.0.1:4000)> select version()
+------------------------------------------+
| version() |
+------------------------------------------+
| 5.7.25-TiDB-v3.0.0-beta.1-187-g5876abd70 |
+------------------------------------------+
1 row in set (0.004 sec)
➜ tidiff git:(master) ✗ tidiff --mysql.db=tt --tidb.db=tt 'create table t2 (a timestamp default current_timestamp on update current_timestamp)'
MySQL(127.0.0.1:3306)> create table t2 (a timestamp default current_timestamp on update current_timestamp)
Empty set
0 row in set (0.007 sec)
TiDB(127.0.0.1:4000)> create table t2 (a timestamp default current_timestamp on update current_timestamp)
Empty set
0 row in set (0.010 sec)
➜ tidiff git:(master) ✗ tidiff --mysql.db=tt --tidb.db=tt desc t2
MySQL(127.0.0.1:3306)> desc t2
+----------------------------------------------------------------------------------------------------+
| Field | Type | Null | Key | Default | Extra |
+----------------------------------------------------------------------------------------------------+
| a | timestamp | YES | | CURRENT_TIMESTAMP | DEFAULT_GENERATED on update CURRENT_TIMESTAMP |
+----------------------------------------------------------------------------------------------------+
1 row in set (0.004 sec)
TiDB(127.0.0.1:4000)> desc t2
+----------------------------------------------------------------------------------+
| Field | Type | Null | Key | Default | Extra |
+----------------------------------------------------------------------------------+
| a | timestamp | YES | | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |
+----------------------------------------------------------------------------------+
1 row in set (0.004 sec)
```
2. What did you expect to see?
The result shoud be same as MySQL
3. What did you see instead?
Showing above.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```TiDB(127.0.0.1:4000)> select tidb_version()
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v3.0.0-beta.1-187-g5876abd70
Git Commit Hash: 5876abd70ccc054704ab0e8cbf02ed129c6efc76
Git Branch: refine-point-get-failpoint
UTC Build Time: 2019-04-30 03:35:49
GoVersion: go version go1.12 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.003 sec)
```
",1, desc is not compatible with mysql bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error ➜ tidiff git master ✗ tidiff mysql db tt tidb db tt select version mysql select version version row in set sec tidb select version version tidb beta row in set sec ➜ tidiff git master ✗ tidiff mysql db tt tidb db tt create table a timestamp default current timestamp on update current timestamp mysql create table a timestamp default current timestamp on update current timestamp empty set row in set sec tidb create table a timestamp default current timestamp on update current timestamp empty set row in set sec ➜ tidiff git master ✗ tidiff mysql db tt tidb db tt desc mysql desc field type null key default extra a timestamp yes current timestamp default generated on update current timestamp row in set sec tidb desc field type null key default extra a timestamp yes current timestamp on update current timestamp row in set sec what did you expect to see the result shoud be same as mysql what did you see instead showing above what version of tidb are you using tidb server v or run select tidb version on tidb tidb select tidb version tidb version release version beta git commit hash git branch refine point get failpoint utc build time goversion go version darwin race enabled false tikv min version alpha check table before drop false row in set sec ,1
11774,13888397906.0,IssuesEvent,2020-10-19 06:13:45,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Support for typed system variables when running SELECT @@foreign_key_checks,type/compatibility,"when client queries variable 'foreign_key_checks', tidb sends string value 'OFF' to them. But mysql server always sends '0' or '1' in spite of versions. So any client tools won't raise any exception when talks to mysql server and can parse the value of 'foreign_key_checks' to an integer, while tidb's response will lead to a failure on parsing.
_below are the tcpdump captures:_
**tidb latest**
> 17:21:13.365154 IP 121-36-228-111.4000 > 192.168.0.156.49446: Flags [P.], seq 2183:2280, ack 1663, win 251, options [nop,nop,TS val 2768261666 ecr 2298205247], length 97
E.....@.?..o...,.......&.....<9............
..R""...?.....>....def....@@foreign_key_checks.@@foreign_key_checks...........................OFF....
**mysql server 5.7**
> 17:23:46.235028 IP chaoswork.mysql > chaoswork.57500: Flags [P.], seq 2113:2181, ack 1681, win 512, options [nop,nop,TS val 3449871429 ecr 3449871429], length 68
E..x.[@.@.W""..................)......l.....
...E...E.....*....def....@@foreign_key_checks..?................0...........
**flyway encountered an exception**
>org.flywaydb.core.internal.exception.FlywaySqlException:
Unable to determine value for 'foreign_key_checks' variable
-----------------------------------------------------------
SQL State : 22018
Error Code : 0
Message : Cannot determine value type from string 'OFF' at org.flywaydb.core.internal.database.mysql.MySQLConnection.getIntVariableValue(MySQLConnection.java:64) ~[flyway-core-6.2.4.jar!/:na]
at org.flywaydb.core.internal.database.mysql.MySQLConnection.(MySQLConnection.java:56) ~[flyway-core-6.2.4.jar!/:na]",True,"Support for typed system variables when running SELECT @@foreign_key_checks - when client queries variable 'foreign_key_checks', tidb sends string value 'OFF' to them. But mysql server always sends '0' or '1' in spite of versions. So any client tools won't raise any exception when talks to mysql server and can parse the value of 'foreign_key_checks' to an integer, while tidb's response will lead to a failure on parsing.
_below are the tcpdump captures:_
**tidb latest**
> 17:21:13.365154 IP 121-36-228-111.4000 > 192.168.0.156.49446: Flags [P.], seq 2183:2280, ack 1663, win 251, options [nop,nop,TS val 2768261666 ecr 2298205247], length 97
E.....@.?..o...,.......&.....<9............
..R""...?.....>....def....@@foreign_key_checks.@@foreign_key_checks...........................OFF....
**mysql server 5.7**
> 17:23:46.235028 IP chaoswork.mysql > chaoswork.57500: Flags [P.], seq 2113:2181, ack 1681, win 512, options [nop,nop,TS val 3449871429 ecr 3449871429], length 68
E..x.[@.@.W""..................)......l.....
...E...E.....*....def....@@foreign_key_checks..?................0...........
**flyway encountered an exception**
>org.flywaydb.core.internal.exception.FlywaySqlException:
Unable to determine value for 'foreign_key_checks' variable
-----------------------------------------------------------
SQL State : 22018
Error Code : 0
Message : Cannot determine value type from string 'OFF' at org.flywaydb.core.internal.database.mysql.MySQLConnection.getIntVariableValue(MySQLConnection.java:64) ~[flyway-core-6.2.4.jar!/:na]
at org.flywaydb.core.internal.database.mysql.MySQLConnection.(MySQLConnection.java:56) ~[flyway-core-6.2.4.jar!/:na]",1,support for typed system variables when running select foreign key checks when client queries variable foreign key checks tidb sends string value off to them but mysql server always sends or in spite of versions so any client tools won t raise any exception when talks to mysql server and can parse the value of foreign key checks to an integer while tidb s response will lead to a failure on parsing below are the tcpdump captures tidb latest ip flags seq ack win options length e o r def foreign key checks foreign key checks off mysql server ip chaoswork mysql chaoswork flags seq ack win options length e x w l e e def foreign key checks flyway encountered an exception org flywaydb core internal exception flywaysqlexception unable to determine value for foreign key checks variable sql state error code message cannot determine value type from string off at org flywaydb core internal database mysql mysqlconnection getintvariablevalue mysqlconnection java at org flywaydb core internal database mysql mysqlconnection mysqlconnection java ,1
5635,8120738612.0,IssuesEvent,2018-08-16 04:44:21,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,select from dual can not do order by,for new contributors help wanted type/compatibility,"
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
mysql> select 1 as a from dual order by a;
```
2. What did you expect to see?
```
mysql> select 1 as a from dual order by a;
+---+
| a |
+---+
| 1 |
+---+
```
3. What did you see instead?
```
mysql> select 1 as a from dual order by a;
ERROR 1105 (HY000): line 1 column 29 near "" by a"" (total length 34)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
Release Version: v2.1.0-alpha-25-gdb4888a6-dirty
Git Commit Hash: db4888a6976ad85f81e3e1289d7b7fabc411883a
Git Branch: dev-check-union-limit
UTC Build Time: 2018-06-07 10:56:33
GoVersion: go version go1.10.1 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-2f291dc12b0e05d71eb8873881c3ed11d343d6e6
",True,"select from dual can not do order by -
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
mysql> select 1 as a from dual order by a;
```
2. What did you expect to see?
```
mysql> select 1 as a from dual order by a;
+---+
| a |
+---+
| 1 |
+---+
```
3. What did you see instead?
```
mysql> select 1 as a from dual order by a;
ERROR 1105 (HY000): line 1 column 29 near "" by a"" (total length 34)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
Release Version: v2.1.0-alpha-25-gdb4888a6-dirty
Git Commit Hash: db4888a6976ad85f81e3e1289d7b7fabc411883a
Git Branch: dev-check-union-limit
UTC Build Time: 2018-06-07 10:56:33
GoVersion: go version go1.10.1 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-2f291dc12b0e05d71eb8873881c3ed11d343d6e6
",1,select from dual can not do order by what did you do if possible provide a recipe for reproducing the error mysql select as a from dual order by a what did you expect to see mysql select as a from dual order by a a what did you see instead mysql select as a from dual order by a error line column near by a total length what version of tidb are you using tidb server v or run select tidb version on tidb release version alpha dirty git commit hash git branch dev check union limit utc build time goversion go version linux race enabled false tikv min version alpha ,1
3650,6529459085.0,IssuesEvent,2017-08-30 11:45:07,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,builtin HOUR() compability.,compatibility,"MySQL:
```
mysql> SELECT HOUR('9999999:59:59');
+-----------------------+
| HOUR('9999999:59:59') |
+-----------------------+
| 838 |
+-----------------------+
1 row in set, 1 warning (0.00 sec)
mysql> show warnings;
+---------+------+-------------------------------------------------+
| Level | Code | Message |
+---------+------+-------------------------------------------------+
| Warning | 1292 | Truncated incorrect time value: '9999999:59:59' |
+---------+------+-------------------------------------------------+
1 row in set (0.00 sec)
```
TiDB:
```
mysql> SELECT HOUR('9999999:59:59');
+-----------------------+
| HOUR('9999999:59:59') |
+-----------------------+
| NULL |
+-----------------------+
1 row in set (0.00 sec)
```",True,"builtin HOUR() compability. - MySQL:
```
mysql> SELECT HOUR('9999999:59:59');
+-----------------------+
| HOUR('9999999:59:59') |
+-----------------------+
| 838 |
+-----------------------+
1 row in set, 1 warning (0.00 sec)
mysql> show warnings;
+---------+------+-------------------------------------------------+
| Level | Code | Message |
+---------+------+-------------------------------------------------+
| Warning | 1292 | Truncated incorrect time value: '9999999:59:59' |
+---------+------+-------------------------------------------------+
1 row in set (0.00 sec)
```
TiDB:
```
mysql> SELECT HOUR('9999999:59:59');
+-----------------------+
| HOUR('9999999:59:59') |
+-----------------------+
| NULL |
+-----------------------+
1 row in set (0.00 sec)
```",1,builtin hour compability mysql mysql select hour hour row in set warning sec mysql show warnings level code message warning truncated incorrect time value row in set sec tidb mysql select hour hour null row in set sec ,1
5376,7867323867.0,IssuesEvent,2018-06-23 07:03:41,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,"result of aggregate function ""avg"" is different from mysql",component/expression type/compatibility,"## What did you do?
table schema:
```sql
DROP TABLE IF EXISTS `table10_int_autoinc`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `table10_int_autoinc` (
`col_decimal_40_20_unsigned_key` decimal(40,20) unsigned DEFAULT NULL,
`col_bigint_unsigned` bigint(20) unsigned DEFAULT NULL,
`col_bigint_signed` bigint(20) DEFAULT NULL,
`col_decimal_10_4_signed_key` decimal(10,4) DEFAULT NULL,
`col_double_signed` double DEFAULT NULL,
`col_decimal_6_3_signed` decimal(6,3) DEFAULT NULL,
`col_float_unsigned` float unsigned DEFAULT NULL,
`col_decimal_40_20_unsigned` decimal(40,20) unsigned DEFAULT NULL,
`col_varchar_20` varchar(20) DEFAULT NULL,
`col_decimal_10_4_unsigned_key` decimal(10,4) unsigned DEFAULT NULL,
`col_float_signed_key` float DEFAULT NULL,
`col_decimal_10_4_unsigned` decimal(10,4) unsigned DEFAULT NULL,
`col_decimal_10_4_signed` decimal(10,4) DEFAULT NULL,
`col_char_20` char(20) DEFAULT NULL,
`col_double_unsigned` double unsigned DEFAULT NULL,
`col_char_20_key` char(20) DEFAULT NULL,
`col_decimal_40_20_signed` decimal(40,20) DEFAULT NULL,
`col_decimal_6_3_unsigned_key` decimal(6,3) unsigned DEFAULT NULL,
`pk` int(11) NOT NULL AUTO_INCREMENT,
`col_decimal_40_20_signed_key` decimal(40,20) DEFAULT NULL,
`col_bigint_signed_key` bigint(20) DEFAULT NULL,
`col_double_unsigned_key` double unsigned DEFAULT NULL,
`col_decimal_6_3_signed_key` decimal(6,3) DEFAULT NULL,
`col_decimal_6_3_unsigned` decimal(6,3) unsigned DEFAULT NULL,
`col_bigint_unsigned_key` bigint(20) unsigned DEFAULT NULL,
`col_varchar_20_key` varchar(20) DEFAULT NULL,
`col_float_signed` float DEFAULT NULL,
`col_double_signed_key` double DEFAULT NULL,
`col_float_unsigned_key` float unsigned DEFAULT NULL,
PRIMARY KEY (`pk`),
KEY `col_decimal_40_20_unsigned_key` (`col_decimal_40_20_unsigned_key`),
KEY `col_decimal_10_4_signed_key` (`col_decimal_10_4_signed_key`),
KEY `col_decimal_10_4_unsigned_key` (`col_decimal_10_4_unsigned_key`),
KEY `col_float_signed_key` (`col_float_signed_key`),
KEY `col_char_20_key` (`col_char_20_key`),
KEY `col_decimal_6_3_unsigned_key` (`col_decimal_6_3_unsigned_key`),
KEY `col_decimal_40_20_signed_key` (`col_decimal_40_20_signed_key`),
KEY `col_bigint_signed_key` (`col_bigint_signed_key`),
KEY `col_double_unsigned_key` (`col_double_unsigned_key`),
KEY `col_decimal_6_3_signed_key` (`col_decimal_6_3_signed_key`),
KEY `col_bigint_unsigned_key` (`col_bigint_unsigned_key`),
KEY `col_varchar_20_key` (`col_varchar_20_key`),
KEY `col_double_signed_key` (`col_double_signed_key`),
KEY `col_float_unsigned_key` (`col_float_unsigned_key`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
LOCK TABLES `table10_int_autoinc` WRITE;
/*!40000 ALTER TABLE `table10_int_autoinc` DISABLE KEYS */;
INSERT INTO `table10_int_autoinc` VALUES (1.00900000000000000000,NULL,1,12.9910,1.009,1.000,0,0.00000000000000000000,'k',21425.0000,1.09878,0.1123,-0.9871,'his',0.999999999,'back',-9.18230000000000000000,0.000,1,12.99100000000000000000,-46,0,1.009,0.000,1,'come',-3810,-0.999999999,0);
INSERT INTO `table10_int_autoinc` VALUES (0.00000001000000000000,0,-111,NULL,-0.987103,-0.987,0,0.00000001000000000000,'y',0.1123,1,0.0000,1.0988,'vqnq',0,'u',6.00000000000000000000,0.112,2,0.99999999900000000000,13,0,-1.000,0.112,0,'i',-111.121,0.112345,0);
INSERT INTO `table10_int_autoinc` VALUES (0.00000000000000000000,1,-111,NULL,-24052,-999.999,0,12.99100000000000000000,'bvqnqnmfvvlh',0.0000,-0.987103,1.0988,1.0988,NULL,1.098781,'w',12.99100000000000000000,0.000,3,12.99100000000000000000,0,0,0.112,0.000,0,'he\'s',1.009,-0.987103,12.9873);
INSERT INTO `table10_int_autoinc` VALUES (0.00000000000000000000,13,NULL,0.0000,0.112345,40.000,0,1.09878100000000000000,'ybvqnq',0.0000,0,0.0000,-15621.0000,'she',0.112345,'been',-9.18230000000000000000,1.000,4,-0.99999999900000000000,13,12.98731,-999.999,0.000,62,NULL,1,12.991,0);
INSERT INTO `table10_int_autoinc` VALUES (0.00000001000000000000,0,1,12.9910,-0.999999999,12.991,NULL,0.00000000000000000000,NULL,0.0000,0.00000001,0.0000,-23.0000,NULL,0,'z',1.00900000000000000000,0.000,5,-0.98710300000000000000,-6515,0,1.000,1.000,0,'e',1.009,-0.000000001,1.09878);
INSERT INTO `table10_int_autoinc` VALUES (0.00000000000000000000,1,-111,-0.9871,-0.987103,-111.121,0,0.11234500000000000000,'x',0.0000,0.112345,1.0988,1.0988,NULL,0,NULL,-0.98710300000000000000,1.000,6,-9.18230000000000000000,-9,0.999999999,1.099,0.000,0,'what',-1,0.00000001,1.09878);
INSERT INTO `table10_int_autoinc` VALUES (0.00000000000000000000,1,-111,-24990.0000,0.999999999,0.000,0,0.00000000000000000000,'n',12.9873,1,12.9910,1.0000,NULL,28,NULL,12.98731000000000000000,12.987,7,-0.00000000100000000000,1,1.098781,1.000,999.999,0,NULL,12.9873,NULL,0);
INSERT INTO `table10_int_autoinc` VALUES (0.00000001000000000000,0,-1,-0.9871,-0.987103,0.000,0,0.00000000000000000000,'s',12.9873,0.00000001,0.0000,1.0000,'would',0,'i',-11.00000000000000000000,0.000,8,-0.98710300000000000000,-1,0,NULL,0.000,24267,NULL,0,21710,32612);
INSERT INTO `table10_int_autoinc` VALUES (0.00000000000000000000,13,81,-2763.0000,0.999999999,0.000,0,0.99999999900000000000,'it\'s',0.0000,1.009,0.0000,-5202.0000,'w',0,'m',-0.00000000100000000000,12.991,9,0.99999999900000000000,1,0,1.099,0.112,0,'rzybvqnqnm',-0.987103,-53,0);
INSERT INTO `table10_int_autoinc` VALUES (1.09878100000000000000,0,0,NULL,-9.1823,-0.987,0,12.98731000000000000000,'when',0.0000,0.00000001,0.0000,12.9910,'when',12.98731,NULL,0.00000001000000000000,0.000,10,0.11234500000000000000,0,18857,1.099,0.000,0,'for',12.9873,-24,NULL);
/*!40000 ALTER TABLE `table10_int_autoinc` ENABLE KEYS */;
```
query is:
```sql
select a, avg(b) as b from (select `col_double_signed` as a, `col_double_signed_key` as b from `table10_int_autoinc`) tmp group by a order by lower(a), b;
```
## What did you expect to see?
```sql
MySQL(localhost:3306) > select a, avg(b) as b from (select `col_double_signed` as a, `col_double_signed_key` as b from `table10_int_autoinc`) tmp group by a order by lower(a), b;
+--------------+-------------------+
| a | b |
+--------------+-------------------+
| -0.987103 | 7236.704115003333 |
| -0.999999999 | -0.000000001 |
| -24052 | -0.987103 |
| -9.1823 | -24 |
| 0.112345 | 12.991 |
| 0.999999999 | -53 |
| 1.009 | -0.999999999 |
+--------------+-------------------+
7 rows in set (0.00 sec)
```
## What did you see instead?
```sql
TiDB(localhost:4000) > select a, avg(b) as b from (select `col_double_signed` as a, `col_double_signed_key` as b from `table10_int_autoinc`) tmp group by a order by lower(a), b;
+--------------+-------------------+
| a | b |
+--------------+-------------------+
| -0.987103 | 7236.704115003334 |
| -0.999999999 | -0.000000001 |
| -24052 | -0.987103 |
| -9.1823 | -24 |
| 0.112345 | 12.991 |
| 0.999999999 | -53 |
| 1.009 | -0.999999999 |
+--------------+-------------------+
7 rows in set (0.00 sec)
```
The first result of `avg(b)` should be **7236.704115003333** instead of **7236.704115003334**
## What version of TiDB are you using?
```sql
TiDB(localhost:4000) > select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v2.1.0-alpha-67-g20c56758
Git Commit Hash: 20c5675831ef0619956d1be5e11b4754c2632536
Git Branch: master
UTC Build Time: 2018-06-23 06:45:01
GoVersion: go version go1.10 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
1 row in set (0.00 sec)
```
",True,"result of aggregate function ""avg"" is different from mysql - ## What did you do?
table schema:
```sql
DROP TABLE IF EXISTS `table10_int_autoinc`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `table10_int_autoinc` (
`col_decimal_40_20_unsigned_key` decimal(40,20) unsigned DEFAULT NULL,
`col_bigint_unsigned` bigint(20) unsigned DEFAULT NULL,
`col_bigint_signed` bigint(20) DEFAULT NULL,
`col_decimal_10_4_signed_key` decimal(10,4) DEFAULT NULL,
`col_double_signed` double DEFAULT NULL,
`col_decimal_6_3_signed` decimal(6,3) DEFAULT NULL,
`col_float_unsigned` float unsigned DEFAULT NULL,
`col_decimal_40_20_unsigned` decimal(40,20) unsigned DEFAULT NULL,
`col_varchar_20` varchar(20) DEFAULT NULL,
`col_decimal_10_4_unsigned_key` decimal(10,4) unsigned DEFAULT NULL,
`col_float_signed_key` float DEFAULT NULL,
`col_decimal_10_4_unsigned` decimal(10,4) unsigned DEFAULT NULL,
`col_decimal_10_4_signed` decimal(10,4) DEFAULT NULL,
`col_char_20` char(20) DEFAULT NULL,
`col_double_unsigned` double unsigned DEFAULT NULL,
`col_char_20_key` char(20) DEFAULT NULL,
`col_decimal_40_20_signed` decimal(40,20) DEFAULT NULL,
`col_decimal_6_3_unsigned_key` decimal(6,3) unsigned DEFAULT NULL,
`pk` int(11) NOT NULL AUTO_INCREMENT,
`col_decimal_40_20_signed_key` decimal(40,20) DEFAULT NULL,
`col_bigint_signed_key` bigint(20) DEFAULT NULL,
`col_double_unsigned_key` double unsigned DEFAULT NULL,
`col_decimal_6_3_signed_key` decimal(6,3) DEFAULT NULL,
`col_decimal_6_3_unsigned` decimal(6,3) unsigned DEFAULT NULL,
`col_bigint_unsigned_key` bigint(20) unsigned DEFAULT NULL,
`col_varchar_20_key` varchar(20) DEFAULT NULL,
`col_float_signed` float DEFAULT NULL,
`col_double_signed_key` double DEFAULT NULL,
`col_float_unsigned_key` float unsigned DEFAULT NULL,
PRIMARY KEY (`pk`),
KEY `col_decimal_40_20_unsigned_key` (`col_decimal_40_20_unsigned_key`),
KEY `col_decimal_10_4_signed_key` (`col_decimal_10_4_signed_key`),
KEY `col_decimal_10_4_unsigned_key` (`col_decimal_10_4_unsigned_key`),
KEY `col_float_signed_key` (`col_float_signed_key`),
KEY `col_char_20_key` (`col_char_20_key`),
KEY `col_decimal_6_3_unsigned_key` (`col_decimal_6_3_unsigned_key`),
KEY `col_decimal_40_20_signed_key` (`col_decimal_40_20_signed_key`),
KEY `col_bigint_signed_key` (`col_bigint_signed_key`),
KEY `col_double_unsigned_key` (`col_double_unsigned_key`),
KEY `col_decimal_6_3_signed_key` (`col_decimal_6_3_signed_key`),
KEY `col_bigint_unsigned_key` (`col_bigint_unsigned_key`),
KEY `col_varchar_20_key` (`col_varchar_20_key`),
KEY `col_double_signed_key` (`col_double_signed_key`),
KEY `col_float_unsigned_key` (`col_float_unsigned_key`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
LOCK TABLES `table10_int_autoinc` WRITE;
/*!40000 ALTER TABLE `table10_int_autoinc` DISABLE KEYS */;
INSERT INTO `table10_int_autoinc` VALUES (1.00900000000000000000,NULL,1,12.9910,1.009,1.000,0,0.00000000000000000000,'k',21425.0000,1.09878,0.1123,-0.9871,'his',0.999999999,'back',-9.18230000000000000000,0.000,1,12.99100000000000000000,-46,0,1.009,0.000,1,'come',-3810,-0.999999999,0);
INSERT INTO `table10_int_autoinc` VALUES (0.00000001000000000000,0,-111,NULL,-0.987103,-0.987,0,0.00000001000000000000,'y',0.1123,1,0.0000,1.0988,'vqnq',0,'u',6.00000000000000000000,0.112,2,0.99999999900000000000,13,0,-1.000,0.112,0,'i',-111.121,0.112345,0);
INSERT INTO `table10_int_autoinc` VALUES (0.00000000000000000000,1,-111,NULL,-24052,-999.999,0,12.99100000000000000000,'bvqnqnmfvvlh',0.0000,-0.987103,1.0988,1.0988,NULL,1.098781,'w',12.99100000000000000000,0.000,3,12.99100000000000000000,0,0,0.112,0.000,0,'he\'s',1.009,-0.987103,12.9873);
INSERT INTO `table10_int_autoinc` VALUES (0.00000000000000000000,13,NULL,0.0000,0.112345,40.000,0,1.09878100000000000000,'ybvqnq',0.0000,0,0.0000,-15621.0000,'she',0.112345,'been',-9.18230000000000000000,1.000,4,-0.99999999900000000000,13,12.98731,-999.999,0.000,62,NULL,1,12.991,0);
INSERT INTO `table10_int_autoinc` VALUES (0.00000001000000000000,0,1,12.9910,-0.999999999,12.991,NULL,0.00000000000000000000,NULL,0.0000,0.00000001,0.0000,-23.0000,NULL,0,'z',1.00900000000000000000,0.000,5,-0.98710300000000000000,-6515,0,1.000,1.000,0,'e',1.009,-0.000000001,1.09878);
INSERT INTO `table10_int_autoinc` VALUES (0.00000000000000000000,1,-111,-0.9871,-0.987103,-111.121,0,0.11234500000000000000,'x',0.0000,0.112345,1.0988,1.0988,NULL,0,NULL,-0.98710300000000000000,1.000,6,-9.18230000000000000000,-9,0.999999999,1.099,0.000,0,'what',-1,0.00000001,1.09878);
INSERT INTO `table10_int_autoinc` VALUES (0.00000000000000000000,1,-111,-24990.0000,0.999999999,0.000,0,0.00000000000000000000,'n',12.9873,1,12.9910,1.0000,NULL,28,NULL,12.98731000000000000000,12.987,7,-0.00000000100000000000,1,1.098781,1.000,999.999,0,NULL,12.9873,NULL,0);
INSERT INTO `table10_int_autoinc` VALUES (0.00000001000000000000,0,-1,-0.9871,-0.987103,0.000,0,0.00000000000000000000,'s',12.9873,0.00000001,0.0000,1.0000,'would',0,'i',-11.00000000000000000000,0.000,8,-0.98710300000000000000,-1,0,NULL,0.000,24267,NULL,0,21710,32612);
INSERT INTO `table10_int_autoinc` VALUES (0.00000000000000000000,13,81,-2763.0000,0.999999999,0.000,0,0.99999999900000000000,'it\'s',0.0000,1.009,0.0000,-5202.0000,'w',0,'m',-0.00000000100000000000,12.991,9,0.99999999900000000000,1,0,1.099,0.112,0,'rzybvqnqnm',-0.987103,-53,0);
INSERT INTO `table10_int_autoinc` VALUES (1.09878100000000000000,0,0,NULL,-9.1823,-0.987,0,12.98731000000000000000,'when',0.0000,0.00000001,0.0000,12.9910,'when',12.98731,NULL,0.00000001000000000000,0.000,10,0.11234500000000000000,0,18857,1.099,0.000,0,'for',12.9873,-24,NULL);
/*!40000 ALTER TABLE `table10_int_autoinc` ENABLE KEYS */;
```
query is:
```sql
select a, avg(b) as b from (select `col_double_signed` as a, `col_double_signed_key` as b from `table10_int_autoinc`) tmp group by a order by lower(a), b;
```
## What did you expect to see?
```sql
MySQL(localhost:3306) > select a, avg(b) as b from (select `col_double_signed` as a, `col_double_signed_key` as b from `table10_int_autoinc`) tmp group by a order by lower(a), b;
+--------------+-------------------+
| a | b |
+--------------+-------------------+
| -0.987103 | 7236.704115003333 |
| -0.999999999 | -0.000000001 |
| -24052 | -0.987103 |
| -9.1823 | -24 |
| 0.112345 | 12.991 |
| 0.999999999 | -53 |
| 1.009 | -0.999999999 |
+--------------+-------------------+
7 rows in set (0.00 sec)
```
## What did you see instead?
```sql
TiDB(localhost:4000) > select a, avg(b) as b from (select `col_double_signed` as a, `col_double_signed_key` as b from `table10_int_autoinc`) tmp group by a order by lower(a), b;
+--------------+-------------------+
| a | b |
+--------------+-------------------+
| -0.987103 | 7236.704115003334 |
| -0.999999999 | -0.000000001 |
| -24052 | -0.987103 |
| -9.1823 | -24 |
| 0.112345 | 12.991 |
| 0.999999999 | -53 |
| 1.009 | -0.999999999 |
+--------------+-------------------+
7 rows in set (0.00 sec)
```
The first result of `avg(b)` should be **7236.704115003333** instead of **7236.704115003334**
## What version of TiDB are you using?
```sql
TiDB(localhost:4000) > select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v2.1.0-alpha-67-g20c56758
Git Commit Hash: 20c5675831ef0619956d1be5e11b4754c2632536
Git Branch: master
UTC Build Time: 2018-06-23 06:45:01
GoVersion: go version go1.10 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
1 row in set (0.00 sec)
```
",1,result of aggregate function avg is different from mysql what did you do table schema sql drop table if exists int autoinc set saved cs client character set client set character set client create table int autoinc col decimal unsigned key decimal unsigned default null col bigint unsigned bigint unsigned default null col bigint signed bigint default null col decimal signed key decimal default null col double signed double default null col decimal signed decimal default null col float unsigned float unsigned default null col decimal unsigned decimal unsigned default null col varchar varchar default null col decimal unsigned key decimal unsigned default null col float signed key float default null col decimal unsigned decimal unsigned default null col decimal signed decimal default null col char char default null col double unsigned double unsigned default null col char key char default null col decimal signed decimal default null col decimal unsigned key decimal unsigned default null pk int not null auto increment col decimal signed key decimal default null col bigint signed key bigint default null col double unsigned key double unsigned default null col decimal signed key decimal default null col decimal unsigned decimal unsigned default null col bigint unsigned key bigint unsigned default null col varchar key varchar default null col float signed float default null col double signed key double default null col float unsigned key float unsigned default null primary key pk key col decimal unsigned key col decimal unsigned key key col decimal signed key col decimal signed key key col decimal unsigned key col decimal unsigned key key col float signed key col float signed key key col char key col char key key col decimal unsigned key col decimal unsigned key key col decimal signed key col decimal signed key key col bigint signed key col bigint signed key key col double unsigned key col double unsigned key key col decimal signed key col decimal signed key key col bigint unsigned key col bigint unsigned key key col varchar key col varchar key key col double signed key col double signed key key col float unsigned key col float unsigned key engine innodb auto increment default charset set character set client saved cs client lock tables int autoinc write alter table int autoinc disable keys insert into int autoinc values null k his back come insert into int autoinc values null y vqnq u i insert into int autoinc values null bvqnqnmfvvlh null w he s insert into int autoinc values null ybvqnq she been null insert into int autoinc values null null null z e insert into int autoinc values x null null what insert into int autoinc values n null null null null insert into int autoinc values s would i null null insert into int autoinc values it s w m rzybvqnqnm insert into int autoinc values null when when null for null alter table int autoinc enable keys query is sql select a avg b as b from select col double signed as a col double signed key as b from int autoinc tmp group by a order by lower a b what did you expect to see sql mysql localhost select a avg b as b from select col double signed as a col double signed key as b from int autoinc tmp group by a order by lower a b a b rows in set sec what did you see instead sql tidb localhost select a avg b as b from select col double signed as a col double signed key as b from int autoinc tmp group by a order by lower a b a b rows in set sec the first result of avg b should be instead of what version of tidb are you using sql tidb localhost select tidb version g row tidb version release version alpha git commit hash git branch master utc build time goversion go version darwin race enabled false tikv min version alpha row in set sec ,1
16541,22494253185.0,IssuesEvent,2022-06-23 05:50:39,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,cast string as time behaviour is incompatible with MySQL,type/bug type/compatibility sig/execution severity/moderate,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```sql
SELECT cast(""0000-00-00"" as TIME);
```
Related: https://github.com/go-sql-driver/mysql/pull/1331
### 2. What did you expect to see? (Required)
In MySQL 8.0
```sql
>SELECT cast(""0000-00-00"" as TIME);
+----------------------------+
| cast(""0000-00-00"" as TIME) |
+----------------------------+
| 00:00:00 |
+----------------------------+
```
### 3. What did you see instead (Required)
In TiDB
```sql
>SELECT cast(""0000-00-00"" as TIME);
+----------------------------+
| cast(""0000-00-00"" as TIME) |
+----------------------------+
| |
+----------------------------+
```
### 4. What is your TiDB version? (Required)
```sql
>select tidb_version()\G
***************************[ 1. row ]***************************
tidb_version() | Release Version: v6.1.0-alpha-360-gab26a287dc
Edition: Community
Git Commit Hash: ab26a287dcbe4186d327cfcaa74bf945db83a338
Git Branch: master
UTC Build Time: 2022-05-10 08:32:31
GoVersion: go1.18
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
```",True,"cast string as time behaviour is incompatible with MySQL - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```sql
SELECT cast(""0000-00-00"" as TIME);
```
Related: https://github.com/go-sql-driver/mysql/pull/1331
### 2. What did you expect to see? (Required)
In MySQL 8.0
```sql
>SELECT cast(""0000-00-00"" as TIME);
+----------------------------+
| cast(""0000-00-00"" as TIME) |
+----------------------------+
| 00:00:00 |
+----------------------------+
```
### 3. What did you see instead (Required)
In TiDB
```sql
>SELECT cast(""0000-00-00"" as TIME);
+----------------------------+
| cast(""0000-00-00"" as TIME) |
+----------------------------+
| |
+----------------------------+
```
### 4. What is your TiDB version? (Required)
```sql
>select tidb_version()\G
***************************[ 1. row ]***************************
tidb_version() | Release Version: v6.1.0-alpha-360-gab26a287dc
Edition: Community
Git Commit Hash: ab26a287dcbe4186d327cfcaa74bf945db83a338
Git Branch: master
UTC Build Time: 2022-05-10 08:32:31
GoVersion: go1.18
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
```",1,cast string as time behaviour is incompatible with mysql bug report please answer these questions before submitting your issue thanks minimal reproduce step required sql select cast as time related what did you expect to see required in mysql sql select cast as time cast as time what did you see instead required in tidb sql select cast as time cast as time what is your tidb version required sql select tidb version g tidb version release version alpha edition community git commit hash git branch master utc build time goversion race enabled false tikv min version check table before drop false ,1
6989,9276492237.0,IssuesEvent,2019-03-20 03:10:09,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,can not set variable in update statement,help wanted type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
create table tt (id int, v int);
insert into tt (id, v) values (1, 0);
update tt set v = @lv := v + 1 where id = 1;
select @lv;
```
2. What did you expect to see?
```
mysql> select @lv;
+------+
| @lv |
+------+
| 1 |
+------+
1 row in set (0.00 sec)
mysql> select * from tt;
+------+------+
| id | v |
+------+------+
| 1 | 1 |
+------+------+
1 row in set (0.00 sec)
```
3. What did you see instead?
```
mysql> select @lv;
+------+
| @lv |
+------+
| NULL |
+------+
1 row in set (0.00 sec)
mysql> select * from tt;
+------+------+
| id | v |
+------+------+
| 1 | NULL |
+------+------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
Release Version: None
Git Commit Hash: None
Git Branch: None
UTC Build Time: None
GoVersion: None
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
```",True,"can not set variable in update statement - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
create table tt (id int, v int);
insert into tt (id, v) values (1, 0);
update tt set v = @lv := v + 1 where id = 1;
select @lv;
```
2. What did you expect to see?
```
mysql> select @lv;
+------+
| @lv |
+------+
| 1 |
+------+
1 row in set (0.00 sec)
mysql> select * from tt;
+------+------+
| id | v |
+------+------+
| 1 | 1 |
+------+------+
1 row in set (0.00 sec)
```
3. What did you see instead?
```
mysql> select @lv;
+------+
| @lv |
+------+
| NULL |
+------+
1 row in set (0.00 sec)
mysql> select * from tt;
+------+------+
| id | v |
+------+------+
| 1 | NULL |
+------+------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
Release Version: None
Git Commit Hash: None
Git Branch: None
UTC Build Time: None
GoVersion: None
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
```",1,can not set variable in update statement bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error create table tt id int v int insert into tt id v values update tt set v lv v where id select lv what did you expect to see mysql select lv lv row in set sec mysql select from tt id v row in set sec what did you see instead mysql select lv lv null row in set sec mysql select from tt id v null row in set sec what version of tidb are you using tidb server v or run select tidb version on tidb release version none git commit hash none git branch none utc build time none goversion none race enabled false tikv min version alpha check table before drop false ,1
12416,14671604502.0,IssuesEvent,2020-12-30 08:36:12,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Can't omit `from table dual` in `insert into select`,component/parser good-first-issue status/help-wanted type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
create table t(a int);
insert into t select 1 where 1 = 1;
```
2. What did you expect to see?
execute success
3. What did you see instead?
```
ERROR 1064 (42000): 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 32 near ""where 1 = 1""
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
3.0.8
| Release Version: None
Git Commit Hash: None
Git Branch: None
UTC Build Time: None
GoVersion: go1.13.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
```
",True,"Can't omit `from table dual` in `insert into select` - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
create table t(a int);
insert into t select 1 where 1 = 1;
```
2. What did you expect to see?
execute success
3. What did you see instead?
```
ERROR 1064 (42000): 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 32 near ""where 1 = 1""
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
3.0.8
| Release Version: None
Git Commit Hash: None
Git Branch: None
UTC Build Time: None
GoVersion: go1.13.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
```
",1,can t omit from table dual in insert into select bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error create table t a int insert into t select where what did you expect to see execute success what did you see instead error you have an error in your sql syntax check the manual that corresponds to your tidb version for the right syntax to use line column near where what version of tidb are you using tidb server v or run select tidb version on tidb release version none git commit hash none git branch none utc build time none goversion race enabled false tikv min version check table before drop false ,1
16273,21900773414.0,IssuesEvent,2022-05-20 13:13:25,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,query result of union statement is not stable,type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```sql
SELECT 1 AS col1, 2 AS col2 UNION SELECT 3, 4;
```
### 2. What did you expect to see? (Required)
A stable result, like MySQL result is always:
```sql
test> SELECT 1 AS col1, 2 AS col2 UNION SELECT 3, 4;
+------+------+
| col1 | col2 |
+------+------+
| 1 | 2 |
| 3 | 4 |
+------+------+
2 rows in set
```
### 3. What did you see instead (Required)
unstable result:
```
test> SELECT 1 AS col1, 2 AS col2 UNION SELECT 3, 4;
+------+------+
| col1 | col2 |
+------+------+
| 1 | 2 |
| 3 | 4 |
+------+------+
2 rows in set
Time: 0.005s
test> SELECT 1 AS col1, 2 AS col2 UNION SELECT 3, 4;
+------+------+
| col1 | col2 |
+------+------+
| 3 | 4 |
| 1 | 2 |
+------+------+
2 rows in set
Time: 0.005s
```
### 4. What is your TiDB version? (Required)
```sql
***************************[ 1. row ]***************************
tidb_version() | Release Version: v6.1.0-alpha-432-gd75b06ec97
Edition: Community
Git Commit Hash: d75b06ec97e54ef9f5a15630e7dfee30d22f047e
Git Branch: master
UTC Build Time: 2022-05-17 07:29:42
GoVersion: go1.18
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
```
",True,"query result of union statement is not stable - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```sql
SELECT 1 AS col1, 2 AS col2 UNION SELECT 3, 4;
```
### 2. What did you expect to see? (Required)
A stable result, like MySQL result is always:
```sql
test> SELECT 1 AS col1, 2 AS col2 UNION SELECT 3, 4;
+------+------+
| col1 | col2 |
+------+------+
| 1 | 2 |
| 3 | 4 |
+------+------+
2 rows in set
```
### 3. What did you see instead (Required)
unstable result:
```
test> SELECT 1 AS col1, 2 AS col2 UNION SELECT 3, 4;
+------+------+
| col1 | col2 |
+------+------+
| 1 | 2 |
| 3 | 4 |
+------+------+
2 rows in set
Time: 0.005s
test> SELECT 1 AS col1, 2 AS col2 UNION SELECT 3, 4;
+------+------+
| col1 | col2 |
+------+------+
| 3 | 4 |
| 1 | 2 |
+------+------+
2 rows in set
Time: 0.005s
```
### 4. What is your TiDB version? (Required)
```sql
***************************[ 1. row ]***************************
tidb_version() | Release Version: v6.1.0-alpha-432-gd75b06ec97
Edition: Community
Git Commit Hash: d75b06ec97e54ef9f5a15630e7dfee30d22f047e
Git Branch: master
UTC Build Time: 2022-05-17 07:29:42
GoVersion: go1.18
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
```
",1,query result of union statement is not stable bug report please answer these questions before submitting your issue thanks minimal reproduce step required sql select as as union select what did you expect to see required a stable result like mysql result is always sql test select as as union select rows in set what did you see instead required unstable result test select as as union select rows in set time test select as as union select rows in set time what is your tidb version required sql tidb version release version alpha edition community git commit hash git branch master utc build time goversion race enabled false tikv min version check table before drop false ,1
11517,13507184306.0,IssuesEvent,2020-09-14 05:19:07,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,The default year should be '0000' instead of '2000',component/expression severity/major type/bug type/compatibility,"## Bug Report
1. What did you do?
```sql
create table w(a int);
insert into w values (1);
alter table w add column b year(4) not null;
select * from w;
```
2. What did you expect to see?
```
mysql> select * from w;
+------+------+
| a | b |
+------+------+
| 1 | 0000 |
+------+------+
1 row in set (0.00 sec)
```
3. What did you see instead?
```
mysql> select * from w;
+------+------+
| a | b |
+------+------+
| 1 | 2000 |
+------+------+
1 row in set (0.00 sec)
```
Seems to be missed with fixing #8291.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v4.0.0-alpha-685-g5b161df35
Git Commit Hash: 5b161df3533db3dce6badca54c867b95f4a0d672
Git Branch: master
UTC Build Time: 2019-11-02 10:21:24
GoVersion: go version go1.13.3 linux/amd64
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.00 sec)
```",True,"The default year should be '0000' instead of '2000' - ## Bug Report
1. What did you do?
```sql
create table w(a int);
insert into w values (1);
alter table w add column b year(4) not null;
select * from w;
```
2. What did you expect to see?
```
mysql> select * from w;
+------+------+
| a | b |
+------+------+
| 1 | 0000 |
+------+------+
1 row in set (0.00 sec)
```
3. What did you see instead?
```
mysql> select * from w;
+------+------+
| a | b |
+------+------+
| 1 | 2000 |
+------+------+
1 row in set (0.00 sec)
```
Seems to be missed with fixing #8291.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v4.0.0-alpha-685-g5b161df35
Git Commit Hash: 5b161df3533db3dce6badca54c867b95f4a0d672
Git Branch: master
UTC Build Time: 2019-11-02 10:21:24
GoVersion: go version go1.13.3 linux/amd64
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.00 sec)
```",1,the default year should be instead of bug report what did you do sql create table w a int insert into w values alter table w add column b year not null select from w what did you expect to see mysql select from w a b row in set sec what did you see instead mysql select from w a b row in set sec seems to be missed with fixing what version of tidb are you using tidb server v or run select tidb version on tidb mysql select tidb version g row tidb version release version alpha git commit hash git branch master utc build time goversion go version linux race enabled false tikv min version check table before drop false row in set sec ,1
6252,8641571142.0,IssuesEvent,2018-11-24 19:10:03,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,incorrect result of cast double to datetime,help wanted type/compatibility,"## 1. What did you do?
```sql
select cast(20040101.01234567 as datetime(3));
```
## 2. What did you expect to see?
```sql
MySQL > select cast(20040101.01234567 as datetime(3));
+----------------------------------------+
| cast(20040101.01234567 as datetime(3)) |
+----------------------------------------+
| 2004-01-01 00:00:00.000 |
+----------------------------------------+
1 row in set (0.00 sec)
```
## 3. What did you see instead?
```sql
TiDB > select cast(20040101.01234567 as datetime(3));
+----------------------------------------+
| cast(20040101.01234567 as datetime(3)) |
+----------------------------------------+
| 2004-01-01 00:00:00.012 |
+----------------------------------------+
1 row in set (0.00 sec)
```
## 4. What version of TiDB are you using (`tidb-server -V`)?
```sh
$./bin/tidb-server -V
Release Version: 0.9.0
Git Commit Hash: 31a48f8d757630bba930973b66a380103d038c3c
Git Commit Branch: master
UTC Build Time: 2017-09-07 06:37:43
```
",True,"incorrect result of cast double to datetime - ## 1. What did you do?
```sql
select cast(20040101.01234567 as datetime(3));
```
## 2. What did you expect to see?
```sql
MySQL > select cast(20040101.01234567 as datetime(3));
+----------------------------------------+
| cast(20040101.01234567 as datetime(3)) |
+----------------------------------------+
| 2004-01-01 00:00:00.000 |
+----------------------------------------+
1 row in set (0.00 sec)
```
## 3. What did you see instead?
```sql
TiDB > select cast(20040101.01234567 as datetime(3));
+----------------------------------------+
| cast(20040101.01234567 as datetime(3)) |
+----------------------------------------+
| 2004-01-01 00:00:00.012 |
+----------------------------------------+
1 row in set (0.00 sec)
```
## 4. What version of TiDB are you using (`tidb-server -V`)?
```sh
$./bin/tidb-server -V
Release Version: 0.9.0
Git Commit Hash: 31a48f8d757630bba930973b66a380103d038c3c
Git Commit Branch: master
UTC Build Time: 2017-09-07 06:37:43
```
",1,incorrect result of cast double to datetime what did you do sql select cast as datetime what did you expect to see sql mysql select cast as datetime cast as datetime row in set sec what did you see instead sql tidb select cast as datetime cast as datetime row in set sec what version of tidb are you using tidb server v sh bin tidb server v release version git commit hash git commit branch master utc build time ,1
7609,9859060291.0,IssuesEvent,2019-06-20 08:44:51,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Window function panicked when range bound is time type,component/executor type/bug type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
CREATE TABLE `t_time` (
`t` time DEFAULT NULL,
`ts` timestamp NULL DEFAULT NULL
)
INSERT INTO t_time VALUES ('12:30', '2016-07-05 08:30:42');
SELECT t, FIRST_VALUE(t) OVER (ORDER BY t RANGE BETWEEN INTERVAL 2 HOUR PRECEDING AND INTERVAL 2 HOUR_MINUTE PRECEDING) FROM t_time;
```
2. What did you expect to see?
Execute successfully.
3. What did you see instead?
Panicked.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
",True,"Window function panicked when range bound is time type - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
CREATE TABLE `t_time` (
`t` time DEFAULT NULL,
`ts` timestamp NULL DEFAULT NULL
)
INSERT INTO t_time VALUES ('12:30', '2016-07-05 08:30:42');
SELECT t, FIRST_VALUE(t) OVER (ORDER BY t RANGE BETWEEN INTERVAL 2 HOUR PRECEDING AND INTERVAL 2 HOUR_MINUTE PRECEDING) FROM t_time;
```
2. What did you expect to see?
Execute successfully.
3. What did you see instead?
Panicked.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
",1,window function panicked when range bound is time type bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error create table t time t time default null ts timestamp null default null insert into t time values select t first value t over order by t range between interval hour preceding and interval hour minute preceding from t time what did you expect to see execute successfully what did you see instead panicked what version of tidb are you using tidb server v or run select tidb version on tidb ,1
18507,25714264128.0,IssuesEvent,2022-12-07 09:14:14,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,enable foreign_key_checks variable by default ,type/compatibility,"## Dev Task
The default value of `foreign_key_checks` in MySQL is `true`, but TiDB is `false`. Since TiDB already supported foreign key, PM @easonn7 thinks the default value of `foreign_key_checks` should be consistent with MySQL.",True,"enable foreign_key_checks variable by default - ## Dev Task
The default value of `foreign_key_checks` in MySQL is `true`, but TiDB is `false`. Since TiDB already supported foreign key, PM @easonn7 thinks the default value of `foreign_key_checks` should be consistent with MySQL.",1,enable foreign key checks variable by default dev task the default value of foreign key checks in mysql is true but tidb is false since tidb already supported foreign key pm thinks the default value of foreign key checks should be consistent with mysql ,1
12311,14565686756.0,IssuesEvent,2020-12-17 07:42:50,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Datetime compare incompatible with MySQL,challenge-program severity/moderate sig/execution status/help-wanted type/bug type/compatibility,"## Description
## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```
CREATE TABLE t(d datetime);
INSERT INTO t(d) VALUES('2019-08-10 11:45:14');
SELECT d, d > 1 FROM t;
SELECT COUNT(1) FROM t WHERE d > 1;
```
2. What did you expect to see?
* MySQL 8.0
```
mysql> CREATE TABLE t(d datetime);
Query OK, 0 rows affected (0.01 sec)
mysql> INSERT INTO t(d) VALUES('2019-08-10 11:45:14');
Query OK, 1 row affected (0.00 sec)
mysql> SELECT d, d > 1 FROM t;
+---------------------+-------+
| d | d > 1 |
+---------------------+-------+
| 2019-08-10 11:45:14 | 1 |
+---------------------+-------+
1 row in set, 1 warning (0.02 sec)
mysql> SELECT COUNT(1) FROM t WHERE d > 1;
+----------+
| COUNT(1) |
+----------+
| 1 |
+----------+
1 row in set, 1 warning (0.04 sec)
mysql> SELECT version();
+-----------+
| version() |
+-----------+
| 8.0.18 |
+-----------+
1 row in set (0.00 sec)
```
3. What did you see instead?
* TiDB 3.0.7
```
mysql> CREATE TABLE t(d datetime);
Query OK, 0 rows affected (1.01 sec)
mysql> INSERT INTO t(d) VALUES('2019-08-10 11:45:14');
Query OK, 1 row affected (0.01 sec)
mysql> SELECT d, d > 1 FROM t;
+---------------------+-------+
| d | d > 1 |
+---------------------+-------+
| 2019-08-10 11:45:14 | NULL |
+---------------------+-------+
1 row in set, 1 warning (0.01 sec)
mysql> SELECT COUNT(1) FROM t WHERE d > 1;
+----------+
| COUNT(1) |
+----------+
| 0 |
+----------+
1 row in set, 1 warning (0.00 sec)
mysql> SELECT version();
+--------------------+
| version() |
+--------------------+
| 5.7.25-TiDB-v3.0.7 |
+--------------------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
Release Version: v3.0.7
Git Commit Hash: 84e4386c7a77d4b8df5db7f2303fb7fd3370eb9a
Git Branch: HEAD
UTC Build Time: 2019-12-04 10:08:24
GoVersion: go version go1.13 linux/amd64
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
```
## SIG slack channel
[#sig-exec](https://slack.tidb.io/invite?team=tidb-community&channel=sig-exec&ref=high-performance)
## Score
300
## Mentor
- @lzmhhh123
",True,"Datetime compare incompatible with MySQL - ## Description
## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```
CREATE TABLE t(d datetime);
INSERT INTO t(d) VALUES('2019-08-10 11:45:14');
SELECT d, d > 1 FROM t;
SELECT COUNT(1) FROM t WHERE d > 1;
```
2. What did you expect to see?
* MySQL 8.0
```
mysql> CREATE TABLE t(d datetime);
Query OK, 0 rows affected (0.01 sec)
mysql> INSERT INTO t(d) VALUES('2019-08-10 11:45:14');
Query OK, 1 row affected (0.00 sec)
mysql> SELECT d, d > 1 FROM t;
+---------------------+-------+
| d | d > 1 |
+---------------------+-------+
| 2019-08-10 11:45:14 | 1 |
+---------------------+-------+
1 row in set, 1 warning (0.02 sec)
mysql> SELECT COUNT(1) FROM t WHERE d > 1;
+----------+
| COUNT(1) |
+----------+
| 1 |
+----------+
1 row in set, 1 warning (0.04 sec)
mysql> SELECT version();
+-----------+
| version() |
+-----------+
| 8.0.18 |
+-----------+
1 row in set (0.00 sec)
```
3. What did you see instead?
* TiDB 3.0.7
```
mysql> CREATE TABLE t(d datetime);
Query OK, 0 rows affected (1.01 sec)
mysql> INSERT INTO t(d) VALUES('2019-08-10 11:45:14');
Query OK, 1 row affected (0.01 sec)
mysql> SELECT d, d > 1 FROM t;
+---------------------+-------+
| d | d > 1 |
+---------------------+-------+
| 2019-08-10 11:45:14 | NULL |
+---------------------+-------+
1 row in set, 1 warning (0.01 sec)
mysql> SELECT COUNT(1) FROM t WHERE d > 1;
+----------+
| COUNT(1) |
+----------+
| 0 |
+----------+
1 row in set, 1 warning (0.00 sec)
mysql> SELECT version();
+--------------------+
| version() |
+--------------------+
| 5.7.25-TiDB-v3.0.7 |
+--------------------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
Release Version: v3.0.7
Git Commit Hash: 84e4386c7a77d4b8df5db7f2303fb7fd3370eb9a
Git Branch: HEAD
UTC Build Time: 2019-12-04 10:08:24
GoVersion: go version go1.13 linux/amd64
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
```
## SIG slack channel
[#sig-exec](https://slack.tidb.io/invite?team=tidb-community&channel=sig-exec&ref=high-performance)
## Score
300
## Mentor
- @lzmhhh123
",1,datetime compare incompatible with mysql description bug report please answer these questions before submitting your issue thanks what did you do create table t d datetime insert into t d values select d d from t select count from t where d what did you expect to see mysql mysql create table t d datetime query ok rows affected sec mysql insert into t d values query ok row affected sec mysql select d d from t d d row in set warning sec mysql select count from t where d count row in set warning sec mysql select version version row in set sec what did you see instead tidb mysql create table t d datetime query ok rows affected sec mysql insert into t d values query ok row affected sec mysql select d d from t d d null row in set warning sec mysql select count from t where d count row in set warning sec mysql select version version tidb row in set sec what version of tidb are you using tidb server v or run select tidb version on tidb release version git commit hash git branch head utc build time goversion go version linux race enabled false tikv min version check table before drop false sig slack channel score mentor ,1
7372,9621030170.0,IssuesEvent,2019-05-14 09:40:55,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Function `period_diff ` is not compatible with MySQL 8.0,component/expression help wanted type/bug type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
Function `period_diff` is not compatible with MySQL 8.0
2. What did you expect to see?
MySQL 8.0:
```
mysql> SELECT PERIOD_diff(-00013,1);
ERROR 1210 (HY000): Incorrect arguments to period_diff
```
3. What did you see instead?
TiDB
```
mysql> SELECT PERIOD_diff(-00013,1);
+-----------------------+
| PERIOD_diff(-00013,1) |
+-----------------------+
| 2213609288845122194 |
+-----------------------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
mysql> select tidb_version();
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v3.0.0-beta.1-218-g2f7241138-dirty
Git Commit Hash: 2f7241138adfc434f4b199ecae68fb83ad33b36b
Git Branch: myfeature-perioddiff
UTC Build Time: 2019-05-07 03:36:21
GoVersion: go version go1.11.4 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
",True,"Function `period_diff ` is not compatible with MySQL 8.0 - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
Function `period_diff` is not compatible with MySQL 8.0
2. What did you expect to see?
MySQL 8.0:
```
mysql> SELECT PERIOD_diff(-00013,1);
ERROR 1210 (HY000): Incorrect arguments to period_diff
```
3. What did you see instead?
TiDB
```
mysql> SELECT PERIOD_diff(-00013,1);
+-----------------------+
| PERIOD_diff(-00013,1) |
+-----------------------+
| 2213609288845122194 |
+-----------------------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
mysql> select tidb_version();
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v3.0.0-beta.1-218-g2f7241138-dirty
Git Commit Hash: 2f7241138adfc434f4b199ecae68fb83ad33b36b
Git Branch: myfeature-perioddiff
UTC Build Time: 2019-05-07 03:36:21
GoVersion: go version go1.11.4 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
",1,function period diff is not compatible with mysql bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error function period diff is not compatible with mysql what did you expect to see mysql mysql select period diff error incorrect arguments to period diff what did you see instead tidb mysql select period diff period diff row in set sec what version of tidb are you using tidb server v or run select tidb version on tidb mysql select tidb version tidb version release version beta dirty git commit hash git branch myfeature perioddiff utc build time goversion go version darwin race enabled false tikv min version alpha check table before drop false row in set sec ,1
492602,14216489279.0,IssuesEvent,2020-11-17 09:03:43,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Different results of Function :=(Assign a value),Priority/P3 challenge-program component/expression difficulty/easy high-performance severity/critical sig/execution status/help-wanted type/bug,"## Description
## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```mysql
SELECT 'x' = ( @A := 0 ) ;
```
2. What did you expect to see?
```mysql
mysql> SELECT 'x' = ( @A := 0 ) ;
+-------------------+
| 'x' = ( @A := 0 ) |
+-------------------+
| 1 |
+-------------------+
1 row in set, 1 warning (0.00 sec)
mysql> show warnings;
+---------+------+-------------------------------------------------------------------------------------------------------------------+
| Level | Code | Message |
+---------+------+-------------------------------------------------------------------------------------------------------------------+
| Warning | 1292 | Truncated incorrect DOUBLE value: 'x' |
+---------+------+-------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
```mysql
mysql> SELECT 'x' = ( @A := 0 ) ;
+-------------------+
| 'x' = ( @A := 0 ) |
+-------------------+
| 0 |
+-------------------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
0ea1bf0
## SIG slack channel
[#sig-exec](https://tidbcommunity.slack.com/archives/CMRD79DRR)
## Score
- 300
## Mentor
* @lzmhhh123
",1.0,"Different results of Function :=(Assign a value) - ## Description
## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```mysql
SELECT 'x' = ( @A := 0 ) ;
```
2. What did you expect to see?
```mysql
mysql> SELECT 'x' = ( @A := 0 ) ;
+-------------------+
| 'x' = ( @A := 0 ) |
+-------------------+
| 1 |
+-------------------+
1 row in set, 1 warning (0.00 sec)
mysql> show warnings;
+---------+------+-------------------------------------------------------------------------------------------------------------------+
| Level | Code | Message |
+---------+------+-------------------------------------------------------------------------------------------------------------------+
| Warning | 1292 | Truncated incorrect DOUBLE value: 'x' |
+---------+------+-------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
```mysql
mysql> SELECT 'x' = ( @A := 0 ) ;
+-------------------+
| 'x' = ( @A := 0 ) |
+-------------------+
| 0 |
+-------------------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
0ea1bf0
## SIG slack channel
[#sig-exec](https://tidbcommunity.slack.com/archives/CMRD79DRR)
## Score
- 300
## Mentor
* @lzmhhh123
",0,different results of function assign a value description bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error mysql select x a what did you expect to see mysql mysql select x a x a row in set warning sec mysql show warnings level code message warning truncated incorrect double value x row in set sec what did you see instead mysql mysql select x a x a row in set sec what version of tidb are you using tidb server v or run select tidb version on tidb sig slack channel score mentor ,0
5069,7669083261.0,IssuesEvent,2018-05-14 08:31:41,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Different results from MySQL and tidb,compatibility,"1. What did you do?
Execute the statement: `select 1, 2, 3 from dual union select * from t limit 1 offset 2;`.
2. What did you expect to see?
http://sqlfiddle.com/#!9/ce0a4a/1
3. What did you see instead?
![image](https://user-images.githubusercontent.com/6451933/37590921-b8696f1e-2ba4-11e8-9878-8ba252625a93.png)
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
Release Version: v2.0.0-rc.1
Git Commit Hash: 4a52a6ae580224a62b2c17707e64720af26c88fd
Git Branch: release-2.0
UTC Build Time: 2018-03-09 02:12:41
GoVersion: go version go1.10 linux/amd64
TiKV Min Version: 1.1.0-dev.2
```
",True,"Different results from MySQL and tidb - 1. What did you do?
Execute the statement: `select 1, 2, 3 from dual union select * from t limit 1 offset 2;`.
2. What did you expect to see?
http://sqlfiddle.com/#!9/ce0a4a/1
3. What did you see instead?
![image](https://user-images.githubusercontent.com/6451933/37590921-b8696f1e-2ba4-11e8-9878-8ba252625a93.png)
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
Release Version: v2.0.0-rc.1
Git Commit Hash: 4a52a6ae580224a62b2c17707e64720af26c88fd
Git Branch: release-2.0
UTC Build Time: 2018-03-09 02:12:41
GoVersion: go version go1.10 linux/amd64
TiKV Min Version: 1.1.0-dev.2
```
",1,different results from mysql and tidb what did you do execute the statement select from dual union select from t limit offset what did you expect to see what did you see instead what version of tidb are you using tidb server v or run select tidb version on tidb release version rc git commit hash git branch release utc build time goversion go version linux tikv min version dev ,1
6175,8578663847.0,IssuesEvent,2018-11-13 06:16:32,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,incorrect column value of type `year` for zero input,component/server type/bug type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
From TiDB:
```
mysql> create table tbl(a year(4));
Query OK, 0 rows affected (0.13 sec)
mysql> insert into tbl values(0);
Query OK, 1 row affected (0.00 sec)
mysql> select * from tbl;
+------+
| a |
+------+
| 2000 |
+------+
1 row in set (0.00 sec)
mysql> insert into tbl values('0');
Query OK, 1 row affected (0.00 sec)
mysql> select * from tbl;
+------+
| a |
+------+
| 2000 |
| 2000 |
+------+
2 rows in set (0.00 sec)
```
2. What did you expect to see?
From MySQL:
```
mysql> create table tbl(a year(4));
Query OK, 0 rows affected (0.02 sec)
mysql> insert into tbl values(0);
Query OK, 1 row affected (0.01 sec)
mysql> select * from tbl;
+------+
| a |
+------+
| 0000 |
+------+
1 row in set (0.00 sec)
mysql> insert into tbl values('0');
Query OK, 1 row affected (0.01 sec)
mysql> select * from tbl;
+------+
| a |
+------+
| 0000 |
| 2000 |
+------+
2 rows in set (0.00 sec)
```
3. What did you see instead?
Incompatible behavior with MySQL. According to https://dev.mysql.com/doc/refman/5.7/en/two-digit-years.html:
> For YEAR, the rules are the same, with this exception: A numeric 00 inserted into YEAR(4) results in 0000 rather than 2000. To specify zero for YEAR(4) and have it be interpreted as 2000, specify it as a string '0' or '00'.
We need to handle this exception.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
mysql> select version();
+--------------------------------------+
| version() |
+--------------------------------------+
| 5.7.10-TiDB-v2.1.0-rc.3-175-gf7d8ca6 |
+--------------------------------------+
1 row in set (0.00 sec)
```",True,"incorrect column value of type `year` for zero input - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
From TiDB:
```
mysql> create table tbl(a year(4));
Query OK, 0 rows affected (0.13 sec)
mysql> insert into tbl values(0);
Query OK, 1 row affected (0.00 sec)
mysql> select * from tbl;
+------+
| a |
+------+
| 2000 |
+------+
1 row in set (0.00 sec)
mysql> insert into tbl values('0');
Query OK, 1 row affected (0.00 sec)
mysql> select * from tbl;
+------+
| a |
+------+
| 2000 |
| 2000 |
+------+
2 rows in set (0.00 sec)
```
2. What did you expect to see?
From MySQL:
```
mysql> create table tbl(a year(4));
Query OK, 0 rows affected (0.02 sec)
mysql> insert into tbl values(0);
Query OK, 1 row affected (0.01 sec)
mysql> select * from tbl;
+------+
| a |
+------+
| 0000 |
+------+
1 row in set (0.00 sec)
mysql> insert into tbl values('0');
Query OK, 1 row affected (0.01 sec)
mysql> select * from tbl;
+------+
| a |
+------+
| 0000 |
| 2000 |
+------+
2 rows in set (0.00 sec)
```
3. What did you see instead?
Incompatible behavior with MySQL. According to https://dev.mysql.com/doc/refman/5.7/en/two-digit-years.html:
> For YEAR, the rules are the same, with this exception: A numeric 00 inserted into YEAR(4) results in 0000 rather than 2000. To specify zero for YEAR(4) and have it be interpreted as 2000, specify it as a string '0' or '00'.
We need to handle this exception.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
mysql> select version();
+--------------------------------------+
| version() |
+--------------------------------------+
| 5.7.10-TiDB-v2.1.0-rc.3-175-gf7d8ca6 |
+--------------------------------------+
1 row in set (0.00 sec)
```",1,incorrect column value of type year for zero input bug report please answer these questions before submitting your issue thanks what did you do from tidb mysql create table tbl a year query ok rows affected sec mysql insert into tbl values query ok row affected sec mysql select from tbl a row in set sec mysql insert into tbl values query ok row affected sec mysql select from tbl a rows in set sec what did you expect to see from mysql mysql create table tbl a year query ok rows affected sec mysql insert into tbl values query ok row affected sec mysql select from tbl a row in set sec mysql insert into tbl values query ok row affected sec mysql select from tbl a rows in set sec what did you see instead incompatible behavior with mysql according to for year the rules are the same with this exception a numeric inserted into year results in rather than to specify zero for year and have it be interpreted as specify it as a string or we need to handle this exception what version of tidb are you using tidb server v or run select tidb version on tidb mysql select version version tidb rc row in set sec ,1
17245,23786746380.0,IssuesEvent,2022-09-02 10:50:27,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,create json value from string with binary charset should report error,type/enhancement type/compatibility component/json,"## Enhancement
In MySQL 5.7, creating a json key from the blob value will give an error:
```
create table t (s varchar(255), b blob);
insert into t values (""a string"", X'ABCD');
insert into t values (""b string"", X'DCBA');
select json_objectagg(b,s) from t;
```
Will give an error: `ERROR 3144 (22032): Cannot create a JSON value from a string with CHARACTER SET 'binary'.`.
In TiDB, it will give: `{""\ufffd\ufffd"": ""a string"", ""ܺ"": ""b string""} `",True,"create json value from string with binary charset should report error - ## Enhancement
In MySQL 5.7, creating a json key from the blob value will give an error:
```
create table t (s varchar(255), b blob);
insert into t values (""a string"", X'ABCD');
insert into t values (""b string"", X'DCBA');
select json_objectagg(b,s) from t;
```
Will give an error: `ERROR 3144 (22032): Cannot create a JSON value from a string with CHARACTER SET 'binary'.`.
In TiDB, it will give: `{""\ufffd\ufffd"": ""a string"", ""ܺ"": ""b string""} `",1,create json value from string with binary charset should report error enhancement in mysql creating a json key from the blob value will give an error create table t s varchar b blob insert into t values a string x abcd insert into t values b string x dcba select json objectagg b s from t will give an error error cannot create a json value from a string with character set binary in tidb it will give ufffd ufffd a string ܺ b string ,1
7376,9629016732.0,IssuesEvent,2019-05-15 08:39:40,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,Casting string to real is not compatible with MySQL,component/expression help wanted type/bug type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
create table t (a varchar(30));
insert into t values (2), ("""");
select * from t where a=2;
show warnings;
delete from t where a=2;
```
2. What did you expect to see?
```
mysql> create table t (a varchar(30));
Query OK, 0 rows affected (0.05 sec)
mysql> insert into t values (2), ("""");
Query OK, 2 rows affected (0.01 sec)
Records: 2 Duplicates: 0 Warnings: 0
mysql> select * from t where a=2;
+------+
| a |
+------+
| 2 |
+------+
1 row in set (0.00 sec)
mysql> show warnings;
Empty set (0.00 sec)
mysql> delete from t where a=2;
Query OK, 1 row affected (0.05 sec)
```
3. What did you see instead?
```
mysql> create table t (a varchar(30));
Query OK, 0 rows affected (0.00 sec)
mysql> insert into t values (2), ("""");
Query OK, 2 rows affected (0.01 sec)
Records: 2 Duplicates: 0 Warnings: 0
mysql> select * from t where a=2;
+------+
| a |
+------+
| 2 |
+------+
1 row in set, 1 warning (0.00 sec)
mysql> show warnings;
+---------+------+----------------+
| Level | Code | Message |
+---------+------+----------------+
| Warning | 1265 | Data Truncated |
+---------+------+----------------+
1 row in set (0.00 sec)
mysql> delete from t where a=2;
ERROR 1265 (01000): Data Truncated
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
mysql> select tidb_version();
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v3.0.0-rc.1-58-gfc2768c02
Git Commit Hash: fc2768c0297be90925cea1b83b3bb0b7997ec00b
Git Branch: fix-10181
UTC Build Time: 2019-05-15 08:31:51
GoVersion: go version go1.12 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
",True,"Casting string to real is not compatible with MySQL - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
create table t (a varchar(30));
insert into t values (2), ("""");
select * from t where a=2;
show warnings;
delete from t where a=2;
```
2. What did you expect to see?
```
mysql> create table t (a varchar(30));
Query OK, 0 rows affected (0.05 sec)
mysql> insert into t values (2), ("""");
Query OK, 2 rows affected (0.01 sec)
Records: 2 Duplicates: 0 Warnings: 0
mysql> select * from t where a=2;
+------+
| a |
+------+
| 2 |
+------+
1 row in set (0.00 sec)
mysql> show warnings;
Empty set (0.00 sec)
mysql> delete from t where a=2;
Query OK, 1 row affected (0.05 sec)
```
3. What did you see instead?
```
mysql> create table t (a varchar(30));
Query OK, 0 rows affected (0.00 sec)
mysql> insert into t values (2), ("""");
Query OK, 2 rows affected (0.01 sec)
Records: 2 Duplicates: 0 Warnings: 0
mysql> select * from t where a=2;
+------+
| a |
+------+
| 2 |
+------+
1 row in set, 1 warning (0.00 sec)
mysql> show warnings;
+---------+------+----------------+
| Level | Code | Message |
+---------+------+----------------+
| Warning | 1265 | Data Truncated |
+---------+------+----------------+
1 row in set (0.00 sec)
mysql> delete from t where a=2;
ERROR 1265 (01000): Data Truncated
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
mysql> select tidb_version();
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v3.0.0-rc.1-58-gfc2768c02
Git Commit Hash: fc2768c0297be90925cea1b83b3bb0b7997ec00b
Git Branch: fix-10181
UTC Build Time: 2019-05-15 08:31:51
GoVersion: go version go1.12 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
",1,casting string to real is not compatible with mysql bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error create table t a varchar insert into t values select from t where a show warnings delete from t where a what did you expect to see mysql create table t a varchar query ok rows affected sec mysql insert into t values query ok rows affected sec records duplicates warnings mysql select from t where a a row in set sec mysql show warnings empty set sec mysql delete from t where a query ok row affected sec what did you see instead mysql create table t a varchar query ok rows affected sec mysql insert into t values query ok rows affected sec records duplicates warnings mysql select from t where a a row in set warning sec mysql show warnings level code message warning data truncated row in set sec mysql delete from t where a error data truncated what version of tidb are you using tidb server v or run select tidb version on tidb mysql select tidb version tidb version release version rc git commit hash git branch fix utc build time goversion go version darwin race enabled false tikv min version alpha check table before drop false row in set sec ,1
3987,6817949731.0,IssuesEvent,2017-11-07 02:13:38,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,alter table tab1 add (col3 type1) is not supported in tidb,compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
tidb doesn't support () in add column clause:
`ALTER TABLE resource_index ADD (component_uuid VARCHAR (50) NULL);`
2. What did you expect to see?
```
mysql> ALTER TABLE resource_index ADD (component_uuid VARCHAR (50) NULL);
Query OK, 0 rows affected (0.06 sec)
Records: 0 Duplicates: 0 Warnings: 0
```
3. What did you see instead?
```
MySQL [sonar]> ALTER TABLE resource_index ADD (component_uuid VARCHAR (50) NULL);
ERROR 1105 (HY000): line 0 column 32 near ""component_uuid VARCHAR (50) NULL)"" (total length 65)
MySQL [sonar]> ALTER TABLE resource_index ADD component_uuid VARCHAR (50) NULL;
Query OK, 0 rows affected (0.46 sec)
```
4. What version of TiDB are you using (`tidb-server -V`)?
Release Version: 0.9.0
Git Commit Hash: fa87ec45a9acf93fc6e740ecb617b4a100d0d867
Git Branch: HEAD
UTC Build Time: 2017-09-24 01:38:26 |
",True,"alter table tab1 add (col3 type1) is not supported in tidb - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
tidb doesn't support () in add column clause:
`ALTER TABLE resource_index ADD (component_uuid VARCHAR (50) NULL);`
2. What did you expect to see?
```
mysql> ALTER TABLE resource_index ADD (component_uuid VARCHAR (50) NULL);
Query OK, 0 rows affected (0.06 sec)
Records: 0 Duplicates: 0 Warnings: 0
```
3. What did you see instead?
```
MySQL [sonar]> ALTER TABLE resource_index ADD (component_uuid VARCHAR (50) NULL);
ERROR 1105 (HY000): line 0 column 32 near ""component_uuid VARCHAR (50) NULL)"" (total length 65)
MySQL [sonar]> ALTER TABLE resource_index ADD component_uuid VARCHAR (50) NULL;
Query OK, 0 rows affected (0.46 sec)
```
4. What version of TiDB are you using (`tidb-server -V`)?
Release Version: 0.9.0
Git Commit Hash: fa87ec45a9acf93fc6e740ecb617b4a100d0d867
Git Branch: HEAD
UTC Build Time: 2017-09-24 01:38:26 |
",1,alter table add is not supported in tidb please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error tidb doesn t support in add column clause alter table resource index add component uuid varchar null what did you expect to see mysql alter table resource index add component uuid varchar null query ok rows affected sec records duplicates warnings what did you see instead mysql alter table resource index add component uuid varchar null error line column near component uuid varchar null total length mysql alter table resource index add component uuid varchar null query ok rows affected sec what version of tidb are you using tidb server v release version git commit hash git branch head utc build time ,1
3637,6524200471.0,IssuesEvent,2017-08-29 11:45:09,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Incorrect Decimal inference for float literal,bug compatibility for-new-contributors help wanted,"MySQL:
```
mysql> SELECT 151113102019e0;
Field 1: `151113102019e0`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
Length: 14
Max_length: 12
Decimals: 31
Flags: NOT_NULL BINARY NUM
+----------------+
| 151113102019e0 |
+----------------+
| 151113102019 |
+----------------+
1 row in set (0.00 sec)
mysql> SELECT 15111310201912e-2;
Field 1: `15111310201912e-2`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
Length: 17
Max_length: 15
Decimals: 31
Flags: NOT_NULL BINARY NUM
+-------------------+
| 15111310201912e-2 |
+-------------------+
| 151113102019.12 |
+-------------------+
1 row in set (0.00 sec)
```
TiDB:
```
mysql> SELECT 151113102019e0;
Field 1: `151113102019e0`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
Length: 12
Max_length: 25
Decimals: 12
Flags: BINARY NUM
+---------------------------+
| 151113102019e0 |
+---------------------------+
| 151113102019.000000000000 |
+---------------------------+
1 row in set (0.00 sec)
mysql> SELECT 15111310201912e-2;
Field 1: `15111310201912e-2`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
Length: 15
Max_length: 15
Decimals: 2
Flags: BINARY NUM
+-------------------+
| 15111310201912e-2 |
+-------------------+
| 151113102019.12 |
+-------------------+
1 row in set (0.00 sec)
```",True,"Incorrect Decimal inference for float literal - MySQL:
```
mysql> SELECT 151113102019e0;
Field 1: `151113102019e0`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
Length: 14
Max_length: 12
Decimals: 31
Flags: NOT_NULL BINARY NUM
+----------------+
| 151113102019e0 |
+----------------+
| 151113102019 |
+----------------+
1 row in set (0.00 sec)
mysql> SELECT 15111310201912e-2;
Field 1: `15111310201912e-2`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
Length: 17
Max_length: 15
Decimals: 31
Flags: NOT_NULL BINARY NUM
+-------------------+
| 15111310201912e-2 |
+-------------------+
| 151113102019.12 |
+-------------------+
1 row in set (0.00 sec)
```
TiDB:
```
mysql> SELECT 151113102019e0;
Field 1: `151113102019e0`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
Length: 12
Max_length: 25
Decimals: 12
Flags: BINARY NUM
+---------------------------+
| 151113102019e0 |
+---------------------------+
| 151113102019.000000000000 |
+---------------------------+
1 row in set (0.00 sec)
mysql> SELECT 15111310201912e-2;
Field 1: `15111310201912e-2`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
Length: 15
Max_length: 15
Decimals: 2
Flags: BINARY NUM
+-------------------+
| 15111310201912e-2 |
+-------------------+
| 151113102019.12 |
+-------------------+
1 row in set (0.00 sec)
```",1,incorrect decimal inference for float literal mysql mysql select field catalog def database table org table type double collation binary length max length decimals flags not null binary num row in set sec mysql select field catalog def database table org table type double collation binary length max length decimals flags not null binary num row in set sec tidb mysql select field catalog def database table org table type double collation binary length max length decimals flags binary num row in set sec mysql select field catalog def database table org table type double collation binary length max length decimals flags binary num row in set sec ,1
3839,6690511347.0,IssuesEvent,2017-10-09 09:24:38,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,default unsigned integer column length is not consistent with MySQL.,compatibility,"Please answer these questions before submitting your issue. Thanks!
```
mysql> create table `t1` (`c1` tinyint unsigned default null, `c2` smallint unsigned default null, `c3` mediumint unsigned default null, `c4` int unsigned default null, `c5` bigint unsigned default null);
Query OK, 0 rows affected (0.01 sec)
mysql> show create table t1;
+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| t1 | CREATE TABLE `t1` (
`c1` tinyint(3) unsigned DEFAULT NULL,
`c2` smallint(5) unsigned DEFAULT NULL,
`c3` mediumint(8) unsigned DEFAULT NULL,
`c4` int(10) unsigned DEFAULT NULL,
`c5` bigint(20) unsigned DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
TiDB:
```
mysql> create table `t1` (`c1` tinyint unsigned default null, `c2` smallint unsigned default null, `c3` mediumint unsigned default null, `c4` int unsigned default null, `c5` bigint unsigned default null);
Query OK, 0 rows affected (0.09 sec)
mysql> show create table t1;
+-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table
|
+-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| t1 | CREATE TABLE `t1` (
`c1` tinyint(4) UNSIGNED DEFAULT NULL,
`c2` smallint(6) UNSIGNED DEFAULT NULL,
`c3` mediumint(9) UNSIGNED DEFAULT NULL,
`c4` int(11) UNSIGNED DEFAULT NULL,
`c5` bigint(20) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin |
+-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
version:
```
mysql> select tidb_version();
+-----------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+-----------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: 0.9.0
Git Commit Hash: e599ceec2b32b450a1e42ef49cdf5be7ea5853da
Git Branch: master
UTC Build Time: 2017-09-26 07:32:19 |
+-----------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
",True,"default unsigned integer column length is not consistent with MySQL. - Please answer these questions before submitting your issue. Thanks!
```
mysql> create table `t1` (`c1` tinyint unsigned default null, `c2` smallint unsigned default null, `c3` mediumint unsigned default null, `c4` int unsigned default null, `c5` bigint unsigned default null);
Query OK, 0 rows affected (0.01 sec)
mysql> show create table t1;
+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| t1 | CREATE TABLE `t1` (
`c1` tinyint(3) unsigned DEFAULT NULL,
`c2` smallint(5) unsigned DEFAULT NULL,
`c3` mediumint(8) unsigned DEFAULT NULL,
`c4` int(10) unsigned DEFAULT NULL,
`c5` bigint(20) unsigned DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
TiDB:
```
mysql> create table `t1` (`c1` tinyint unsigned default null, `c2` smallint unsigned default null, `c3` mediumint unsigned default null, `c4` int unsigned default null, `c5` bigint unsigned default null);
Query OK, 0 rows affected (0.09 sec)
mysql> show create table t1;
+-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table
|
+-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| t1 | CREATE TABLE `t1` (
`c1` tinyint(4) UNSIGNED DEFAULT NULL,
`c2` smallint(6) UNSIGNED DEFAULT NULL,
`c3` mediumint(9) UNSIGNED DEFAULT NULL,
`c4` int(11) UNSIGNED DEFAULT NULL,
`c5` bigint(20) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin |
+-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
version:
```
mysql> select tidb_version();
+-----------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+-----------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: 0.9.0
Git Commit Hash: e599ceec2b32b450a1e42ef49cdf5be7ea5853da
Git Branch: master
UTC Build Time: 2017-09-26 07:32:19 |
+-----------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
",1,default unsigned integer column length is not consistent with mysql please answer these questions before submitting your issue thanks mysql create table tinyint unsigned default null smallint unsigned default null mediumint unsigned default null int unsigned default null bigint unsigned default null query ok rows affected sec mysql show create table table create table create table tinyint unsigned default null smallint unsigned default null mediumint unsigned default null int unsigned default null bigint unsigned default null engine innodb default charset row in set sec tidb mysql create table tinyint unsigned default null smallint unsigned default null mediumint unsigned default null int unsigned default null bigint unsigned default null query ok rows affected sec mysql show create table table create table create table tinyint unsigned default null smallint unsigned default null mediumint unsigned default null int unsigned default null bigint unsigned default null engine innodb default charset collate bin row in set sec version mysql select tidb version tidb version release version git commit hash git branch master utc build time row in set sec ,1
16233,21796759895.0,IssuesEvent,2022-05-15 18:53:51,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,TiDB gives a different result with `SET GLOBAL table_open_cache=-1;` ,type/compatibility,"## Bug Report
### 1. Minimal reproduce step
```sql
SET GLOBAL table_open_cache=-1;
SHOW VARIABLES LIKE 'table_open_cache';
```
### 2. What did you expect to see?
```sql
mysql> SHOW VARIABLES LIKE 'table_open_cache';
+------------------+-------+
| Variable_name | Value |
+------------------+-------+
| table_open_cache | 1 |
+------------------+-------+
1 row in set (0.03 sec)
```
### 3. What did you see instead
```sql
TiDB> SHOW VARIABLES LIKE 'table_open_cache';
+------------------+-------+
| Variable_name | Value |
+------------------+-------+
| table_open_cache | -1 |
+------------------+-------+
1 row in set (0.01 sec)
```
### 4. What is your TiDB version?
```sql
tidb_version(): Release Version: v5.2.2
Edition: Community
Git Commit Hash: da1c21fd45a4ea5900ac16d2f4a248143f378d18
Git Branch: heads/refs/tags/v5.2.2
UTC Build Time: 2021-10-20 06:03:29
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
```
",True,"TiDB gives a different result with `SET GLOBAL table_open_cache=-1;` - ## Bug Report
### 1. Minimal reproduce step
```sql
SET GLOBAL table_open_cache=-1;
SHOW VARIABLES LIKE 'table_open_cache';
```
### 2. What did you expect to see?
```sql
mysql> SHOW VARIABLES LIKE 'table_open_cache';
+------------------+-------+
| Variable_name | Value |
+------------------+-------+
| table_open_cache | 1 |
+------------------+-------+
1 row in set (0.03 sec)
```
### 3. What did you see instead
```sql
TiDB> SHOW VARIABLES LIKE 'table_open_cache';
+------------------+-------+
| Variable_name | Value |
+------------------+-------+
| table_open_cache | -1 |
+------------------+-------+
1 row in set (0.01 sec)
```
### 4. What is your TiDB version?
```sql
tidb_version(): Release Version: v5.2.2
Edition: Community
Git Commit Hash: da1c21fd45a4ea5900ac16d2f4a248143f378d18
Git Branch: heads/refs/tags/v5.2.2
UTC Build Time: 2021-10-20 06:03:29
GoVersion: go1.16.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
```
",1,tidb gives a different result with set global table open cache bug report minimal reproduce step sql set global table open cache show variables like table open cache what did you expect to see sql mysql show variables like table open cache variable name value table open cache row in set sec what did you see instead sql tidb show variables like table open cache variable name value table open cache row in set sec what is your tidb version sql tidb version release version edition community git commit hash git branch heads refs tags utc build time goversion race enabled false tikv min version check table before drop false ,1
11034,13065676661.0,IssuesEvent,2020-07-30 20:13:58,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,str_to_date function does not support ms,good-first-issue status/help-wanted type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
Run sql: select str_to_date('1982-10-01 20:37:16.100', '%Y-%m-%d %H:%i:%s.%f');
2. What did you expect to see?
Return a data time value: 1982-10-01 20:37:16.100
3. What did you see instead?
Return value: null
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
Release Version: v2.0.0
Git Commit Hash: 637e130e6a9ba2e54e158131c0466233db39a60e
Git Branch: release-2.0
UTC Build Time: 2018-04-27 11:43:00
GoVersion: go version go1.10 linux/amd64
TiKV Min Version: 2.0.0-rc.4.1
",True,"str_to_date function does not support ms - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
Run sql: select str_to_date('1982-10-01 20:37:16.100', '%Y-%m-%d %H:%i:%s.%f');
2. What did you expect to see?
Return a data time value: 1982-10-01 20:37:16.100
3. What did you see instead?
Return value: null
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
Release Version: v2.0.0
Git Commit Hash: 637e130e6a9ba2e54e158131c0466233db39a60e
Git Branch: release-2.0
UTC Build Time: 2018-04-27 11:43:00
GoVersion: go version go1.10 linux/amd64
TiKV Min Version: 2.0.0-rc.4.1
",1,str to date function does not support ms bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error run sql select str to date y m d h i s f what did you expect to see return a data time value what did you see instead return value null what version of tidb are you using tidb server v or run select tidb version on tidb release version git commit hash git branch release utc build time goversion go version linux tikv min version rc ,1
12265,14499092369.0,IssuesEvent,2020-12-11 16:18:03,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Cannot insert negative numbers into a `BIT(64)` column,challenge-program severity/moderate sig/execution status/help-wanted type/bug type/compatibility,"## Description
## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
CREATE TABLE t(a BIT(64));
INSERT INTO t VALUES (-1);
SELECT hex(a) FROM t;
```
2. What did you expect to see?
On MySQL 5.7 and 8.0:
```
mysql> CREATE TABLE t(a BIT(64));
Query OK, 0 rows affected (0.04 sec)
mysql> INSERT INTO t VALUES (-1);
Query OK, 1 row affected (0.01 sec)
mysql> SELECT hex(a) FROM t;
+------------------+
| hex(a) |
+------------------+
| FFFFFFFFFFFFFFFF |
+------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
On TiDB, it reports that the negative number is out-of-range.
```
mysql> CREATE TABLE t(a BIT(64));
Query OK, 0 rows affected (0.05 sec)
mysql> INSERT INTO t VALUES (-1);
ERROR 1264 (22003): Out of range value for column 'a' at row 1
mysql> SELECT hex(a) FROM t;
Empty set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```yaml
Release Version: v3.0.0-beta.1-87-gf723f0b14
Git Commit Hash: f723f0b14317ad8cc6d7f8106eb93ab233624642
Git Branch: master
UTC Build Time: 2019-04-09 07:23:07
GoVersion: go version go1.12.1 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
```
## SIG slack channel
[#sig-exec](https://slack.tidb.io/invite?team=tidb-community&channel=sig-exec&ref=high-performance)
## Score
300
## Mentor
- @lzmhhh123
",True,"Cannot insert negative numbers into a `BIT(64)` column - ## Description
## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
CREATE TABLE t(a BIT(64));
INSERT INTO t VALUES (-1);
SELECT hex(a) FROM t;
```
2. What did you expect to see?
On MySQL 5.7 and 8.0:
```
mysql> CREATE TABLE t(a BIT(64));
Query OK, 0 rows affected (0.04 sec)
mysql> INSERT INTO t VALUES (-1);
Query OK, 1 row affected (0.01 sec)
mysql> SELECT hex(a) FROM t;
+------------------+
| hex(a) |
+------------------+
| FFFFFFFFFFFFFFFF |
+------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
On TiDB, it reports that the negative number is out-of-range.
```
mysql> CREATE TABLE t(a BIT(64));
Query OK, 0 rows affected (0.05 sec)
mysql> INSERT INTO t VALUES (-1);
ERROR 1264 (22003): Out of range value for column 'a' at row 1
mysql> SELECT hex(a) FROM t;
Empty set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```yaml
Release Version: v3.0.0-beta.1-87-gf723f0b14
Git Commit Hash: f723f0b14317ad8cc6d7f8106eb93ab233624642
Git Branch: master
UTC Build Time: 2019-04-09 07:23:07
GoVersion: go version go1.12.1 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
```
## SIG slack channel
[#sig-exec](https://slack.tidb.io/invite?team=tidb-community&channel=sig-exec&ref=high-performance)
## Score
300
## Mentor
- @lzmhhh123
",1,cannot insert negative numbers into a bit column description bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error sql create table t a bit insert into t values select hex a from t what did you expect to see on mysql and mysql create table t a bit query ok rows affected sec mysql insert into t values query ok row affected sec mysql select hex a from t hex a ffffffffffffffff row in set sec what did you see instead on tidb it reports that the negative number is out of range mysql create table t a bit query ok rows affected sec mysql insert into t values error out of range value for column a at row mysql select hex a from t empty set sec what version of tidb are you using tidb server v or run select tidb version on tidb yaml release version beta git commit hash git branch master utc build time goversion go version darwin race enabled false tikv min version alpha check table before drop false sig slack channel score mentor ,1
7003,9292889746.0,IssuesEvent,2019-03-22 05:37:25,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,TiDB doesn't handle `signed + unsigned` properly ,type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
`select cast(1 as signed) + cast(9223372036854775807 as unsigned);`
2. What did you expect to see?
```
mysql> select cast(1 as signed) + cast(9223372036854775807 as unsigned);
+-----------------------------------------------------------+
| cast(1 as signed) + cast(9223372036854775807 as unsigned) |
+-----------------------------------------------------------+
| 9223372036854775808 |
+-----------------------------------------------------------+
```
3. What did you see instead?
```
mysql> select cast(1 as signed) + cast(9223372036854775807 as unsigned);
ERROR 1690 (22003): BIGINT UNSIGNED value is out of range in '(1 + 9223372036854775807)'
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
mysql> select tidb_version();
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v3.0.0-beta-231-g20463d6-dirty
Git Commit Hash: 20463d6da90fdf12c0d9d18c15dc33a78334882d
Git Branch: master
UTC Build Time: 2019-03-20 03:32:11
GoVersion: go version go1.12 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
",True,"TiDB doesn't handle `signed + unsigned` properly - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
`select cast(1 as signed) + cast(9223372036854775807 as unsigned);`
2. What did you expect to see?
```
mysql> select cast(1 as signed) + cast(9223372036854775807 as unsigned);
+-----------------------------------------------------------+
| cast(1 as signed) + cast(9223372036854775807 as unsigned) |
+-----------------------------------------------------------+
| 9223372036854775808 |
+-----------------------------------------------------------+
```
3. What did you see instead?
```
mysql> select cast(1 as signed) + cast(9223372036854775807 as unsigned);
ERROR 1690 (22003): BIGINT UNSIGNED value is out of range in '(1 + 9223372036854775807)'
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
mysql> select tidb_version();
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v3.0.0-beta-231-g20463d6-dirty
Git Commit Hash: 20463d6da90fdf12c0d9d18c15dc33a78334882d
Git Branch: master
UTC Build Time: 2019-03-20 03:32:11
GoVersion: go version go1.12 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
",1,tidb doesn t handle signed unsigned properly bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error select cast as signed cast as unsigned what did you expect to see mysql select cast as signed cast as unsigned cast as signed cast as unsigned what did you see instead mysql select cast as signed cast as unsigned error bigint unsigned value is out of range in what version of tidb are you using tidb server v or run select tidb version on tidb mysql select tidb version tidb version release version beta dirty git commit hash git branch master utc build time goversion go version linux race enabled false tikv min version alpha check table before drop false row in set sec ,1
11163,13182095657.0,IssuesEvent,2020-08-12 15:15:34,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Add remaining Information Functions,component/expression status/help-wanted type/compatibility,"From the [MySQL manual](https://dev.mysql.com/doc/refman/5.7/en/information-functions.html):
- [x] BENCHMARK() Repeatedly execute an expression https://github.com/pingcap/tidb/pull/9252
- [ ] CHARSET() Return the character set of the argument https://github.com/pingcap/tidb/issues/3931
- [x] COERCIBILITY() Return the collation coercibility value of the string argument https://github.com/pingcap/tidb/issues/4056
- [x] COLLATION() Return the collation of the string argument
- [x] CONNECTION_ID() Return the connection ID (thread ID) for the connection
- [x] CURRENT_USER(), CURRENT_USER The authenticated user name and host name
- [x] DATABASE() Return the default (current) database name
- [ ] FOUND_ROWS() For a SELECT with a LIMIT clause, the number of rows that would be returned were there no LIMIT clause (**Exists, but not correctly implemented**) https://github.com/pingcap/tidb/issues/8235
- [x] LAST_INSERT_ID() Value of the AUTOINCREMENT column for the last INSERT
- [x] ROW_COUNT() The number of rows updated (**Limited; hard to impliment in optimistic system**)
- [x] SCHEMA() Synonym for DATABASE()
- [x] SESSION_USER() Synonym for USER()
- [x] SYSTEM_USER() Synonym for USER()
- [x] USER() The user name and host name provided by the client
- [x] VERSION() Return a string that indicates the MySQL server version
",True,"Add remaining Information Functions - From the [MySQL manual](https://dev.mysql.com/doc/refman/5.7/en/information-functions.html):
- [x] BENCHMARK() Repeatedly execute an expression https://github.com/pingcap/tidb/pull/9252
- [ ] CHARSET() Return the character set of the argument https://github.com/pingcap/tidb/issues/3931
- [x] COERCIBILITY() Return the collation coercibility value of the string argument https://github.com/pingcap/tidb/issues/4056
- [x] COLLATION() Return the collation of the string argument
- [x] CONNECTION_ID() Return the connection ID (thread ID) for the connection
- [x] CURRENT_USER(), CURRENT_USER The authenticated user name and host name
- [x] DATABASE() Return the default (current) database name
- [ ] FOUND_ROWS() For a SELECT with a LIMIT clause, the number of rows that would be returned were there no LIMIT clause (**Exists, but not correctly implemented**) https://github.com/pingcap/tidb/issues/8235
- [x] LAST_INSERT_ID() Value of the AUTOINCREMENT column for the last INSERT
- [x] ROW_COUNT() The number of rows updated (**Limited; hard to impliment in optimistic system**)
- [x] SCHEMA() Synonym for DATABASE()
- [x] SESSION_USER() Synonym for USER()
- [x] SYSTEM_USER() Synonym for USER()
- [x] USER() The user name and host name provided by the client
- [x] VERSION() Return a string that indicates the MySQL server version
",1,add remaining information functions from the benchmark repeatedly execute an expression charset return the character set of the argument coercibility return the collation coercibility value of the string argument collation return the collation of the string argument connection id return the connection id thread id for the connection current user current user the authenticated user name and host name database return the default current database name found rows for a select with a limit clause the number of rows that would be returned were there no limit clause exists but not correctly implemented last insert id value of the autoincrement column for the last insert row count the number of rows updated limited hard to impliment in optimistic system schema synonym for database session user synonym for user system user synonym for user user the user name and host name provided by the client version return a string that indicates the mysql server version ,1
10630,12539780765.0,IssuesEvent,2020-06-05 09:12:28,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,delete the `TiDB` value of `tidb_isolation_read_engines`,compatibility-breaker component/session type/enhancement,"## Development Task
The system tables in `information_schema` and `metrics_schema` are in-memory tables of TiDB server. The queries of them are controlled by the value of `tidb_isolation_read_engines`(""tidb""), which is very unfriendly for users. So we decide to delete it.",True,"delete the `TiDB` value of `tidb_isolation_read_engines` - ## Development Task
The system tables in `information_schema` and `metrics_schema` are in-memory tables of TiDB server. The queries of them are controlled by the value of `tidb_isolation_read_engines`(""tidb""), which is very unfriendly for users. So we decide to delete it.",1,delete the tidb value of tidb isolation read engines development task the system tables in information schema and metrics schema are in memory tables of tidb server the queries of them are controlled by the value of tidb isolation read engines tidb which is very unfriendly for users so we decide to delete it ,1
7037,9308071251.0,IssuesEvent,2019-03-25 13:49:27,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Handling invalid `YEAR` string is not compatible with Mysql,for new contributors help wanted type/bug type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
CREATE TABLE t1 (y YEAR);
INSERT IGNORE INTO t1 VALUES ('abc');
SELECT * FROM t1;
```
2. What did you expect to see?
In Mysql
```
mysql> CREATE TABLE t1 (y YEAR);
Query OK, 0 rows affected (0.03 sec)
mysql> INSERT IGNORE INTO t1 VALUES ('abc');
Query OK, 1 row affected, 1 warning (0.00 sec)
mysql> SELECT * FROM t1;
+------+
| y |
+------+
| 0000 |
+------+
1 row in set (0.00 sec)
```
3. What did you see instead?
In TiDB
```
mysql> CREATE TABLE t1 (y YEAR);
Query OK, 0 rows affected (0.01 sec)
mysql> INSERT IGNORE INTO t1 VALUES ('abc');
Query OK, 1 row affected, 1 warning (0.00 sec)
mysql> SELECT * FROM t1;
+------+
| y |
+------+
| 2000 |
+------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v3.0.0-beta-227-g06183393e-dirty
Git Commit Hash: 06183393ed536aa248248b72d4bf9f5010947f66
Git Branch: master
UTC Build Time: 2019-03-15 08:22:53
GoVersion: go version go1.12 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
```
",True,"Handling invalid `YEAR` string is not compatible with Mysql - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
CREATE TABLE t1 (y YEAR);
INSERT IGNORE INTO t1 VALUES ('abc');
SELECT * FROM t1;
```
2. What did you expect to see?
In Mysql
```
mysql> CREATE TABLE t1 (y YEAR);
Query OK, 0 rows affected (0.03 sec)
mysql> INSERT IGNORE INTO t1 VALUES ('abc');
Query OK, 1 row affected, 1 warning (0.00 sec)
mysql> SELECT * FROM t1;
+------+
| y |
+------+
| 0000 |
+------+
1 row in set (0.00 sec)
```
3. What did you see instead?
In TiDB
```
mysql> CREATE TABLE t1 (y YEAR);
Query OK, 0 rows affected (0.01 sec)
mysql> INSERT IGNORE INTO t1 VALUES ('abc');
Query OK, 1 row affected, 1 warning (0.00 sec)
mysql> SELECT * FROM t1;
+------+
| y |
+------+
| 2000 |
+------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v3.0.0-beta-227-g06183393e-dirty
Git Commit Hash: 06183393ed536aa248248b72d4bf9f5010947f66
Git Branch: master
UTC Build Time: 2019-03-15 08:22:53
GoVersion: go version go1.12 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
```
",1,handling invalid year string is not compatible with mysql bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error create table y year insert ignore into values abc select from what did you expect to see in mysql mysql create table y year query ok rows affected sec mysql insert ignore into values abc query ok row affected warning sec mysql select from y row in set sec what did you see instead in tidb mysql create table y year query ok rows affected sec mysql insert ignore into values abc query ok row affected warning sec mysql select from y row in set sec what version of tidb are you using tidb server v or run select tidb version on tidb tidb version release version beta dirty git commit hash git branch master utc build time goversion go version darwin race enabled false tikv min version alpha check table before drop false ,1
7852,10062905616.0,IssuesEvent,2019-07-23 03:16:43,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,`desc` is not compatible with MySQL,for new contributors type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
➜ tidiff --mysql.db=tt --tidb.db=tt 'select version()'
MySQL(127.0.0.1:3306)> select version()
+-----------+
| version() |
+-----------+
| 8.0.16 |
+-----------+
1 row in set (0.001 sec)
TiDB(127.0.0.1:4000)> select version()
+------------------------------------------+
| version() |
+------------------------------------------+
| 5.7.25-TiDB-v3.0.0-beta.1-187-g5876abd70 |
+------------------------------------------+
1 row in set (0.004 sec)
➜ tidiff --mysql.db=tt --tidb.db=tt 'create table t2 (a timestamp default current_timestamp on update current_timestamp)'
MySQL(127.0.0.1:3306)> create table t2 (a timestamp default current_timestamp on update current_timestamp)
Empty set
0 row in set (0.007 sec)
TiDB(127.0.0.1:4000)> create table t2 (a timestamp default current_timestamp on update current_timestamp)
Empty set
0 row in set (0.010 sec)
➜ tidiff --mysql.db=tt --tidb.db=tt desc t2
MySQL(127.0.0.1:3306)> desc t2
+----------------------------------------------------------------------------------------------------+
| Field | Type | Null | Key | Default | Extra |
+----------------------------------------------------------------------------------------------------+
| a | timestamp | YES | | CURRENT_TIMESTAMP | DEFAULT_GENERATED on update CURRENT_TIMESTAMP |
+----------------------------------------------------------------------------------------------------+
1 row in set (0.004 sec)
TiDB(127.0.0.1:4000)> desc t2
+----------------------------------------------------------------------------------+
| Field | Type | Null | Key | Default | Extra |
+----------------------------------------------------------------------------------+
| a | timestamp | YES | | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |
+----------------------------------------------------------------------------------+
1 row in set (0.004 sec)
```
2. What did you expect to see?
The result shoud be same as MySQL
3. What did you see instead?
Showing above.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```TiDB(127.0.0.1:4000)> select tidb_version()
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v3.0.0-beta.1-187-g5876abd70
Git Commit Hash: 5876abd70ccc054704ab0e8cbf02ed129c6efc76
Git Branch: refine-point-get-failpoint
UTC Build Time: 2019-04-30 03:35:49
GoVersion: go version go1.12 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.003 sec)
```
",True,"`desc` is not compatible with MySQL - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
➜ tidiff --mysql.db=tt --tidb.db=tt 'select version()'
MySQL(127.0.0.1:3306)> select version()
+-----------+
| version() |
+-----------+
| 8.0.16 |
+-----------+
1 row in set (0.001 sec)
TiDB(127.0.0.1:4000)> select version()
+------------------------------------------+
| version() |
+------------------------------------------+
| 5.7.25-TiDB-v3.0.0-beta.1-187-g5876abd70 |
+------------------------------------------+
1 row in set (0.004 sec)
➜ tidiff --mysql.db=tt --tidb.db=tt 'create table t2 (a timestamp default current_timestamp on update current_timestamp)'
MySQL(127.0.0.1:3306)> create table t2 (a timestamp default current_timestamp on update current_timestamp)
Empty set
0 row in set (0.007 sec)
TiDB(127.0.0.1:4000)> create table t2 (a timestamp default current_timestamp on update current_timestamp)
Empty set
0 row in set (0.010 sec)
➜ tidiff --mysql.db=tt --tidb.db=tt desc t2
MySQL(127.0.0.1:3306)> desc t2
+----------------------------------------------------------------------------------------------------+
| Field | Type | Null | Key | Default | Extra |
+----------------------------------------------------------------------------------------------------+
| a | timestamp | YES | | CURRENT_TIMESTAMP | DEFAULT_GENERATED on update CURRENT_TIMESTAMP |
+----------------------------------------------------------------------------------------------------+
1 row in set (0.004 sec)
TiDB(127.0.0.1:4000)> desc t2
+----------------------------------------------------------------------------------+
| Field | Type | Null | Key | Default | Extra |
+----------------------------------------------------------------------------------+
| a | timestamp | YES | | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |
+----------------------------------------------------------------------------------+
1 row in set (0.004 sec)
```
2. What did you expect to see?
The result shoud be same as MySQL
3. What did you see instead?
Showing above.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```TiDB(127.0.0.1:4000)> select tidb_version()
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v3.0.0-beta.1-187-g5876abd70
Git Commit Hash: 5876abd70ccc054704ab0e8cbf02ed129c6efc76
Git Branch: refine-point-get-failpoint
UTC Build Time: 2019-04-30 03:35:49
GoVersion: go version go1.12 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.003 sec)
```
",1, desc is not compatible with mysql bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error ➜ tidiff mysql db tt tidb db tt select version mysql select version version row in set sec tidb select version version tidb beta row in set sec ➜ tidiff mysql db tt tidb db tt create table a timestamp default current timestamp on update current timestamp mysql create table a timestamp default current timestamp on update current timestamp empty set row in set sec tidb create table a timestamp default current timestamp on update current timestamp empty set row in set sec ➜ tidiff mysql db tt tidb db tt desc mysql desc field type null key default extra a timestamp yes current timestamp default generated on update current timestamp row in set sec tidb desc field type null key default extra a timestamp yes current timestamp on update current timestamp row in set sec what did you expect to see the result shoud be same as mysql what did you see instead showing above what version of tidb are you using tidb server v or run select tidb version on tidb tidb select tidb version tidb version release version beta git commit hash git branch refine point get failpoint utc build time goversion go version darwin race enabled false tikv min version alpha check table before drop false row in set sec ,1
7119,9414947765.0,IssuesEvent,2019-04-10 11:26:01,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,`create table` error message is not same with MySQL,help wanted type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
Exec
```sql
CREATE TABLE t1 (id INT NOT NULL,
c1 VARCHAR(20) AS ('foo') VIRTUAL KEY NULL, PRIMARY KEY (id));
CREATE TABLE t1 (id INT NOT NULL,
c1 VARCHAR(20) AS ('foo') VIRTUAL KEY NOT NULL, PRIMARY KEY (id));
```
2. What did you expect to see?
```sql
mysql> CREATE TABLE t1 (id INT NOT NULL,
-> c1 VARCHAR(20) AS ('foo') VIRTUAL KEY NULL, PRIMARY KEY (id));
ERROR 3106 (HY000): 'Defining a virtual generated column as primary key' is not supported for generated columns.
mysql> CREATE TABLE t1 (id INT NOT NULL,
-> c1 VARCHAR(20) AS ('foo') VIRTUAL KEY NOT NULL, PRIMARY KEY (id));
ERROR 3106 (HY000): 'Defining a virtual generated column as primary key' is not supported for generated columns.
mysql> select version();
+-------------------------+
| version() |
+-------------------------+
| 5.7.25-0ubuntu0.18.04.2 |
+-------------------------+
1 row in set (0.00 sec)
mysql>
```
3. What did you see instead?
```sql
mysql> CREATE TABLE t1 (id INT NOT NULL,
-> c1 VARCHAR(20) AS ('foo') VIRTUAL KEY NULL, PRIMARY KEY (id));
ERROR 1068 (42000): Multiple primary key defined
mysql> CREATE TABLE t1 (id INT NOT NULL,
-> c1 VARCHAR(20) AS ('foo') VIRTUAL KEY NOT NULL, PRIMARY KEY (id));
ERROR 1068 (42000): Multiple primary key defined
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```sql
mysql> select TiDB_version();
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| TiDB_version() |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v3.0.0-beta-117-gc48ac8af1-dirty
Git Commit Hash: c48ac8af1817bd92847c15d98b9d8eaf3d389130
Git Branch: master
UTC Build Time: 2019-02-26 02:07:00
GoVersion: go version go1.11.5 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```",True,"`create table` error message is not same with MySQL - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
Exec
```sql
CREATE TABLE t1 (id INT NOT NULL,
c1 VARCHAR(20) AS ('foo') VIRTUAL KEY NULL, PRIMARY KEY (id));
CREATE TABLE t1 (id INT NOT NULL,
c1 VARCHAR(20) AS ('foo') VIRTUAL KEY NOT NULL, PRIMARY KEY (id));
```
2. What did you expect to see?
```sql
mysql> CREATE TABLE t1 (id INT NOT NULL,
-> c1 VARCHAR(20) AS ('foo') VIRTUAL KEY NULL, PRIMARY KEY (id));
ERROR 3106 (HY000): 'Defining a virtual generated column as primary key' is not supported for generated columns.
mysql> CREATE TABLE t1 (id INT NOT NULL,
-> c1 VARCHAR(20) AS ('foo') VIRTUAL KEY NOT NULL, PRIMARY KEY (id));
ERROR 3106 (HY000): 'Defining a virtual generated column as primary key' is not supported for generated columns.
mysql> select version();
+-------------------------+
| version() |
+-------------------------+
| 5.7.25-0ubuntu0.18.04.2 |
+-------------------------+
1 row in set (0.00 sec)
mysql>
```
3. What did you see instead?
```sql
mysql> CREATE TABLE t1 (id INT NOT NULL,
-> c1 VARCHAR(20) AS ('foo') VIRTUAL KEY NULL, PRIMARY KEY (id));
ERROR 1068 (42000): Multiple primary key defined
mysql> CREATE TABLE t1 (id INT NOT NULL,
-> c1 VARCHAR(20) AS ('foo') VIRTUAL KEY NOT NULL, PRIMARY KEY (id));
ERROR 1068 (42000): Multiple primary key defined
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```sql
mysql> select TiDB_version();
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| TiDB_version() |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v3.0.0-beta-117-gc48ac8af1-dirty
Git Commit Hash: c48ac8af1817bd92847c15d98b9d8eaf3d389130
Git Branch: master
UTC Build Time: 2019-02-26 02:07:00
GoVersion: go version go1.11.5 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```",1, create table error message is not same with mysql bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error exec sql create table id int not null varchar as foo virtual key null primary key id create table id int not null varchar as foo virtual key not null primary key id what did you expect to see sql mysql create table id int not null varchar as foo virtual key null primary key id error defining a virtual generated column as primary key is not supported for generated columns mysql create table id int not null varchar as foo virtual key not null primary key id error defining a virtual generated column as primary key is not supported for generated columns mysql select version version row in set sec mysql what did you see instead sql mysql create table id int not null varchar as foo virtual key null primary key id error multiple primary key defined mysql create table id int not null varchar as foo virtual key not null primary key id error multiple primary key defined what version of tidb are you using tidb server v or run select tidb version on tidb sql mysql select tidb version tidb version release version beta dirty git commit hash git branch master utc build time goversion go version linux race enabled false tikv min version alpha check table before drop false row in set sec ,1
3272,6222643867.0,IssuesEvent,2017-07-10 09:40:10,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,The field of `select 'a' from t1;` is wrong,compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```
create table t1(a int);
insert into t value(1);
select 'a' from t1;
```
2. What did you expect to see?
```
+---+
| a |
+---+
| a |
+---+
```
3. What did you see instead?
```
+------+
| 'a' |
+------+
| a |
+------+
```
4. What version of TiDB are you using (`tidb-server -V`)?
",True,"The field of `select 'a' from t1;` is wrong - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```
create table t1(a int);
insert into t value(1);
select 'a' from t1;
```
2. What did you expect to see?
```
+---+
| a |
+---+
| a |
+---+
```
3. What did you see instead?
```
+------+
| 'a' |
+------+
| a |
+------+
```
4. What version of TiDB are you using (`tidb-server -V`)?
",1,the field of select a from is wrong please answer these questions before submitting your issue thanks what did you do create table a int insert into t value select a from what did you expect to see a a what did you see instead a a what version of tidb are you using tidb server v ,1
11063,13090567967.0,IssuesEvent,2020-08-03 03:49:39,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Specified key was too long; max key length is xxxx bytes,status/help-wanted type/compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
In InnoDB or MyISAM and other storage engines, not based on the character set utf8 or utf8mb4 or other charset distinction between Specified key Length。
(1)CREATE TABLE t ( a varchar(769), KEY (a)) ENGINE=InnoDB CHARSET=utf8mb4;
(2)CREATE TABLE t ( a varchar(1025), KEY (a)) ENGINE=InnoDB CHARSET=utf8;
(3)CREATE TABLE t ( a varchar(251), KEY (a)) ENGINE=MyISAM CHARSET=utf8mb4;
(4)CREATE TABLE t ( a varchar(334), KEY (a)) ENGINE=MyISAM CHARSET=utf8;
2. What did you expect to see?
(1)Specified key was too long; max key length is 3072 bytes
(2)Specified key was too long; max key length is 3072 bytes
(3)Specified key was too long; max key length is 1000 bytes
(4)Specified key was too long; max key length is 1000 bytes
3. What did you see instead?
all show:
Query OK, 0 rows affected (0.00 sec)
4. What version of TiDB are you using (`tidb-server -V`)?
Git Commit Hash: 3991f38cd09bd2988691192537acf1b9e39bc48f
UTC Build Time: 2017-08-09 10:57:21
refer to #2272 and #2380 .",True,"Specified key was too long; max key length is xxxx bytes - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
In InnoDB or MyISAM and other storage engines, not based on the character set utf8 or utf8mb4 or other charset distinction between Specified key Length。
(1)CREATE TABLE t ( a varchar(769), KEY (a)) ENGINE=InnoDB CHARSET=utf8mb4;
(2)CREATE TABLE t ( a varchar(1025), KEY (a)) ENGINE=InnoDB CHARSET=utf8;
(3)CREATE TABLE t ( a varchar(251), KEY (a)) ENGINE=MyISAM CHARSET=utf8mb4;
(4)CREATE TABLE t ( a varchar(334), KEY (a)) ENGINE=MyISAM CHARSET=utf8;
2. What did you expect to see?
(1)Specified key was too long; max key length is 3072 bytes
(2)Specified key was too long; max key length is 3072 bytes
(3)Specified key was too long; max key length is 1000 bytes
(4)Specified key was too long; max key length is 1000 bytes
3. What did you see instead?
all show:
Query OK, 0 rows affected (0.00 sec)
4. What version of TiDB are you using (`tidb-server -V`)?
Git Commit Hash: 3991f38cd09bd2988691192537acf1b9e39bc48f
UTC Build Time: 2017-08-09 10:57:21
refer to #2272 and #2380 .",1,specified key was too long max key length is xxxx bytes please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error in innodb or myisam and other storage engines not based on the character set or or other charset distinction between specified key length。 create table t a varchar key a engine innodb charset create table t a varchar key a engine innodb charset create table t a varchar key a engine myisam charset create table t a varchar key a engine myisam charset what did you expect to see specified key was too long max key length is bytes specified key was too long max key length is bytes specified key was too long max key length is bytes specified key was too long max key length is bytes what did you see instead all show query ok rows affected sec what version of tidb are you using tidb server v git commit hash utc build time refer to and ,1
11148,13164855804.0,IssuesEvent,2020-08-11 05:02:18,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,tidb missing mysql protocol support for FLUSH LOGS,component/mysql-protocol type/compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
run mysqldump command:
```
mysqldump --defaults-file=/data/home/benhu/mysql/mysql-test/var/my.cnf
--defaults-group-suffix=.1 --extended-insert --flush-logs --add-drop-database
--add-drop-table --force --databases --skip-dump-date mysql
```
my.cnf content is:
```
[client]
password= 12345678
user= root
port= 36332
host= 100.91.37.22
#socket= /tmp/mysqld.sock
# binlog reads from [client] and [mysqlbinlog]
[mysqlbinlog]
character-sets-dir= /data/home/benhu/mysql/share/charsets
local-load= /data/home/benhu/mysql/mysql-test/var/tmp
```
mysqldump version is: `mysqldump Ver 10.13 Distrib 5.6.36, for Linux (x86_64)`
2. What did you expect to see?
3. What did you see instead?
```
mysqldump: Got error: 1105: ERROR 1105 (HY000): command 7 not supported now when doing refresh
```
4. What version of TiDB are you using (`tidb-server -V`)?
```
Git Commit Hash: f3f9bbd601e5c8bda32fac9a57f73931f0625bac
UTC Build Time: 2017-06-19 06:09:02
```",True,"tidb missing mysql protocol support for FLUSH LOGS - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
run mysqldump command:
```
mysqldump --defaults-file=/data/home/benhu/mysql/mysql-test/var/my.cnf
--defaults-group-suffix=.1 --extended-insert --flush-logs --add-drop-database
--add-drop-table --force --databases --skip-dump-date mysql
```
my.cnf content is:
```
[client]
password= 12345678
user= root
port= 36332
host= 100.91.37.22
#socket= /tmp/mysqld.sock
# binlog reads from [client] and [mysqlbinlog]
[mysqlbinlog]
character-sets-dir= /data/home/benhu/mysql/share/charsets
local-load= /data/home/benhu/mysql/mysql-test/var/tmp
```
mysqldump version is: `mysqldump Ver 10.13 Distrib 5.6.36, for Linux (x86_64)`
2. What did you expect to see?
3. What did you see instead?
```
mysqldump: Got error: 1105: ERROR 1105 (HY000): command 7 not supported now when doing refresh
```
4. What version of TiDB are you using (`tidb-server -V`)?
```
Git Commit Hash: f3f9bbd601e5c8bda32fac9a57f73931f0625bac
UTC Build Time: 2017-06-19 06:09:02
```",1,tidb missing mysql protocol support for flush logs please answer these questions before submitting your issue thanks what did you do run mysqldump command mysqldump defaults file data home benhu mysql mysql test var my cnf defaults group suffix extended insert flush logs add drop database add drop table force databases skip dump date mysql my cnf content is password user root port host socket tmp mysqld sock binlog reads from and character sets dir data home benhu mysql share charsets local load data home benhu mysql mysql test var tmp mysqldump version is mysqldump ver distrib for linux what did you expect to see what did you see instead mysqldump got error error command not supported now when doing refresh what version of tidb are you using tidb server v git commit hash utc build time ,1
5687,8150356247.0,IssuesEvent,2018-08-22 12:45:05,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,blob/text/int length isn't accuracy in columnm metadata,help wanted type/compatibility,"1. What did you do?
connection tidb with `--column-type-info`
```
create table bitest(b blob(2));
select * from bitest;
```
2. What did you expect to see?
```
Length: 255
```
3. What did you see instead?
```
Length: 8
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
2.0.6
```
ref #7463 ",True,"blob/text/int length isn't accuracy in columnm metadata - 1. What did you do?
connection tidb with `--column-type-info`
```
create table bitest(b blob(2));
select * from bitest;
```
2. What did you expect to see?
```
Length: 255
```
3. What did you see instead?
```
Length: 8
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
2.0.6
```
ref #7463 ",1,blob text int length isn t accuracy in columnm metadata what did you do connection tidb with column type info create table bitest b blob select from bitest what did you expect to see length what did you see instead length what version of tidb are you using tidb server v or run select tidb version on tidb ref ,1
13662,16343631397.0,IssuesEvent,2021-05-13 03:15:40,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Inconsistent error with MySQL for GRANT CREATE USER ON .*,good-first-issue severity/moderate sig/sql-infra status/help-wanted type/bug type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
create user testuser@localhost;
grant create user on test.* to testuser@localhost;
### 2. What did you expect to see? (Required)
mysql> create user testuser@localhost;
Query OK, 0 rows affected (0.04 sec)
mysql> grant create user on test.* to testuser@localhost;
ERROR 1221 (HY000): Incorrect usage of DB GRANT and GLOBAL PRIVILEGES
### 3. What did you see instead (Required)
tidb> create user testuser@localhost;
Query OK, 0 rows affected (0.01 sec)
tidb> grant create user on test.* to testuser@localhost;
ERROR 1054 (42S22): Unknown column 'Create_user_priv' in 'field list'
### 4. What is your TiDB version? (Required)
tidb_version(): Release Version: v4.0.0-beta.2-2806-ga6ec081b8
Edition: Community
Git Commit Hash: a6ec081b82a5357a9688a98d4d3cca35c87eab75
Git Branch: HEAD
UTC Build Time: 2021-05-06 14:56:18
GoVersion: go1.13.8
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
",True,"Inconsistent error with MySQL for GRANT CREATE USER ON .* - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
create user testuser@localhost;
grant create user on test.* to testuser@localhost;
### 2. What did you expect to see? (Required)
mysql> create user testuser@localhost;
Query OK, 0 rows affected (0.04 sec)
mysql> grant create user on test.* to testuser@localhost;
ERROR 1221 (HY000): Incorrect usage of DB GRANT and GLOBAL PRIVILEGES
### 3. What did you see instead (Required)
tidb> create user testuser@localhost;
Query OK, 0 rows affected (0.01 sec)
tidb> grant create user on test.* to testuser@localhost;
ERROR 1054 (42S22): Unknown column 'Create_user_priv' in 'field list'
### 4. What is your TiDB version? (Required)
tidb_version(): Release Version: v4.0.0-beta.2-2806-ga6ec081b8
Edition: Community
Git Commit Hash: a6ec081b82a5357a9688a98d4d3cca35c87eab75
Git Branch: HEAD
UTC Build Time: 2021-05-06 14:56:18
GoVersion: go1.13.8
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
",1,inconsistent error with mysql for grant create user on bug report please answer these questions before submitting your issue thanks minimal reproduce step required create user testuser localhost grant create user on test to testuser localhost what did you expect to see required mysql create user testuser localhost query ok rows affected sec mysql grant create user on test to testuser localhost error incorrect usage of db grant and global privileges what did you see instead required tidb create user testuser localhost query ok rows affected sec tidb grant create user on test to testuser localhost error unknown column create user priv in field list what is your tidb version required tidb version release version beta edition community git commit hash git branch head utc build time goversion race enabled false tikv min version check table before drop false ,1
13330,15721839980.0,IssuesEvent,2021-03-29 04:14:23,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,executor: sum(time) differs from mysql,component/executor sig/execution type/bug type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```
mysql> select col_time_not_null_key from cc;
+-----------------------+
| col_time_not_null_key |
+-----------------------+
| 00:20:03 |
| 12:20:27 |
| 00:46:14 |
| 00:20:02 |
| 07:41:25 |
| 20:15:56 |
| 10:00:31 |
| 21:32:46 |
| 07:26:48 |
| 00:20:02 |
| 00:20:09 |
| 17:18:55 |
| 18:22:56 |
| 10:54:06 |
| 00:00:00 |
| 09:23:25 |
| 00:41:20 |
| 17:04:45 |
| 10:14:20 |
| 16:44:10 |
| 22:36:40 |
| 00:00:00 |
| 00:42:04 |
| 06:25:39 |
| 14:27:59 |
| 11:37:03 |
| 22:58:43 |
| 00:20:02 |
| 10:31:24 |
| 06:02:13 |
| 02:30:43 |
| 09:04:12 |
| 00:20:00 |
| 07:54:44 |
| 00:20:08 |
| 13:41:03 |
| 00:20:02 |
| 00:00:00 |
| 21:35:31 |
| 19:43:41 |
| 15:29:59 |
| 00:00:00 |
| 00:20:03 |
| 21:28:05 |
| 20:35:26 |
| 00:10:46 |
| 02:09:06 |
| 04:30:35 |
| 00:00:00 |
| 15:41:21 |
+-----------------------+
50 rows in set (0.05 sec)
```
### 2. What did you expect to see? (Required)
```
from mysql
mysql> select sum(col_time_not_null_key) from CC;
+----------------------------+
| sum(col_time_not_null_key) |
+----------------------------+
| 4263835 |
+----------------------------+
1 row in set (0.00 sec)
```
### 3. What did you see instead (Required)
```
mysql> select sum(col_time_not_null_key) from cc;
+----------------------------+
| sum(col_time_not_null_key) |
+----------------------------+
| 4253812 |
+----------------------------+
1 row in set (0.04 sec)
mysql>
```
### 4. What is your TiDB version? (Required)
master
",True,"executor: sum(time) differs from mysql - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```
mysql> select col_time_not_null_key from cc;
+-----------------------+
| col_time_not_null_key |
+-----------------------+
| 00:20:03 |
| 12:20:27 |
| 00:46:14 |
| 00:20:02 |
| 07:41:25 |
| 20:15:56 |
| 10:00:31 |
| 21:32:46 |
| 07:26:48 |
| 00:20:02 |
| 00:20:09 |
| 17:18:55 |
| 18:22:56 |
| 10:54:06 |
| 00:00:00 |
| 09:23:25 |
| 00:41:20 |
| 17:04:45 |
| 10:14:20 |
| 16:44:10 |
| 22:36:40 |
| 00:00:00 |
| 00:42:04 |
| 06:25:39 |
| 14:27:59 |
| 11:37:03 |
| 22:58:43 |
| 00:20:02 |
| 10:31:24 |
| 06:02:13 |
| 02:30:43 |
| 09:04:12 |
| 00:20:00 |
| 07:54:44 |
| 00:20:08 |
| 13:41:03 |
| 00:20:02 |
| 00:00:00 |
| 21:35:31 |
| 19:43:41 |
| 15:29:59 |
| 00:00:00 |
| 00:20:03 |
| 21:28:05 |
| 20:35:26 |
| 00:10:46 |
| 02:09:06 |
| 04:30:35 |
| 00:00:00 |
| 15:41:21 |
+-----------------------+
50 rows in set (0.05 sec)
```
### 2. What did you expect to see? (Required)
```
from mysql
mysql> select sum(col_time_not_null_key) from CC;
+----------------------------+
| sum(col_time_not_null_key) |
+----------------------------+
| 4263835 |
+----------------------------+
1 row in set (0.00 sec)
```
### 3. What did you see instead (Required)
```
mysql> select sum(col_time_not_null_key) from cc;
+----------------------------+
| sum(col_time_not_null_key) |
+----------------------------+
| 4253812 |
+----------------------------+
1 row in set (0.04 sec)
mysql>
```
### 4. What is your TiDB version? (Required)
master
",1,executor sum time differs from mysql bug report please answer these questions before submitting your issue thanks minimal reproduce step required mysql select col time not null key from cc col time not null key rows in set sec what did you expect to see required from mysql mysql select sum col time not null key from cc sum col time not null key row in set sec what did you see instead required mysql select sum col time not null key from cc sum col time not null key row in set sec mysql what is your tidb version required master ,1
20394,30184678424.0,IssuesEvent,2023-07-04 11:14:38,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Authentication compatibility with Navicat,type/bug type/compatibility sig/sql-infra,"# Environment
TiDB: 5.7.25-TiDB-v5.2.0-alpha-800-gafca7649f
MySQL: 8.0.26
Navicat for MySQL: 15.0.28
# Account setup
```sql
CREATE USER 'nopwd'@'%';
CREATE USER 'native'@'%' IDENTIFIED WITH 'mysql_native_password' BY 'abc';
CREATE USER 'sha2'@'%' IDENTIFIED WITH 'caching_sha2_password' BY 'abc';
```
# Validating accounts with a MySQL client
```bash
mysql -h 127.0.0.1 -P4000 -u nopwd
mysql -h 127.0.0.1 -P4000 -u native -pabc
mysql -h 127.0.0.1 -P4000 -u sha2 -pabc
```
# Testing with Navicat
This is navicat with default settings, but with Host=127.0.0.1, Port=4000 and user/password set appropriately
* nopwd: OK
* native: OK
* sha2: ""1045 - Access denied for user 'sha2'@'127.0.0.1' (using password: YES)""
* sha2 with SSL: ""0 -""
```
[2021/09/02 08:09:33.555 +02:00] [ERROR] [conn.go:731] [""authSha packet read failed""] [conn=19] [error=EOF]
[2021/09/02 08:09:33.555 +02:00] [ERROR] [terror.go:291] [""encountered error""] [error=""tls: failed to send closeNotify alert (but connection was closed anyway): write tcp 127.0.0.1:4000->127.0.0.1:43238: write: broken pipe""] [stack=""github.com/pingcap/parser/terror.Log\n\t/home/dvaneeden/go/pkg/mod/github.com/pingcap/parser@v0.0.0-20210823071803-562fed23b4fb/terror/terror.go:291\ngithub.com/pingcap/tidb/server.closeConn\n\t/home/dvaneeden/dev/pingcap/tidb/server/conn.go:310\ngithub.com/pingcap/tidb/server.(*clientConn).Close\n\t/home/dvaneeden/dev/pingcap/tidb/server/conn.go:304\ngithub.com/pingcap/tidb/server.(*Server).onConn\n\t/home/dvaneeden/dev/pingcap/tidb/server/server.go:474""]
```
Without TLS `caching_sha2_password` authentication is expected to fail as TiDB doesn't (yet) support the fastpath option.
# Testing with Navicat and caching_sha2_password as default
```
set global default_authentication_plugin='caching_sha2_password';
```
* nopwd: ""2012 - Error in server handshake""
* native: OK
* sha2: ""1045 - Access denied for user 'sha2'@'127.0.0.1' (using password: YES)""
* sha2 with SSL: ""0 -""
The error for `nopwd` should be diagnosed and fixed.
# Testing Navicat with MySQL
* sha2: OK
* sha2 with SSL: ""1045 - Access denied for user 'sha2'@'127.0.0.1' (using password: YES)""
This makes me wonder if `caching_sha2_password` in Navicat is working correctly in all situations.",True,"Authentication compatibility with Navicat - # Environment
TiDB: 5.7.25-TiDB-v5.2.0-alpha-800-gafca7649f
MySQL: 8.0.26
Navicat for MySQL: 15.0.28
# Account setup
```sql
CREATE USER 'nopwd'@'%';
CREATE USER 'native'@'%' IDENTIFIED WITH 'mysql_native_password' BY 'abc';
CREATE USER 'sha2'@'%' IDENTIFIED WITH 'caching_sha2_password' BY 'abc';
```
# Validating accounts with a MySQL client
```bash
mysql -h 127.0.0.1 -P4000 -u nopwd
mysql -h 127.0.0.1 -P4000 -u native -pabc
mysql -h 127.0.0.1 -P4000 -u sha2 -pabc
```
# Testing with Navicat
This is navicat with default settings, but with Host=127.0.0.1, Port=4000 and user/password set appropriately
* nopwd: OK
* native: OK
* sha2: ""1045 - Access denied for user 'sha2'@'127.0.0.1' (using password: YES)""
* sha2 with SSL: ""0 -""
```
[2021/09/02 08:09:33.555 +02:00] [ERROR] [conn.go:731] [""authSha packet read failed""] [conn=19] [error=EOF]
[2021/09/02 08:09:33.555 +02:00] [ERROR] [terror.go:291] [""encountered error""] [error=""tls: failed to send closeNotify alert (but connection was closed anyway): write tcp 127.0.0.1:4000->127.0.0.1:43238: write: broken pipe""] [stack=""github.com/pingcap/parser/terror.Log\n\t/home/dvaneeden/go/pkg/mod/github.com/pingcap/parser@v0.0.0-20210823071803-562fed23b4fb/terror/terror.go:291\ngithub.com/pingcap/tidb/server.closeConn\n\t/home/dvaneeden/dev/pingcap/tidb/server/conn.go:310\ngithub.com/pingcap/tidb/server.(*clientConn).Close\n\t/home/dvaneeden/dev/pingcap/tidb/server/conn.go:304\ngithub.com/pingcap/tidb/server.(*Server).onConn\n\t/home/dvaneeden/dev/pingcap/tidb/server/server.go:474""]
```
Without TLS `caching_sha2_password` authentication is expected to fail as TiDB doesn't (yet) support the fastpath option.
# Testing with Navicat and caching_sha2_password as default
```
set global default_authentication_plugin='caching_sha2_password';
```
* nopwd: ""2012 - Error in server handshake""
* native: OK
* sha2: ""1045 - Access denied for user 'sha2'@'127.0.0.1' (using password: YES)""
* sha2 with SSL: ""0 -""
The error for `nopwd` should be diagnosed and fixed.
# Testing Navicat with MySQL
* sha2: OK
* sha2 with SSL: ""1045 - Access denied for user 'sha2'@'127.0.0.1' (using password: YES)""
This makes me wonder if `caching_sha2_password` in Navicat is working correctly in all situations.",1,authentication compatibility with navicat environment tidb tidb alpha mysql navicat for mysql account setup sql create user nopwd create user native identified with mysql native password by abc create user identified with caching password by abc validating accounts with a mysql client bash mysql h u nopwd mysql h u native pabc mysql h u pabc testing with navicat this is navicat with default settings but with host port and user password set appropriately nopwd ok native ok access denied for user using password yes with ssl without tls caching password authentication is expected to fail as tidb doesn t yet support the fastpath option testing with navicat and caching password as default set global default authentication plugin caching password nopwd error in server handshake native ok access denied for user using password yes with ssl the error for nopwd should be diagnosed and fixed testing navicat with mysql ok with ssl access denied for user using password yes this makes me wonder if caching password in navicat is working correctly in all situations ,1
9734,11783446045.0,IssuesEvent,2020-03-17 05:36:55,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,window function: group_concat error message is not compatible,challenge-program-2 component/planner difficulty/easy good-first-issue help-wanted type/bug type/compatibility,"## Description
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```mysql
mysql> select group_concat('3') over ();
ERROR 1064 (42000): 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 29 near ""over ()""
```
2. What did you expect to see?
```
mysql> select group_concat('3') over ();
ERROR 1235 (42000): This version of MySQL doesn't yet support 'group_concat as window function'
```
## Score
* 50
## Mentor(s)
* @SunRunAway
Contact the mentors: **#tidb-challenge-program** channel in [TiDB Community](https://join.slack.com/t/tidbcommunity/shared_invite/enQtNzc0MzI4ODExMDc4LWYwYmIzMjZkYzJiNDUxMmZlN2FiMGJkZjAyMzQ5NGU0NGY0NzI3NTYwMjAyNGQ1N2I2ZjAxNzc1OGUwYWM0NzE) Slack Workspace
## Recommended Skills
* Golang Programming.
* Be familiar with window function and TiDB Parser.
## Learning Materials
* Chinese: [TiDB 精选技术讲解文章](https://github.com/pingcap/presentations/blob/master/hackathon-2019/reference-document-of-hackathon-2019.md)
* English: [Awesome-Database-Learning](https://github.com/pingcap/awesome-database-learning)",True,"window function: group_concat error message is not compatible - ## Description
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```mysql
mysql> select group_concat('3') over ();
ERROR 1064 (42000): 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 29 near ""over ()""
```
2. What did you expect to see?
```
mysql> select group_concat('3') over ();
ERROR 1235 (42000): This version of MySQL doesn't yet support 'group_concat as window function'
```
## Score
* 50
## Mentor(s)
* @SunRunAway
Contact the mentors: **#tidb-challenge-program** channel in [TiDB Community](https://join.slack.com/t/tidbcommunity/shared_invite/enQtNzc0MzI4ODExMDc4LWYwYmIzMjZkYzJiNDUxMmZlN2FiMGJkZjAyMzQ5NGU0NGY0NzI3NTYwMjAyNGQ1N2I2ZjAxNzc1OGUwYWM0NzE) Slack Workspace
## Recommended Skills
* Golang Programming.
* Be familiar with window function and TiDB Parser.
## Learning Materials
* Chinese: [TiDB 精选技术讲解文章](https://github.com/pingcap/presentations/blob/master/hackathon-2019/reference-document-of-hackathon-2019.md)
* English: [Awesome-Database-Learning](https://github.com/pingcap/awesome-database-learning)",1,window function group concat error message is not compatible description please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error mysql mysql select group concat over error you have an error in your sql syntax check the manual that corresponds to your tidb version for the right syntax to use line column near over what did you expect to see mysql select group concat over error this version of mysql doesn t yet support group concat as window function score mentor s sunrunaway contact the mentors tidb challenge program channel in slack workspace recommended skills golang programming be familiar with window function and tidb parser learning materials chinese english ,1
13564,16083564478.0,IssuesEvent,2021-04-26 08:32:54,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,Truncated incorrect when deleting text type,type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```mysql
CREATE TABLE t0(c0 TEXT(465) );
INSERT INTO t0(c0) VALUES ('2Q6)YXF6R');
```
### 2. What did you expect to see? (Required)
```mysql
mysql> DELETE FROM t0 WHERE c0 LIMIT 1;
Query OK, 1 row affected (0.04 sec)
```
### 3. What did you see instead (Required)
```mysql
mysql> DELETE FROM t0 WHERE c0 LIMIT 1;
1292 - Truncated incorrect INTEGER value: '2Q6)YXF6R'
```
### 4. What is your TiDB version? (Required)
```mysql
Release Version: v4.0.0-beta.2-2718-g3708e80db-dirty
Edition: Community
Git Commit Hash: 3708e80db7597f380361ae2e73d97422790f834f
Git Branch: master
UTC Build Time: 2021-04-23 10:54:17
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
```
",True,"Truncated incorrect when deleting text type - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```mysql
CREATE TABLE t0(c0 TEXT(465) );
INSERT INTO t0(c0) VALUES ('2Q6)YXF6R');
```
### 2. What did you expect to see? (Required)
```mysql
mysql> DELETE FROM t0 WHERE c0 LIMIT 1;
Query OK, 1 row affected (0.04 sec)
```
### 3. What did you see instead (Required)
```mysql
mysql> DELETE FROM t0 WHERE c0 LIMIT 1;
1292 - Truncated incorrect INTEGER value: '2Q6)YXF6R'
```
### 4. What is your TiDB version? (Required)
```mysql
Release Version: v4.0.0-beta.2-2718-g3708e80db-dirty
Edition: Community
Git Commit Hash: 3708e80db7597f380361ae2e73d97422790f834f
Git Branch: master
UTC Build Time: 2021-04-23 10:54:17
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
```
",1,truncated incorrect when deleting text type bug report please answer these questions before submitting your issue thanks minimal reproduce step required mysql create table text insert into values what did you expect to see required mysql mysql delete from where limit query ok row affected sec what did you see instead required mysql mysql delete from where limit truncated incorrect integer value what is your tidb version required mysql release version beta dirty edition community git commit hash git branch master utc build time goversion race enabled false tikv min version check table before drop false ,1
11073,13098917162.0,IssuesEvent,2020-08-03 20:28:55,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Privilege check failed error to be consistent with MySQL,type/compatibility type/duplicate,"https://github.com/pingcap/tidb/blob/master/planner/core/planbuilder.go#L1208
visitInfo.err is used to return to the client when the privilege check is failed. we should keep the error message consistent with MySQL, using `nil` will return only `privilege check fail`
```
// CheckPrivilege checks the privilege for a user.
func CheckPrivilege(pm privilege.Manager, vs []visitInfo) error {
for _, v := range vs {
if !pm.RequestVerification(v.db, v.table, v.column, v.privilege) {
if v.err == nil {
return ErrPrivilegeCheckFail
}
return v.err
}
}
return nil
}
```",True,"Privilege check failed error to be consistent with MySQL - https://github.com/pingcap/tidb/blob/master/planner/core/planbuilder.go#L1208
visitInfo.err is used to return to the client when the privilege check is failed. we should keep the error message consistent with MySQL, using `nil` will return only `privilege check fail`
```
// CheckPrivilege checks the privilege for a user.
func CheckPrivilege(pm privilege.Manager, vs []visitInfo) error {
for _, v := range vs {
if !pm.RequestVerification(v.db, v.table, v.column, v.privilege) {
if v.err == nil {
return ErrPrivilegeCheckFail
}
return v.err
}
}
return nil
}
```",1,privilege check failed error to be consistent with mysql visitinfo err is used to return to the client when the privilege check is failed we should keep the error message consistent with mysql using nil will return only privilege check fail checkprivilege checks the privilege for a user func checkprivilege pm privilege manager vs visitinfo error for v range vs if pm requestverification v db v table v column v privilege if v err nil return errprivilegecheckfail return v err return nil ,1
5612,8076042423.0,IssuesEvent,2018-08-07 08:13:11,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,Column length is wrong for type set,type/compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```java
public void testBug22613() throws Exception {
createTable(""bug22613"",
""( s set('a','bc','def','ghij') default NULL, t enum('a', 'ab', 'cdef'), s2 SET('1','2','3','4','1585','ONE','TWO','Y','N','THREE'))"");
checkMetadataForBug22613(this.conn);
if (versionMeetsMinimum(5, 0)) {
Connection infoSchemConn = null;
try {
Properties props = new Properties();
props.setProperty(""useInformationSchema"", ""true"");
infoSchemConn = getConnectionWithProps(props);
checkMetadataForBug22613(infoSchemConn);
} finally {
if (infoSchemConn != null) {
infoSchemConn.close();
}
}
}
}
private void checkMetadataForBug22613(Connection c) throws Exception {
String maxValue = ""a,bc,def,ghij"";
String maxValue2 = ""1,2,3,4,1585,ONE,TWO,Y,N,THREE"";
DatabaseMetaData meta = c.getMetaData();
this.rs = meta.getColumns(null, this.conn.getCatalog(), ""bug22613"", ""s"");
this.rs.first();
assertEquals(maxValue.length(), this.rs.getInt(""COLUMN_SIZE""));
this.rs = meta.getColumns(null, this.conn.getCatalog(), ""bug22613"", ""s2"");
this.rs.first();
assertEquals(maxValue2.length(), this.rs.getInt(""COLUMN_SIZE""));
this.rs = meta.getColumns(null, c.getCatalog(), ""bug22613"", ""t"");
this.rs.first();
assertEquals(4, this.rs.getInt(""COLUMN_SIZE""));
}
```
2. What did you expect to see?
No errors
3. What did you see instead?
```
Expected :
13
Actual :
2147483647
```
for `assertEquals(maxValue.length(), this.rs.getInt(""COLUMN_SIZE""));`
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
ae2e3ac0a7f28453a758b18f1cb87e34f77a5890
",True,"Column length is wrong for type set - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```java
public void testBug22613() throws Exception {
createTable(""bug22613"",
""( s set('a','bc','def','ghij') default NULL, t enum('a', 'ab', 'cdef'), s2 SET('1','2','3','4','1585','ONE','TWO','Y','N','THREE'))"");
checkMetadataForBug22613(this.conn);
if (versionMeetsMinimum(5, 0)) {
Connection infoSchemConn = null;
try {
Properties props = new Properties();
props.setProperty(""useInformationSchema"", ""true"");
infoSchemConn = getConnectionWithProps(props);
checkMetadataForBug22613(infoSchemConn);
} finally {
if (infoSchemConn != null) {
infoSchemConn.close();
}
}
}
}
private void checkMetadataForBug22613(Connection c) throws Exception {
String maxValue = ""a,bc,def,ghij"";
String maxValue2 = ""1,2,3,4,1585,ONE,TWO,Y,N,THREE"";
DatabaseMetaData meta = c.getMetaData();
this.rs = meta.getColumns(null, this.conn.getCatalog(), ""bug22613"", ""s"");
this.rs.first();
assertEquals(maxValue.length(), this.rs.getInt(""COLUMN_SIZE""));
this.rs = meta.getColumns(null, this.conn.getCatalog(), ""bug22613"", ""s2"");
this.rs.first();
assertEquals(maxValue2.length(), this.rs.getInt(""COLUMN_SIZE""));
this.rs = meta.getColumns(null, c.getCatalog(), ""bug22613"", ""t"");
this.rs.first();
assertEquals(4, this.rs.getInt(""COLUMN_SIZE""));
}
```
2. What did you expect to see?
No errors
3. What did you see instead?
```
Expected :
13
Actual :
2147483647
```
for `assertEquals(maxValue.length(), this.rs.getInt(""COLUMN_SIZE""));`
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
ae2e3ac0a7f28453a758b18f1cb87e34f77a5890
",1,column length is wrong for type set please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error java public void throws exception createtable s set a bc def ghij default null t enum a ab cdef set one two y n three this conn if versionmeetsminimum connection infoschemconn null try properties props new properties props setproperty useinformationschema true infoschemconn getconnectionwithprops props infoschemconn finally if infoschemconn null infoschemconn close private void connection c throws exception string maxvalue a bc def ghij string one two y n three databasemetadata meta c getmetadata this rs meta getcolumns null this conn getcatalog s this rs first assertequals maxvalue length this rs getint column size this rs meta getcolumns null this conn getcatalog this rs first assertequals length this rs getint column size this rs meta getcolumns null c getcatalog t this rs first assertequals this rs getint column size what did you expect to see no errors what did you see instead expected actual for assertequals maxvalue length this rs getint column size what version of tidb are you using tidb server v or run select tidb version on tidb ,1
8794,10737940463.0,IssuesEvent,2019-10-29 14:00:08,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,"TIMESTAMP literal should produce a DATETIME, not TIMESTAMP",component/expression type/bug type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```sql
SELECT TIMESTAMP '9999-01-01 00:00:00';
```
2. What did you expect to see?
```
mysql> SELECT TIMESTAMP '9999-01-01 00:00:00';
+---------------------------------+
| TIMESTAMP '9999-01-01 00:00:00' |
+---------------------------------+
| 9999-01-01 00:00:00 |
+---------------------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
```
mysql> SELECT TIMESTAMP '9999-01-01 00:00:00';
ERROR 1292 (22007): invalid time format: '{9999 1 1 0 0 0 0}'
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
A recent master version
```
mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v4.0.0-alpha-532-ge168fd93f
Git Commit Hash: e168fd93f68a8e24a24aaa09eb3df5acc9c0c77c
Git Branch: master
UTC Build Time: 2019-10-16 07:23:53
GoVersion: go version go1.13.1 linux/amd64
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.00 sec)
```
**Note:** According to https://dev.mysql.com/doc/refman/5.6/en/date-and-time-literals.html,
> The `TIMESTAMP` syntax produces a `DATETIME` value in MySQL because `DATETIME` has a range that more closely corresponds to the standard SQL `TIMESTAMP` type, which has a year range from 0001 to 9999. (The MySQL `TIMESTAMP` year range is 1970 to 2038.) ",True,"TIMESTAMP literal should produce a DATETIME, not TIMESTAMP - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```sql
SELECT TIMESTAMP '9999-01-01 00:00:00';
```
2. What did you expect to see?
```
mysql> SELECT TIMESTAMP '9999-01-01 00:00:00';
+---------------------------------+
| TIMESTAMP '9999-01-01 00:00:00' |
+---------------------------------+
| 9999-01-01 00:00:00 |
+---------------------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
```
mysql> SELECT TIMESTAMP '9999-01-01 00:00:00';
ERROR 1292 (22007): invalid time format: '{9999 1 1 0 0 0 0}'
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
A recent master version
```
mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v4.0.0-alpha-532-ge168fd93f
Git Commit Hash: e168fd93f68a8e24a24aaa09eb3df5acc9c0c77c
Git Branch: master
UTC Build Time: 2019-10-16 07:23:53
GoVersion: go version go1.13.1 linux/amd64
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.00 sec)
```
**Note:** According to https://dev.mysql.com/doc/refman/5.6/en/date-and-time-literals.html,
> The `TIMESTAMP` syntax produces a `DATETIME` value in MySQL because `DATETIME` has a range that more closely corresponds to the standard SQL `TIMESTAMP` type, which has a year range from 0001 to 9999. (The MySQL `TIMESTAMP` year range is 1970 to 2038.) ",1,timestamp literal should produce a datetime not timestamp bug report please answer these questions before submitting your issue thanks what did you do sql select timestamp what did you expect to see mysql select timestamp timestamp row in set sec what did you see instead mysql select timestamp error invalid time format what version of tidb are you using tidb server v or run select tidb version on tidb a recent master version mysql select tidb version g row tidb version release version alpha git commit hash git branch master utc build time goversion go version linux race enabled false tikv min version check table before drop false row in set sec note according to the timestamp syntax produces a datetime value in mysql because datetime has a range that more closely corresponds to the standard sql timestamp type which has a year range from to the mysql timestamp year range is to ,1
16775,23129560595.0,IssuesEvent,2022-07-28 09:09:13,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,change behavior of fine_grained_shffule_stream_count,type/enhancement sig/execution compatibility-breaker severity/moderate,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
0 means diable fine grained shuffle. -1 means use tidb_max_tiflash_threads as stream_count.
### 2. What did you expect to see? (Required)
### 3. What did you see instead (Required)
### 4. What is your TiDB version? (Required)
master
",True,"change behavior of fine_grained_shffule_stream_count - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
0 means diable fine grained shuffle. -1 means use tidb_max_tiflash_threads as stream_count.
### 2. What did you expect to see? (Required)
### 3. What did you see instead (Required)
### 4. What is your TiDB version? (Required)
master
",1,change behavior of fine grained shffule stream count bug report please answer these questions before submitting your issue thanks minimal reproduce step required means diable fine grained shuffle means use tidb max tiflash threads as stream count what did you expect to see required what did you see instead required what is your tidb version required master ,1
7329,9575840046.0,IssuesEvent,2019-05-07 07:37:23,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,addition between `time` and `interval` is not compatible with Mysql,for new contributors help wanted type/bug type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
SELECT time('12:34:56') + INTERVAL 1 SECOND;
```
2. What did you expect to see?
In Mysql
```
mysql> select time('12:34:56') + interval 1 second;
+--------------------------------------+
| time('12:34:56') + interval 1 second |
+--------------------------------------+
| 12:34:57 |
+--------------------------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
In TiDB
```
mysql> select time('12:34:56') + interval 1 second;
+--------------------------------------+
| time('12:34:56') + interval 1 second |
+--------------------------------------+
| 2019-04-30 12:34:57 |
+--------------------------------------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```tidb_version(): Release Version: v3.0.0-beta-463-g36bb1ae89```
In mysql's document:
`time('12:34:56') + interval 1 second` is same as `date_add(time('12:34:56'), interval 1 second)`
And
> The date argument specifies the starting date or datetime value. expr is an expression specifying the interval value to be added or subtracted from the starting date.",True,"addition between `time` and `interval` is not compatible with Mysql - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
SELECT time('12:34:56') + INTERVAL 1 SECOND;
```
2. What did you expect to see?
In Mysql
```
mysql> select time('12:34:56') + interval 1 second;
+--------------------------------------+
| time('12:34:56') + interval 1 second |
+--------------------------------------+
| 12:34:57 |
+--------------------------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
In TiDB
```
mysql> select time('12:34:56') + interval 1 second;
+--------------------------------------+
| time('12:34:56') + interval 1 second |
+--------------------------------------+
| 2019-04-30 12:34:57 |
+--------------------------------------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```tidb_version(): Release Version: v3.0.0-beta-463-g36bb1ae89```
In mysql's document:
`time('12:34:56') + interval 1 second` is same as `date_add(time('12:34:56'), interval 1 second)`
And
> The date argument specifies the starting date or datetime value. expr is an expression specifying the interval value to be added or subtracted from the starting date.",1,addition between time and interval is not compatible with mysql bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error sql select time interval second what did you expect to see in mysql mysql select time interval second time interval second row in set sec what did you see instead in tidb mysql select time interval second time interval second row in set sec what version of tidb are you using tidb server v or run select tidb version on tidb tidb version release version beta in mysql s document time interval second is same as date add time interval second and the date argument specifies the starting date or datetime value expr is an expression specifying the interval value to be added or subtracted from the starting date ,1
3711,6564638315.0,IssuesEvent,2017-09-08 03:04:16,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,Arithmetic results are not consistent with MySQL when overflow occurs,compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
SET @a:=999999999999999;
select @a + @a; -- 1999999999999998
SET @a:=9999999999999999;
select @a + @a; -- 20000000000000000
SET @a:=99999999999999999;
select @a + @a; -- 20000000000000000
select @a * @a; -- 1000000000000000000000000000000000000
SELECT -@a - @a; -- -2000000000000000000
SELECT @a / 0.5; -- 2000000000000000000
```
2. What did you expect to see?
```
@a + @a
1999999999999998
@a + @a
19999999999999998
@a + @a
199999999999999998
ERROR 1690 (22003) at line 7: BIGINT value is out of range in '((@`a`) * (@`a`))'
-@a - @a
-199999999999999998
@a / 0.5
199999999999999998.0000
```
3. What did you see instead?
```
@a + @a
1999999999999998
@a + @a
20000000000000000
@a + @a
200000000000000000
@a * @a
10000000000000000000000000000000000
-@a - @a
-200000000000000000
@a / 0.5
200000000000000000
```
4. What version of TiDB are you using (`tidb-server -V`)?
",True,"Arithmetic results are not consistent with MySQL when overflow occurs - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
SET @a:=999999999999999;
select @a + @a; -- 1999999999999998
SET @a:=9999999999999999;
select @a + @a; -- 20000000000000000
SET @a:=99999999999999999;
select @a + @a; -- 20000000000000000
select @a * @a; -- 1000000000000000000000000000000000000
SELECT -@a - @a; -- -2000000000000000000
SELECT @a / 0.5; -- 2000000000000000000
```
2. What did you expect to see?
```
@a + @a
1999999999999998
@a + @a
19999999999999998
@a + @a
199999999999999998
ERROR 1690 (22003) at line 7: BIGINT value is out of range in '((@`a`) * (@`a`))'
-@a - @a
-199999999999999998
@a / 0.5
199999999999999998.0000
```
3. What did you see instead?
```
@a + @a
1999999999999998
@a + @a
20000000000000000
@a + @a
200000000000000000
@a * @a
10000000000000000000000000000000000
-@a - @a
-200000000000000000
@a / 0.5
200000000000000000
```
4. What version of TiDB are you using (`tidb-server -V`)?
",1,arithmetic results are not consistent with mysql when overflow occurs please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error sql set a select a a set a select a a set a select a a select a a select a a select a what did you expect to see a a a a a a error at line bigint value is out of range in a a a a a what did you see instead a a a a a a a a a a a what version of tidb are you using tidb server v ,1
3790,6653174894.0,IssuesEvent,2017-09-29 07:09:11,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,No length limitation for comment of index,compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
CREATE TABLE t1 (id INT);
CREATE INDEX id_index ON t1 (id) COMMENT 'MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD';
```
2. What did you expect to see?
ERROR 1688 (HY000) at line 1: Comment for index 'id_index' is too long (max = 1024)
3. What did you see instead?
Query OK, 0 rows affected (0.05 sec)
4. What version of TiDB are you using (`tidb-server -V`)?
",True,"No length limitation for comment of index - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
CREATE TABLE t1 (id INT);
CREATE INDEX id_index ON t1 (id) COMMENT 'MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD=40MERGE_THRESHOLD';
```
2. What did you expect to see?
ERROR 1688 (HY000) at line 1: Comment for index 'id_index' is too long (max = 1024)
3. What did you see instead?
Query OK, 0 rows affected (0.05 sec)
4. What version of TiDB are you using (`tidb-server -V`)?
",1,no length limitation for comment of index please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error sql create table id int create index id index on id comment merge threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold threshold what did you expect to see error at line comment for index id index is too long max what did you see instead query ok rows affected sec what version of tidb are you using tidb server v ,1
5094,7702926353.0,IssuesEvent,2018-05-21 05:59:49,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,inconsistent create table behavior when set timestamp col default value to 0,compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
``` go
create table t(a timestamp not null default 0);
```
2. What did you expect to see?
``` go
mysql(127.0.0.1)> create table t(a timestamp null default 0);
ERROR 1067 (42000): Invalid default value for 'a'
```
3. What did you see instead?
```go
tidb(127.0.0.1)> create table t (a timestamp null default 0);
Query OK, 0 rows affected (0.13 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```go
tidb(127.0.0.1)> select tidb_version();
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v2.0.0-rc.3-12-gb6b708aa4
Git Commit Hash: b6b708aa4369f89147a3f9a31a9daff38c489999
Git Branch: master
UTC Build Time: 2018-04-03 08:14:49
GoVersion: go version go1.9.5 linux/amd64
TiKV Min Version: 1.1.0-dev.2 |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
```
",True,"inconsistent create table behavior when set timestamp col default value to 0 - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
``` go
create table t(a timestamp not null default 0);
```
2. What did you expect to see?
``` go
mysql(127.0.0.1)> create table t(a timestamp null default 0);
ERROR 1067 (42000): Invalid default value for 'a'
```
3. What did you see instead?
```go
tidb(127.0.0.1)> create table t (a timestamp null default 0);
Query OK, 0 rows affected (0.13 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```go
tidb(127.0.0.1)> select tidb_version();
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v2.0.0-rc.3-12-gb6b708aa4
Git Commit Hash: b6b708aa4369f89147a3f9a31a9daff38c489999
Git Branch: master
UTC Build Time: 2018-04-03 08:14:49
GoVersion: go version go1.9.5 linux/amd64
TiKV Min Version: 1.1.0-dev.2 |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
```
",1,inconsistent create table behavior when set timestamp col default value to please answer these questions before submitting your issue thanks what did you do go create table t a timestamp not null default what did you expect to see go mysql create table t a timestamp null default error invalid default value for a what did you see instead go tidb create table t a timestamp null default query ok rows affected sec what version of tidb are you using tidb server v or run select tidb version on tidb go tidb select tidb version tidb version release version rc git commit hash git branch master utc build time goversion go version linux tikv min version dev ,1
7733,9973786046.0,IssuesEvent,2019-07-09 09:07:42,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,Function information in error message should take along with database name,for new contributors help wanted type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```mysql
SELECT xxx( NULL );
```
2. What did you expect to see?
```
ERROR 1305 (42000): FUNCTION randgen_test.xxx does not exist
```
3. What did you see instead?
Function information should be . format.
```
ERROR 1305 (42000): FUNCTION xxx does not exist
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
",True,"Function information in error message should take along with database name - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```mysql
SELECT xxx( NULL );
```
2. What did you expect to see?
```
ERROR 1305 (42000): FUNCTION randgen_test.xxx does not exist
```
3. What did you see instead?
Function information should be . format.
```
ERROR 1305 (42000): FUNCTION xxx does not exist
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
",1,function information in error message should take along with database name bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error mysql select xxx null what did you expect to see error function randgen test xxx does not exist what did you see instead function information should be format error function xxx does not exist what version of tidb are you using tidb server v or run select tidb version on tidb ,1
5726,8196109866.0,IssuesEvent,2018-08-31 08:45:39,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,type year has an unsigned flag,type/compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
mysql> show create table testyear;
+----------+-------------------------------------------------------------------------------------------+
| Table | Create Table |
+----------+-------------------------------------------------------------------------------------------+
| testyear | CREATE TABLE `testyear` (
`i` year(4) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 |
+----------+-------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> select * from testyear;
Field 1: `i`
Catalog: `def`
Database: `test`
Table: `testyear`
Org_table: `testyear`
Type: YEAR
Collation: binary (63)
Length: 4
Max_length: 0
Decimals: 0
Flags: UNSIGNED ZEROFILL NUM
0 rows in set (0.00 sec)
```
2. What did you expect to see?
Flags: UNSIGNED ZEROFILL NUM
3. What did you see instead?
Flags: ZEROFILL NUM
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
eec68995689d5811f4d52846586e969652ed8ffc
",True,"type year has an unsigned flag - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
mysql> show create table testyear;
+----------+-------------------------------------------------------------------------------------------+
| Table | Create Table |
+----------+-------------------------------------------------------------------------------------------+
| testyear | CREATE TABLE `testyear` (
`i` year(4) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 |
+----------+-------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> select * from testyear;
Field 1: `i`
Catalog: `def`
Database: `test`
Table: `testyear`
Org_table: `testyear`
Type: YEAR
Collation: binary (63)
Length: 4
Max_length: 0
Decimals: 0
Flags: UNSIGNED ZEROFILL NUM
0 rows in set (0.00 sec)
```
2. What did you expect to see?
Flags: UNSIGNED ZEROFILL NUM
3. What did you see instead?
Flags: ZEROFILL NUM
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
eec68995689d5811f4d52846586e969652ed8ffc
",1,type year has an unsigned flag please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error mysql show create table testyear table create table testyear create table testyear i year default null engine innodb default charset row in set sec mysql select from testyear field i catalog def database test table testyear org table testyear type year collation binary length max length decimals flags unsigned zerofill num rows in set sec what did you expect to see flags unsigned zerofill num what did you see instead flags zerofill num what version of tidb are you using tidb server v or run select tidb version on tidb ,1
3238,6193698498.0,IssuesEvent,2017-07-05 08:00:12,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Parsing `SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED` failed,compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
Dealing with statements invoked by sonarqube.
2. What did you expect to see?
Parse ok.
3. What did you see instead?
`[parser:1]syntax error`
4. What version of TiDB are you using (`tidb-server -V`)?
`git rev-parse origin/master`
`b780d6afefcbfca2b4f2b037cce5fb10ef0875f1`
",True,"Parsing `SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED` failed - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
Dealing with statements invoked by sonarqube.
2. What did you expect to see?
Parse ok.
3. What did you see instead?
`[parser:1]syntax error`
4. What version of TiDB are you using (`tidb-server -V`)?
`git rev-parse origin/master`
`b780d6afefcbfca2b4f2b037cce5fb10ef0875f1`
",1,parsing set session transaction isolation level read uncommitted failed please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error dealing with statements invoked by sonarqube what did you expect to see parse ok what did you see instead syntax error what version of tidb are you using tidb server v git rev parse origin master ,1
6966,9247700618.0,IssuesEvent,2019-03-15 02:05:53,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,connect close tidb error when use mysql-connector pooling,help wanted type/compatibility,"```
#!/usr/bin/python
#coding: utf-8
import mysql.connector.pooling
MYSQL_HOST = 'x.x.x.x'
MYSQL_PORT = 4000
MYSQL_USER = 'tidb'
MYSQL_PWD = 'tidb'
MYSQL_DB_NAME = 'mysql'
mysql_pool = mysql.connector.pooling.MySQLConnectionPool(
pool_name=""mypool"",
pool_size=20,
host=MYSQL_HOST,
port=MYSQL_PORT,
database=MYSQL_DB_NAME,
user=MYSQL_USER,
password=MYSQL_PWD,
pool_reset_session=True
)
try:
conn = mysql_pool.get_connection()
cursor = conn.cursor()
sql = 'select * from user limit 2'
cursor.execute(sql)
data = cursor.fetchall()
print data
except Exception as e:
print e
finally:
cursor.close()
conn.close() #here exception!
```
File ""x.py"", line 33, in
conn.close()
File ""/usr/lib64/python2.7/site-packages/mysql/connector/pooling.py"", line 123, in close
cnx.reset_session()
File ""/usr/lib64/python2.7/site-packages/mysql/connector/connection.py"", line 771, in reset_session
self.cmd_reset_connection()
File ""/usr/lib64/python2.7/site-packages/mysql/connector/connection.py"", line 1121, in cmd_reset_connection
self._handle_ok(self._send_cmd(ServerCmd.RESET_CONNECTION))
File ""/usr/lib64/python2.7/site-packages/mysql/connector/connection.py"", line 375, in _handle_ok
raise errors.get_exception(packet)
mysql.connector.errors.DatabaseError: 1105 (HY000): ERROR 1105 (HY000): command 31 not supported now
tidb version : v2.1.4",True,"connect close tidb error when use mysql-connector pooling - ```
#!/usr/bin/python
#coding: utf-8
import mysql.connector.pooling
MYSQL_HOST = 'x.x.x.x'
MYSQL_PORT = 4000
MYSQL_USER = 'tidb'
MYSQL_PWD = 'tidb'
MYSQL_DB_NAME = 'mysql'
mysql_pool = mysql.connector.pooling.MySQLConnectionPool(
pool_name=""mypool"",
pool_size=20,
host=MYSQL_HOST,
port=MYSQL_PORT,
database=MYSQL_DB_NAME,
user=MYSQL_USER,
password=MYSQL_PWD,
pool_reset_session=True
)
try:
conn = mysql_pool.get_connection()
cursor = conn.cursor()
sql = 'select * from user limit 2'
cursor.execute(sql)
data = cursor.fetchall()
print data
except Exception as e:
print e
finally:
cursor.close()
conn.close() #here exception!
```
File ""x.py"", line 33, in
conn.close()
File ""/usr/lib64/python2.7/site-packages/mysql/connector/pooling.py"", line 123, in close
cnx.reset_session()
File ""/usr/lib64/python2.7/site-packages/mysql/connector/connection.py"", line 771, in reset_session
self.cmd_reset_connection()
File ""/usr/lib64/python2.7/site-packages/mysql/connector/connection.py"", line 1121, in cmd_reset_connection
self._handle_ok(self._send_cmd(ServerCmd.RESET_CONNECTION))
File ""/usr/lib64/python2.7/site-packages/mysql/connector/connection.py"", line 375, in _handle_ok
raise errors.get_exception(packet)
mysql.connector.errors.DatabaseError: 1105 (HY000): ERROR 1105 (HY000): command 31 not supported now
tidb version : v2.1.4",1,connect close tidb error when use mysql connector pooling usr bin python coding utf import mysql connector pooling mysql host x x x x mysql port mysql user tidb mysql pwd tidb mysql db name mysql mysql pool mysql connector pooling mysqlconnectionpool pool name mypool pool size host mysql host port mysql port database mysql db name user mysql user password mysql pwd pool reset session true try conn mysql pool get connection cursor conn cursor sql select from user limit cursor execute sql data cursor fetchall print data except exception as e print e finally cursor close conn close here exception file x py line in conn close file usr site packages mysql connector pooling py line in close cnx reset session file usr site packages mysql connector connection py line in reset session self cmd reset connection file usr site packages mysql connector connection py line in cmd reset connection self handle ok self send cmd servercmd reset connection file usr site packages mysql connector connection py line in handle ok raise errors get exception packet mysql connector errors databaseerror error command not supported now tidb version ,1
5799,8247236186.0,IssuesEvent,2018-09-11 15:01:38,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Date time literal compability,help wanted type/compatibility,"Please Add below syntax support.
```
DATE 'str'
TIME 'str'
TIMESTAMP 'str'
```
https://dev.mysql.com/doc/refman/5.7/en/date-and-time-literals.html
",True,"Date time literal compability - Please Add below syntax support.
```
DATE 'str'
TIME 'str'
TIMESTAMP 'str'
```
https://dev.mysql.com/doc/refman/5.7/en/date-and-time-literals.html
",1,date time literal compability please add below syntax support date str time str timestamp str ,1
7076,9360001700.0,IssuesEvent,2019-04-02 08:25:28,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,JSON Columns order is not same with MySQL.,type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```SQL
DROP TABLE IF EXISTS user;
CREATE TABLE user(id INT PRIMARY KEY, name VARCHAR(20) , lastlogininfo JSON);
INSERT INTO user VALUES(1 ,""keyi"",'{""time"":""2019-04-12 12:00:00"",""ip"":""192.168.1.1"",""result"":""fail""}');
INSERT INTO user VALUES(2 ,""yike"",'{""time"":""2019-04-12 18:20:00"",""ip"":""192.168.1.0"",""result"":""success""}');
SELECT lastlogininfo FROM user WHERE name = 'keyi';
SELECT * FROM user WHERE lastlogininfo ->'$.time' > '2019-04-12';
SELECT * FROM user WHERE JSON_EXTRACT(lastlogininfo,'$.time') > '2019-04-12';
```
2. What did you expect to see?
## In MySQL
```SQL
mysql> DROP TABLE IF EXISTS user;
Query OK, 0 rows affected (0.01 sec)
mysql> CREATE TABLE user(id INT PRIMARY KEY, name VARCHAR(20) , lastlogininfo JSON);
Query OK, 0 rows affected (0.02 sec)
mysql> INSERT INTO user VALUES(1 ,""keyi"",'{""time"":""2019-04-12 12:00:00"",""ip"":""192.168.1.1"",""result"":""fail""}');
Query OK, 1 row affected (0.00 sec)
mysql> INSERT INTO user VALUES(2 ,""yike"",'{""time"":""2019-04-12 18:20:00"",""ip"":""192.168.1.0"",""result"":""success""}');
Query OK, 1 row affected (0.00 sec)
mysql> SELECT lastlogininfo FROM user WHERE name = 'keyi';
+------------------------------------------------------------------------+
| lastlogininfo |
+------------------------------------------------------------------------+
| {""ip"": ""192.168.1.1"", ""time"": ""2019-04-12 12:00:00"", ""result"": ""fail""} |
+------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> SELECT * FROM user WHERE lastlogininfo ->'$.time' > '2019-04-12';
+----+------+---------------------------------------------------------------------------+
| id | name | lastlogininfo |
+----+------+---------------------------------------------------------------------------+
| 1 | keyi | {""ip"": ""192.168.1.1"", ""time"": ""2019-04-12 12:00:00"", ""result"": ""fail""} |
| 2 | yike | {""ip"": ""192.168.1.0"", ""time"": ""2019-04-12 18:20:00"", ""result"": ""success""} |
+----+------+---------------------------------------------------------------------------+
2 rows in set (0.00 sec)
mysql> SELECT * FROM user WHERE JSON_EXTRACT(lastlogininfo,'$.time') > '2019-04-12';
+----+------+---------------------------------------------------------------------------+
| id | name | lastlogininfo |
+----+------+---------------------------------------------------------------------------+
| 1 | keyi | {""ip"": ""192.168.1.1"", ""time"": ""2019-04-12 12:00:00"", ""result"": ""fail""} |
| 2 | yike | {""ip"": ""192.168.1.0"", ""time"": ""2019-04-12 18:20:00"", ""result"": ""success""} |
+----+------+---------------------------------------------------------------------------+
2 rows in set (0.01 sec)
mysql> select version();
+-------------------------+
| version() |
+-------------------------+
| 5.7.25-0ubuntu0.18.04.2 |
+-------------------------+
1 row in set (0.00 sec)
mysql>
```
3. What did you see instead?
## In TiDB
```SQL
mysql> DROP TABLE IF EXISTS user;
Query OK, 0 rows affected (0.02 sec)
mysql> CREATE TABLE user(id INT PRIMARY KEY, name VARCHAR(20) , lastlogininfo JSON);
Query OK, 0 rows affected (0.02 sec)
mysql> INSERT INTO user VALUES(1 ,""keyi"",'{""time"":""2019-04-12 12:00:00"",""ip"":""192.168.1.1"",""result"":""fail""}');
Query OK, 1 row affected (0.01 sec)
mysql> INSERT INTO user VALUES(2 ,""yike"",'{""time"":""2019-04-12 18:20:00"",""ip"":""192.168.1.0"",""result"":""success""}');
Query OK, 1 row affected (0.01 sec)
mysql> SELECT lastlogininfo FROM user WHERE name = 'keyi';
+------------------------------------------------------------------------+
| lastlogininfo |
+------------------------------------------------------------------------+
| {""ip"": ""192.168.1.1"", ""result"": ""fail"", ""time"": ""2019-04-12 12:00:00""} |
+------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> SELECT * FROM user WHERE lastlogininfo ->'$.time' > '2019-04-12';
+----+------+---------------------------------------------------------------------------+
| id | name | lastlogininfo |
+----+------+---------------------------------------------------------------------------+
| 1 | keyi | {""ip"": ""192.168.1.1"", ""result"": ""fail"", ""time"": ""2019-04-12 12:00:00""} |
| 2 | yike | {""ip"": ""192.168.1.0"", ""result"": ""success"", ""time"": ""2019-04-12 18:20:00""} |
+----+------+---------------------------------------------------------------------------+
2 rows in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```SQL
mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v3.0.0-beta-321-gc6a757b24
Git Commit Hash: c6a757b2435965a72ada9d61ea8b7a367bd89b5f
Git Branch: master
UTC Build Time: 2019-04-02 02:38:04
GoVersion: go version go1.12.1 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
1 row in set (0.00 sec)
```
",True,"JSON Columns order is not same with MySQL. - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```SQL
DROP TABLE IF EXISTS user;
CREATE TABLE user(id INT PRIMARY KEY, name VARCHAR(20) , lastlogininfo JSON);
INSERT INTO user VALUES(1 ,""keyi"",'{""time"":""2019-04-12 12:00:00"",""ip"":""192.168.1.1"",""result"":""fail""}');
INSERT INTO user VALUES(2 ,""yike"",'{""time"":""2019-04-12 18:20:00"",""ip"":""192.168.1.0"",""result"":""success""}');
SELECT lastlogininfo FROM user WHERE name = 'keyi';
SELECT * FROM user WHERE lastlogininfo ->'$.time' > '2019-04-12';
SELECT * FROM user WHERE JSON_EXTRACT(lastlogininfo,'$.time') > '2019-04-12';
```
2. What did you expect to see?
## In MySQL
```SQL
mysql> DROP TABLE IF EXISTS user;
Query OK, 0 rows affected (0.01 sec)
mysql> CREATE TABLE user(id INT PRIMARY KEY, name VARCHAR(20) , lastlogininfo JSON);
Query OK, 0 rows affected (0.02 sec)
mysql> INSERT INTO user VALUES(1 ,""keyi"",'{""time"":""2019-04-12 12:00:00"",""ip"":""192.168.1.1"",""result"":""fail""}');
Query OK, 1 row affected (0.00 sec)
mysql> INSERT INTO user VALUES(2 ,""yike"",'{""time"":""2019-04-12 18:20:00"",""ip"":""192.168.1.0"",""result"":""success""}');
Query OK, 1 row affected (0.00 sec)
mysql> SELECT lastlogininfo FROM user WHERE name = 'keyi';
+------------------------------------------------------------------------+
| lastlogininfo |
+------------------------------------------------------------------------+
| {""ip"": ""192.168.1.1"", ""time"": ""2019-04-12 12:00:00"", ""result"": ""fail""} |
+------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> SELECT * FROM user WHERE lastlogininfo ->'$.time' > '2019-04-12';
+----+------+---------------------------------------------------------------------------+
| id | name | lastlogininfo |
+----+------+---------------------------------------------------------------------------+
| 1 | keyi | {""ip"": ""192.168.1.1"", ""time"": ""2019-04-12 12:00:00"", ""result"": ""fail""} |
| 2 | yike | {""ip"": ""192.168.1.0"", ""time"": ""2019-04-12 18:20:00"", ""result"": ""success""} |
+----+------+---------------------------------------------------------------------------+
2 rows in set (0.00 sec)
mysql> SELECT * FROM user WHERE JSON_EXTRACT(lastlogininfo,'$.time') > '2019-04-12';
+----+------+---------------------------------------------------------------------------+
| id | name | lastlogininfo |
+----+------+---------------------------------------------------------------------------+
| 1 | keyi | {""ip"": ""192.168.1.1"", ""time"": ""2019-04-12 12:00:00"", ""result"": ""fail""} |
| 2 | yike | {""ip"": ""192.168.1.0"", ""time"": ""2019-04-12 18:20:00"", ""result"": ""success""} |
+----+------+---------------------------------------------------------------------------+
2 rows in set (0.01 sec)
mysql> select version();
+-------------------------+
| version() |
+-------------------------+
| 5.7.25-0ubuntu0.18.04.2 |
+-------------------------+
1 row in set (0.00 sec)
mysql>
```
3. What did you see instead?
## In TiDB
```SQL
mysql> DROP TABLE IF EXISTS user;
Query OK, 0 rows affected (0.02 sec)
mysql> CREATE TABLE user(id INT PRIMARY KEY, name VARCHAR(20) , lastlogininfo JSON);
Query OK, 0 rows affected (0.02 sec)
mysql> INSERT INTO user VALUES(1 ,""keyi"",'{""time"":""2019-04-12 12:00:00"",""ip"":""192.168.1.1"",""result"":""fail""}');
Query OK, 1 row affected (0.01 sec)
mysql> INSERT INTO user VALUES(2 ,""yike"",'{""time"":""2019-04-12 18:20:00"",""ip"":""192.168.1.0"",""result"":""success""}');
Query OK, 1 row affected (0.01 sec)
mysql> SELECT lastlogininfo FROM user WHERE name = 'keyi';
+------------------------------------------------------------------------+
| lastlogininfo |
+------------------------------------------------------------------------+
| {""ip"": ""192.168.1.1"", ""result"": ""fail"", ""time"": ""2019-04-12 12:00:00""} |
+------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> SELECT * FROM user WHERE lastlogininfo ->'$.time' > '2019-04-12';
+----+------+---------------------------------------------------------------------------+
| id | name | lastlogininfo |
+----+------+---------------------------------------------------------------------------+
| 1 | keyi | {""ip"": ""192.168.1.1"", ""result"": ""fail"", ""time"": ""2019-04-12 12:00:00""} |
| 2 | yike | {""ip"": ""192.168.1.0"", ""result"": ""success"", ""time"": ""2019-04-12 18:20:00""} |
+----+------+---------------------------------------------------------------------------+
2 rows in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```SQL
mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v3.0.0-beta-321-gc6a757b24
Git Commit Hash: c6a757b2435965a72ada9d61ea8b7a367bd89b5f
Git Branch: master
UTC Build Time: 2019-04-02 02:38:04
GoVersion: go version go1.12.1 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
1 row in set (0.00 sec)
```
",1,json columns order is not same with mysql bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error sql drop table if exists user create table user id int primary key name varchar lastlogininfo json insert into user values keyi time ip result fail insert into user values yike time ip result success select lastlogininfo from user where name keyi select from user where lastlogininfo time select from user where json extract lastlogininfo time what did you expect to see in mysql sql mysql drop table if exists user query ok rows affected sec mysql create table user id int primary key name varchar lastlogininfo json query ok rows affected sec mysql insert into user values keyi time ip result fail query ok row affected sec mysql insert into user values yike time ip result success query ok row affected sec mysql select lastlogininfo from user where name keyi lastlogininfo ip time result fail row in set sec mysql select from user where lastlogininfo time id name lastlogininfo keyi ip time result fail yike ip time result success rows in set sec mysql select from user where json extract lastlogininfo time id name lastlogininfo keyi ip time result fail yike ip time result success rows in set sec mysql select version version row in set sec mysql what did you see instead in tidb sql mysql drop table if exists user query ok rows affected sec mysql create table user id int primary key name varchar lastlogininfo json query ok rows affected sec mysql insert into user values keyi time ip result fail query ok row affected sec mysql insert into user values yike time ip result success query ok row affected sec mysql select lastlogininfo from user where name keyi lastlogininfo ip result fail time row in set sec mysql select from user where lastlogininfo time id name lastlogininfo keyi ip result fail time yike ip result success time rows in set sec what version of tidb are you using tidb server v or run select tidb version on tidb sql mysql select tidb version g row tidb version release version beta git commit hash git branch master utc build time goversion go version linux race enabled false tikv min version alpha check table before drop false row in set sec ,1
8204,10287748012.0,IssuesEvent,2019-08-27 09:35:37,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Function arguments in error message should represent as a column name if possible.,component/expression help wanted type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```mysql
SELECT EXP(col_float_unsigned) FROM table40_int_autoinc;
SELECT EXP(17324);
```
2. What did you expect to see?
```mysql
mysql> SELECT EXP(col_float_unsigned) FROM table40_int_autoinc;
ERROR 1690 (22003): DOUBLE value is out of range in 'exp(`randgen_test`.`table40_int_autoinc`.`col_float_unsigned`)'
mysql> SELECT EXP(17324);
ERROR 1690 (22003): DOUBLE value is out of range in 'exp(17324)'
```
3. What did you see instead?
```mysql
mysql> SELECT EXP(col_float_unsigned) FROM table40_int_autoinc;
ERROR 1690 (22003): DOUBLE value is out of range in 'exp(17324)'
mysql> SELECT EXP(17324);
ERROR 1690 (22003): DOUBLE value is out of range in 'exp(17324)'
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
8c20289c7",True,"Function arguments in error message should represent as a column name if possible. - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```mysql
SELECT EXP(col_float_unsigned) FROM table40_int_autoinc;
SELECT EXP(17324);
```
2. What did you expect to see?
```mysql
mysql> SELECT EXP(col_float_unsigned) FROM table40_int_autoinc;
ERROR 1690 (22003): DOUBLE value is out of range in 'exp(`randgen_test`.`table40_int_autoinc`.`col_float_unsigned`)'
mysql> SELECT EXP(17324);
ERROR 1690 (22003): DOUBLE value is out of range in 'exp(17324)'
```
3. What did you see instead?
```mysql
mysql> SELECT EXP(col_float_unsigned) FROM table40_int_autoinc;
ERROR 1690 (22003): DOUBLE value is out of range in 'exp(17324)'
mysql> SELECT EXP(17324);
ERROR 1690 (22003): DOUBLE value is out of range in 'exp(17324)'
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
8c20289c7",1,function arguments in error message should represent as a column name if possible bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error mysql select exp col float unsigned from int autoinc select exp what did you expect to see mysql mysql select exp col float unsigned from int autoinc error double value is out of range in exp randgen test int autoinc col float unsigned mysql select exp error double value is out of range in exp what did you see instead mysql mysql select exp col float unsigned from int autoinc error double value is out of range in exp mysql select exp error double value is out of range in exp what version of tidb are you using tidb server v or run select tidb version on tidb ,1
11635,13684960343.0,IssuesEvent,2020-09-30 06:14:21,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Support VALUES and TABLE statements syntax,challenge-program difficulty/easy high-performance picked sig/DDL status/help-wanted type/compatibility,"## Description
Related parser issue: https://github.com/pingcap/parser/issues/869
### Example
The [`TABLE`](https://dev.mysql.com/doc/refman/8.0/en/table.html) and [`VALUES`](https://dev.mysql.com/doc/refman/8.0/en/values.html) statements are two query specification statements introduced in [MySQL 8.0.19](https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-19.html#mysqld-8-0-19-sql-syntax).
```sql
TABLE tbl_name [ORDER BY col_name] [LIMIT limit [OFFSET offset]];
VALUES ROW(val1, val2, …), … [ORDER BY column_N [LIMIT limit [OFFSET offset]]];
```
### Explaination
These can be used in place everywhere a `SELECT` statement was expected, including:
* UNION
* JOIN
* subqueries
* SELECT INTO OUTFILE
* INSERT INTO SELECT
* CREATE TABLE SELECT
### Solution
For a reference, please see https://github.com/pingcap/parser/pull/680 and learn how to support a new syntax in the parser.
## Score
* 300
## SIG Slack Channel
You can join [#sig-ddl](https://app.slack.com/client/TH91JCS4W/CMAKWBNJU) on slack in your spare time to discuss and get help with mentors or others.
## Mentor(s)
* @tangenta
Contact the mentors: **#tidb-challenge-program** channel in [TiDB Community](https://join.slack.com/t/tidbcommunity/shared_invite/enQtNzc0MzI4ODExMDc4LWYwYmIzMjZkYzJiNDUxMmZlN2FiMGJkZjAyMzQ5NGU0NGY0NzI3NTYwMjAyNGQ1N2I2ZjAxNzc1OGUwYWM0NzE) Slack Workspace
## Recommended Skills
* Parser
* Golang
## Learning Materials
* [Parser Quickstart](https://github.com/pingcap/parser/blob/master/docs/quickstart.md)
* [Parser implementation(CN)](https://pingcap.com/blog-cn/tidb-source-code-reading-5/)
",True,"Support VALUES and TABLE statements syntax - ## Description
Related parser issue: https://github.com/pingcap/parser/issues/869
### Example
The [`TABLE`](https://dev.mysql.com/doc/refman/8.0/en/table.html) and [`VALUES`](https://dev.mysql.com/doc/refman/8.0/en/values.html) statements are two query specification statements introduced in [MySQL 8.0.19](https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-19.html#mysqld-8-0-19-sql-syntax).
```sql
TABLE tbl_name [ORDER BY col_name] [LIMIT limit [OFFSET offset]];
VALUES ROW(val1, val2, …), … [ORDER BY column_N [LIMIT limit [OFFSET offset]]];
```
### Explaination
These can be used in place everywhere a `SELECT` statement was expected, including:
* UNION
* JOIN
* subqueries
* SELECT INTO OUTFILE
* INSERT INTO SELECT
* CREATE TABLE SELECT
### Solution
For a reference, please see https://github.com/pingcap/parser/pull/680 and learn how to support a new syntax in the parser.
## Score
* 300
## SIG Slack Channel
You can join [#sig-ddl](https://app.slack.com/client/TH91JCS4W/CMAKWBNJU) on slack in your spare time to discuss and get help with mentors or others.
## Mentor(s)
* @tangenta
Contact the mentors: **#tidb-challenge-program** channel in [TiDB Community](https://join.slack.com/t/tidbcommunity/shared_invite/enQtNzc0MzI4ODExMDc4LWYwYmIzMjZkYzJiNDUxMmZlN2FiMGJkZjAyMzQ5NGU0NGY0NzI3NTYwMjAyNGQ1N2I2ZjAxNzc1OGUwYWM0NzE) Slack Workspace
## Recommended Skills
* Parser
* Golang
## Learning Materials
* [Parser Quickstart](https://github.com/pingcap/parser/blob/master/docs/quickstart.md)
* [Parser implementation(CN)](https://pingcap.com/blog-cn/tidb-source-code-reading-5/)
",1,support values and table statements syntax description related parser issue example the and statements are two query specification statements introduced in sql table tbl name values row … … explaination these can be used in place everywhere a select statement was expected including union join subqueries select into outfile insert into select create table select solution for a reference please see and learn how to support a new syntax in the parser score sig slack channel you can join on slack in your spare time to discuss and get help with mentors or others mentor s tangenta contact the mentors tidb challenge program channel in slack workspace recommended skills parser golang learning materials ,1
16370,9379335340.0,IssuesEvent,2019-04-04 14:44:12,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Optimize the convertColumnInfo function,help wanted type/performance,"This function can be more faster if we use the go idiom and by avoiding lookup from a map mysql.CharsetIDs
```go
func convertColumnInfo(fld *ast.ResultField) (ci *ColumnInfo) {
ci = new(ColumnInfo)
ci.Name = fld.ColumnAsName.O
ci.OrgName = fld.Column.Name.O
ci.Table = fld.TableAsName.O
if fld.Table != nil {
ci.OrgTable = fld.Table.Name.O
}
ci.Schema = fld.DBName.O
ci.Flag = uint16(fld.Column.Flag)
ci.Charset = uint16(mysql.CharsetIDs[fld.Column.Charset])
if fld.Column.Flen == types.UnspecifiedLength {
ci.ColumnLength = 0
} else {
ci.ColumnLength = uint32(fld.Column.Flen)
}
if fld.Column.Tp == mysql.TypeNewDecimal {
// Consider the negative sign.
ci.ColumnLength++
if fld.Column.Decimal > types.DefaultFsp {
// Consider the decimal point.
ci.ColumnLength++
}
} else if types.IsString(fld.Column.Tp) {
// Fix issue #4540.
// The flen is a hint, not a precise value, so most client will not use the value.
// But we found in rare MySQL client, like Navicat for MySQL(version before 12) will truncate
// the `show create table` result. To fix this case, we must use a large enough flen to prevent
// the truncation, in MySQL, it will multiply bytes length by a multiple based on character set.
// For examples:
// * latin, the multiple is 1
// * gb2312, the multiple is 2
// * Utf-8, the multiple is 3
// * utf8mb4, the multiple is 4
// We used to check non-string types to avoid the truncation problem in some MySQL
// client such as Navicat. Now we only allow string type enter this branch.
charsetDesc, err := charset.GetCharsetDesc(fld.Column.Charset)
if err != nil {
ci.ColumnLength = ci.ColumnLength * 4
} else {
ci.ColumnLength = ci.ColumnLength * uint32(charsetDesc.Maxlen)
}
}
if fld.Column.Decimal == types.UnspecifiedLength {
if fld.Column.Tp == mysql.TypeDuration {
ci.Decimal = types.DefaultFsp
} else {
ci.Decimal = mysql.NotFixedDec
}
} else {
ci.Decimal = uint8(fld.Column.Decimal)
}
ci.Type = fld.Column.Tp
// Keep things compatible for old clients.
// Refer to mysql-server/sql/protocol.cc send_result_set_metadata()
if ci.Type == mysql.TypeVarchar {
ci.Type = mysql.TypeVarString
}
return
}```",True,"Optimize the convertColumnInfo function - This function can be more faster if we use the go idiom and by avoiding lookup from a map mysql.CharsetIDs
```go
func convertColumnInfo(fld *ast.ResultField) (ci *ColumnInfo) {
ci = new(ColumnInfo)
ci.Name = fld.ColumnAsName.O
ci.OrgName = fld.Column.Name.O
ci.Table = fld.TableAsName.O
if fld.Table != nil {
ci.OrgTable = fld.Table.Name.O
}
ci.Schema = fld.DBName.O
ci.Flag = uint16(fld.Column.Flag)
ci.Charset = uint16(mysql.CharsetIDs[fld.Column.Charset])
if fld.Column.Flen == types.UnspecifiedLength {
ci.ColumnLength = 0
} else {
ci.ColumnLength = uint32(fld.Column.Flen)
}
if fld.Column.Tp == mysql.TypeNewDecimal {
// Consider the negative sign.
ci.ColumnLength++
if fld.Column.Decimal > types.DefaultFsp {
// Consider the decimal point.
ci.ColumnLength++
}
} else if types.IsString(fld.Column.Tp) {
// Fix issue #4540.
// The flen is a hint, not a precise value, so most client will not use the value.
// But we found in rare MySQL client, like Navicat for MySQL(version before 12) will truncate
// the `show create table` result. To fix this case, we must use a large enough flen to prevent
// the truncation, in MySQL, it will multiply bytes length by a multiple based on character set.
// For examples:
// * latin, the multiple is 1
// * gb2312, the multiple is 2
// * Utf-8, the multiple is 3
// * utf8mb4, the multiple is 4
// We used to check non-string types to avoid the truncation problem in some MySQL
// client such as Navicat. Now we only allow string type enter this branch.
charsetDesc, err := charset.GetCharsetDesc(fld.Column.Charset)
if err != nil {
ci.ColumnLength = ci.ColumnLength * 4
} else {
ci.ColumnLength = ci.ColumnLength * uint32(charsetDesc.Maxlen)
}
}
if fld.Column.Decimal == types.UnspecifiedLength {
if fld.Column.Tp == mysql.TypeDuration {
ci.Decimal = types.DefaultFsp
} else {
ci.Decimal = mysql.NotFixedDec
}
} else {
ci.Decimal = uint8(fld.Column.Decimal)
}
ci.Type = fld.Column.Tp
// Keep things compatible for old clients.
// Refer to mysql-server/sql/protocol.cc send_result_set_metadata()
if ci.Type == mysql.TypeVarchar {
ci.Type = mysql.TypeVarString
}
return
}```",0,optimize the convertcolumninfo function this function can be more faster if we use the go idiom and by avoiding lookup from a map mysql charsetids go func convertcolumninfo fld ast resultfield ci columninfo ci new columninfo ci name fld columnasname o ci orgname fld column name o ci table fld tableasname o if fld table nil ci orgtable fld table name o ci schema fld dbname o ci flag fld column flag ci charset mysql charsetids if fld column flen types unspecifiedlength ci columnlength else ci columnlength fld column flen if fld column tp mysql typenewdecimal consider the negative sign ci columnlength if fld column decimal types defaultfsp consider the decimal point ci columnlength else if types isstring fld column tp fix issue the flen is a hint not a precise value so most client will not use the value but we found in rare mysql client like navicat for mysql version before will truncate the show create table result to fix this case we must use a large enough flen to prevent the truncation in mysql it will multiply bytes length by a multiple based on character set for examples latin the multiple is the multiple is utf the multiple is the multiple is we used to check non string types to avoid the truncation problem in some mysql client such as navicat now we only allow string type enter this branch charsetdesc err charset getcharsetdesc fld column charset if err nil ci columnlength ci columnlength else ci columnlength ci columnlength charsetdesc maxlen if fld column decimal types unspecifiedlength if fld column tp mysql typeduration ci decimal types defaultfsp else ci decimal mysql notfixeddec else ci decimal fld column decimal ci type fld column tp keep things compatible for old clients refer to mysql server sql protocol cc send result set metadata if ci type mysql typevarchar ci type mysql typevarstring return ,0
11037,13066304399.0,IssuesEvent,2020-07-30 21:24:58,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,"No support for std(all a), variance(all a), bit_or(all a), bit_and(all a)",status/help-wanted type/compatibility type/duplicate,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
create table t1 (grp int, a bigint unsigned, c char(10) not null);
insert into t1 values (1,1,""a"");
insert into t1 values (2,2,""b"");
insert into t1 values (2,3,""c"");
select sum(all a),count(all a),avg(all a),std(all a),variance(all a),bit_or(all a),bit_and(all a),min(all a),max(all a),min(all c),max(all c) from t1;
```
2. What did you expect to see?
```
sum(all a) count(all a) avg(all a) std(all a) variance(all a) bit_or(all a) bit_and(all a)min(all a) max(all a) min(all c) max(all c)
6 3 2.0000 0.816496580927726 0.6666666666666666 3 0 1 3 a c
```
3. What did you see instead?
```
ERROR 1105 (HY000) at line 6: line 0 column 37 near ""a),bit_and(a),min(a),max(a),min(c),max(c) from t1"" (total length 86)
```
4. What version of TiDB are you using (`tidb-server -V`)?
",True,"No support for std(all a), variance(all a), bit_or(all a), bit_and(all a) - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
create table t1 (grp int, a bigint unsigned, c char(10) not null);
insert into t1 values (1,1,""a"");
insert into t1 values (2,2,""b"");
insert into t1 values (2,3,""c"");
select sum(all a),count(all a),avg(all a),std(all a),variance(all a),bit_or(all a),bit_and(all a),min(all a),max(all a),min(all c),max(all c) from t1;
```
2. What did you expect to see?
```
sum(all a) count(all a) avg(all a) std(all a) variance(all a) bit_or(all a) bit_and(all a)min(all a) max(all a) min(all c) max(all c)
6 3 2.0000 0.816496580927726 0.6666666666666666 3 0 1 3 a c
```
3. What did you see instead?
```
ERROR 1105 (HY000) at line 6: line 0 column 37 near ""a),bit_and(a),min(a),max(a),min(c),max(c) from t1"" (total length 86)
```
4. What version of TiDB are you using (`tidb-server -V`)?
",1,no support for std all a variance all a bit or all a bit and all a please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error sql create table grp int a bigint unsigned c char not null insert into values a insert into values b insert into values c select sum all a count all a avg all a std all a variance all a bit or all a bit and all a min all a max all a min all c max all c from what did you expect to see sum all a count all a avg all a std all a variance all a bit or all a bit and all a min all a max all a min all c max all c a c what did you see instead error at line line column near a bit and a min a max a min c max c from total length what version of tidb are you using tidb server v ,1
5999,8439692140.0,IssuesEvent,2018-10-18 03:15:51,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,The behaviour `show processlist` is different from MySQL,help wanted type/compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
Create a session to TiDB and do nothing. Then create a new session to TiDB and run `show processlist;`
2. What did you expect to see?
mysql> show processlist;
+----+------+-----------+------+---------+------+----------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+----+------+-----------+------+---------+------+----------+------------------+
| 4 | root | localhost | NULL | Sleep | 16 | | NULL |
| 5 | root | localhost | NULL | Query | 0 | starting | show processlist |
+----+------+-----------+------+---------+------+----------+------------------+
2 rows in set (0.00 sec)
3. What did you see instead?
The idled session's Time shows 0.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
Any version has this issue. It is caused [here]( https://github.com/pingcap/tidb/blob/master/executor/show.go#L207).
",True,"The behaviour `show processlist` is different from MySQL - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
Create a session to TiDB and do nothing. Then create a new session to TiDB and run `show processlist;`
2. What did you expect to see?
mysql> show processlist;
+----+------+-----------+------+---------+------+----------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+----+------+-----------+------+---------+------+----------+------------------+
| 4 | root | localhost | NULL | Sleep | 16 | | NULL |
| 5 | root | localhost | NULL | Query | 0 | starting | show processlist |
+----+------+-----------+------+---------+------+----------+------------------+
2 rows in set (0.00 sec)
3. What did you see instead?
The idled session's Time shows 0.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
Any version has this issue. It is caused [here]( https://github.com/pingcap/tidb/blob/master/executor/show.go#L207).
",1,the behaviour show processlist is different from mysql please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error create a session to tidb and do nothing then create a new session to tidb and run show processlist what did you expect to see mysql show processlist id user host db command time state info root localhost null sleep null root localhost null query starting show processlist rows in set sec what did you see instead the idled session s time shows what version of tidb are you using tidb server v or run select tidb version on tidb any version has this issue it is caused ,1
3731,6589176144.0,IssuesEvent,2017-09-14 07:52:58,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,Rewrite expression syntax in parser.,compatibility enhancement,"Our current expression syntax has very different syntax structure than MySQL for historical reason, to improve compatibility, we need to rewrite the expression syntax structure.
",True,"Rewrite expression syntax in parser. - Our current expression syntax has very different syntax structure than MySQL for historical reason, to improve compatibility, we need to rewrite the expression syntax structure.
",1,rewrite expression syntax in parser our current expression syntax has very different syntax structure than mysql for historical reason to improve compatibility we need to rewrite the expression syntax structure ,1
14638,17863430438.0,IssuesEvent,2021-09-06 06:14:22,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,builtin functions compatibility problem with different version of mysql,type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
MySQL has changed its behavior at v8.0.24 for some builtin functions:
```
field
instr
locate
insert
```
which will cause a different result. We not following the version before 8.0.24.
MySQL commit https://github.com/mysql/mysql-server/commit/997c747b33628ee5b230294600393d074ec3219b
### 2. What did you expect to see? (Required)
### 3. What did you see instead (Required)
### 4. What is your TiDB version? (Required)
",True,"builtin functions compatibility problem with different version of mysql - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
MySQL has changed its behavior at v8.0.24 for some builtin functions:
```
field
instr
locate
insert
```
which will cause a different result. We not following the version before 8.0.24.
MySQL commit https://github.com/mysql/mysql-server/commit/997c747b33628ee5b230294600393d074ec3219b
### 2. What did you expect to see? (Required)
### 3. What did you see instead (Required)
### 4. What is your TiDB version? (Required)
",1,builtin functions compatibility problem with different version of mysql bug report please answer these questions before submitting your issue thanks minimal reproduce step required mysql has changed its behavior at for some builtin functions field instr locate insert which will cause a different result we not following the version before mysql commit what did you expect to see required what did you see instead required what is your tidb version required ,1
3412,6375579523.0,IssuesEvent,2017-08-02 03:42:08,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Built-in function get_format timestamp not supported,compatibility rc3.1,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
select get_format(TIMESTAMP, 'USA') as a;
```
2. What did you expect to see?
```
+-------------------+
| a |
+-------------------+
| %Y-%m-%d %H.%i.%s |
+-------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
ERROR 1105 (HY000): line 0 column 27 near "", 'USA') as a"" (total length 40)
4. What version of TiDB are you using (`tidb-server -V`)?
",True,"Built-in function get_format timestamp not supported - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
select get_format(TIMESTAMP, 'USA') as a;
```
2. What did you expect to see?
```
+-------------------+
| a |
+-------------------+
| %Y-%m-%d %H.%i.%s |
+-------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
ERROR 1105 (HY000): line 0 column 27 near "", 'USA') as a"" (total length 40)
4. What version of TiDB are you using (`tidb-server -V`)?
",1,built in function get format timestamp not supported please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error sql select get format timestamp usa as a what did you expect to see a y m d h i s row in set sec what did you see instead error line column near usa as a total length what version of tidb are you using tidb server v ,1
16433,22197872300.0,IssuesEvent,2022-06-07 08:35:49,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Derived table without alias is not resulting error in TiDB.,type/compatibility sig/execution sig/sql-infra,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```sql
drop table if exists t1,t2;
CREATE TABLE t1 ( a INT );
INSERT INTO t1 VALUES ( 1 );
CREATE TABLE t2 ( a INT );
INSERT INTO t2 VALUES ( 2 );
SELECT * FROM ((((SELECT 1 FROM t1)) UNION SELECT 2 FROM t1));
```
### 2. What did you expect to see? (Required)
```sql
mysql> SELECT * FROM ((((SELECT 1 FROM t1)) UNION SELECT 2 FROM t1));
ERROR 1248 (42000): Every derived table must have its own alias
```
### 3. What did you see instead (Required)
```sql
mysql> SELECT * FROM ((((SELECT 1 FROM t1)) UNION SELECT 2 FROM t1));
+------+
| 1 |
+------+
| 2 |
| 1 |
+------+
2 rows in set (0.00 sec)
```
### 4. What is your TiDB version? (Required)
```sql
mysql> select version();
+-----------------------------------------------+
| version() |
+-----------------------------------------------+
| 5.7.25-TiDB-v6.1.0-alpha-482-g81a852077-dirty |
+-----------------------------------------------+
```
",True,"Derived table without alias is not resulting error in TiDB. - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```sql
drop table if exists t1,t2;
CREATE TABLE t1 ( a INT );
INSERT INTO t1 VALUES ( 1 );
CREATE TABLE t2 ( a INT );
INSERT INTO t2 VALUES ( 2 );
SELECT * FROM ((((SELECT 1 FROM t1)) UNION SELECT 2 FROM t1));
```
### 2. What did you expect to see? (Required)
```sql
mysql> SELECT * FROM ((((SELECT 1 FROM t1)) UNION SELECT 2 FROM t1));
ERROR 1248 (42000): Every derived table must have its own alias
```
### 3. What did you see instead (Required)
```sql
mysql> SELECT * FROM ((((SELECT 1 FROM t1)) UNION SELECT 2 FROM t1));
+------+
| 1 |
+------+
| 2 |
| 1 |
+------+
2 rows in set (0.00 sec)
```
### 4. What is your TiDB version? (Required)
```sql
mysql> select version();
+-----------------------------------------------+
| version() |
+-----------------------------------------------+
| 5.7.25-TiDB-v6.1.0-alpha-482-g81a852077-dirty |
+-----------------------------------------------+
```
",1,derived table without alias is not resulting error in tidb bug report please answer these questions before submitting your issue thanks minimal reproduce step required sql drop table if exists create table a int insert into values create table a int insert into values select from select from union select from what did you expect to see required sql mysql select from select from union select from error every derived table must have its own alias what did you see instead required sql mysql select from select from union select from rows in set sec what is your tidb version required sql mysql select version version tidb alpha dirty ,1
21025,32021469918.0,IssuesEvent,2023-09-22 05:10:47,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Incorrect query result,type/bug sig/execution severity/major affects-5.3 compatibility-mysql8 affects-5.4 affects-6.1 affects-6.5 affects-7.1,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```SQL
CREATE TABLE t1 (c1 INT);
INSERT INTO t1 VALUES (1);
SELECT c1 FROM t1 WHERE c1 REGEXP(IFNULL(c1, 0.0)); -- actual: {1}, expected: {}
```
### 2. What did you expect to see? (Required)
SELECT returns nothing.
### 3. What did you see instead (Required)
SELECT returns 1.
### 4. What is your TiDB version? (Required)
Release Version: v7.0.0
Edition: Community
Git Commit Hash: 7376954cd868dbc44fc3015c9ef89c53749339a7
Git Branch: heads/refs/tags/v7.0.0
UTC Build Time: 2023-03-29 13:32:13
GoVersion: go1.20.2
Race Enabled: false
TiKV Min Version: 6.2.0-alpha
Check Table Before Drop: false
Store: tikv
",True,"Incorrect query result - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```SQL
CREATE TABLE t1 (c1 INT);
INSERT INTO t1 VALUES (1);
SELECT c1 FROM t1 WHERE c1 REGEXP(IFNULL(c1, 0.0)); -- actual: {1}, expected: {}
```
### 2. What did you expect to see? (Required)
SELECT returns nothing.
### 3. What did you see instead (Required)
SELECT returns 1.
### 4. What is your TiDB version? (Required)
Release Version: v7.0.0
Edition: Community
Git Commit Hash: 7376954cd868dbc44fc3015c9ef89c53749339a7
Git Branch: heads/refs/tags/v7.0.0
UTC Build Time: 2023-03-29 13:32:13
GoVersion: go1.20.2
Race Enabled: false
TiKV Min Version: 6.2.0-alpha
Check Table Before Drop: false
Store: tikv
",1,incorrect query result bug report please answer these questions before submitting your issue thanks minimal reproduce step required sql create table int insert into values select from where regexp ifnull actual expected what did you expect to see required select returns nothing what did you see instead required select returns what is your tidb version required release version edition community git commit hash git branch heads refs tags utc build time goversion race enabled false tikv min version alpha check table before drop false store tikv ,1
4772,7382071589.0,IssuesEvent,2018-03-15 02:30:49,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,Fill the TABLE_ROWS field of information_schema.TABLES with the information from statistics,compatibility help wanted,We have updated row_count in the statistics. So we could use it to fill the result of INFORMATION_SCHEMA.TABLES.,True,Fill the TABLE_ROWS field of information_schema.TABLES with the information from statistics - We have updated row_count in the statistics. So we could use it to fill the result of INFORMATION_SCHEMA.TABLES.,1,fill the table rows field of information schema tables with the information from statistics we have updated row count in the statistics so we could use it to fill the result of information schema tables ,1
7854,10062990055.0,IssuesEvent,2019-07-23 03:40:19,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Function `period_add ` is not compatible with MySQL 8.0,type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
The `period_add` behavior is not compatible with MySQL 8.0
2. What did you expect to see?
MySQL 8.0:
```
mysql> select period_add(128081,887);
ERROR 1210 (HY000): Incorrect arguments to period_add
mysql> select period_add(128011,887);
+------------------------+
| period_add(128011,887) |
+------------------------+
| 135410 |
+------------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
```
mysql> select period_add(128081,887);
+------------------------+
| period_add(128081,887) |
+------------------------+
| 136008 |
+------------------------+
1 row in set (0.00 sec)
mysql> select period_add(128011,887);
+------------------------+
| period_add(128011,887) |
+------------------------+
| 135410 |
+------------------------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
mysql> select tidb_version();
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v3.0.0-beta.1-187-g5876abd70
Git Commit Hash: 5876abd70ccc054704ab0e8cbf02ed129c6efc76
Git Branch: refine-point-get-failpoint
UTC Build Time: 2019-04-30 03:35:49
GoVersion: go version go1.12 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.01 sec)
```
",True,"Function `period_add ` is not compatible with MySQL 8.0 - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
The `period_add` behavior is not compatible with MySQL 8.0
2. What did you expect to see?
MySQL 8.0:
```
mysql> select period_add(128081,887);
ERROR 1210 (HY000): Incorrect arguments to period_add
mysql> select period_add(128011,887);
+------------------------+
| period_add(128011,887) |
+------------------------+
| 135410 |
+------------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
```
mysql> select period_add(128081,887);
+------------------------+
| period_add(128081,887) |
+------------------------+
| 136008 |
+------------------------+
1 row in set (0.00 sec)
mysql> select period_add(128011,887);
+------------------------+
| period_add(128011,887) |
+------------------------+
| 135410 |
+------------------------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
mysql> select tidb_version();
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v3.0.0-beta.1-187-g5876abd70
Git Commit Hash: 5876abd70ccc054704ab0e8cbf02ed129c6efc76
Git Branch: refine-point-get-failpoint
UTC Build Time: 2019-04-30 03:35:49
GoVersion: go version go1.12 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.01 sec)
```
",1,function period add is not compatible with mysql bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error the period add behavior is not compatible with mysql what did you expect to see mysql mysql select period add error incorrect arguments to period add mysql select period add period add row in set sec what did you see instead mysql select period add period add row in set sec mysql select period add period add row in set sec what version of tidb are you using tidb server v or run select tidb version on tidb mysql select tidb version tidb version release version beta git commit hash git branch refine point get failpoint utc build time goversion go version darwin race enabled false tikv min version alpha check table before drop false row in set sec ,1
12228,14442108234.0,IssuesEvent,2020-12-07 17:41:07,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,parser: STRAIGHT_JOIN and SQL_SMALL_RESULT cannot be used at the same time,component/parser severity/moderate type/bug type/compatibility type/duplicate,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```
create table t;
insert into t values(1);
```
2. What did you expect to see?
Results from Mysql:
```
mysql> select STRAIGHT_JOIN SQL_SMALL_RESULT count(*) from t;
+----------+
| count(*) |
+----------+
| 1 |
+----------+
1 row in set (0.00 sec)
```
3. What did you see instead?
Results: from TiDB:
```
select STRAIGHT_JOIN SQL_SMALL_RESULT count(*) from t;
ERROR 1064 (42000): 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 37 near ""SQL_SMALL_RESULT count(*) from t""
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
[tidb@VM2 bin]$ ./tidb-server -V
2019-11-26 18:27:18.059136 I | maxprocs: Leaving GOMAXPROCS=8: CPU quota undefined
Release Version:
Git Commit Hash:
Git Branch:
UTC Build Time: 2019-11-22 02:54:53
GoVersion: go version go1.13.3 linux/amd64
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
",True,"parser: STRAIGHT_JOIN and SQL_SMALL_RESULT cannot be used at the same time - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```
create table t;
insert into t values(1);
```
2. What did you expect to see?
Results from Mysql:
```
mysql> select STRAIGHT_JOIN SQL_SMALL_RESULT count(*) from t;
+----------+
| count(*) |
+----------+
| 1 |
+----------+
1 row in set (0.00 sec)
```
3. What did you see instead?
Results: from TiDB:
```
select STRAIGHT_JOIN SQL_SMALL_RESULT count(*) from t;
ERROR 1064 (42000): 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 37 near ""SQL_SMALL_RESULT count(*) from t""
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
[tidb@VM2 bin]$ ./tidb-server -V
2019-11-26 18:27:18.059136 I | maxprocs: Leaving GOMAXPROCS=8: CPU quota undefined
Release Version:
Git Commit Hash:
Git Branch:
UTC Build Time: 2019-11-22 02:54:53
GoVersion: go version go1.13.3 linux/amd64
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
",1,parser straight join and sql small result cannot be used at the same time bug report please answer these questions before submitting your issue thanks what did you do create table t insert into t values what did you expect to see results from mysql mysql select straight join sql small result count from t count row in set sec what did you see instead results from tidb select straight join sql small result count from t error you have an error in your sql syntax check the manual that corresponds to your tidb version for the right syntax to use line column near sql small result count from t what version of tidb are you using tidb server v or run select tidb version on tidb tidb server v i maxprocs leaving gomaxprocs cpu quota undefined release version git commit hash git branch utc build time goversion go version linux race enabled false tikv min version check table before drop false ,1
18987,26403693018.0,IssuesEvent,2023-01-13 05:14:42,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Unexpected Error by CAST and CHAR functions,sig/execution severity/moderate compatibility-mysql8 fuzz/sqlancer,"## Bug Report
### 1. Minimal reproduce step (Required)
```sql
SELECT CAST(CHAR(21474647) AS CHAR); --Cannot convert string 'G\xADW' from binary to utf8
```
### 2. What did you expect to see? (Required)
No error
As a reference, there is no error for MySQL: https://www.db-fiddle.com/f/gtq3wBBEJezuCxHy1cgWtL/0
### 3. What did you see instead (Required)
Cannot convert string 'G\xADW' from binary to utf8
### 4. What is your TiDB version? (Required)
| Release Version: v6.2.0-alpha-159-ge0527ba27
Edition: Community
Git Commit Hash: e0527ba27c72b0a533b126fedfa025d47a209ca9
Git Branch: master
UTC Build Time: 2022-06-21 11:55:54
GoVersion: go1.18.3
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
Store: unistore |
",True,"Unexpected Error by CAST and CHAR functions - ## Bug Report
### 1. Minimal reproduce step (Required)
```sql
SELECT CAST(CHAR(21474647) AS CHAR); --Cannot convert string 'G\xADW' from binary to utf8
```
### 2. What did you expect to see? (Required)
No error
As a reference, there is no error for MySQL: https://www.db-fiddle.com/f/gtq3wBBEJezuCxHy1cgWtL/0
### 3. What did you see instead (Required)
Cannot convert string 'G\xADW' from binary to utf8
### 4. What is your TiDB version? (Required)
| Release Version: v6.2.0-alpha-159-ge0527ba27
Edition: Community
Git Commit Hash: e0527ba27c72b0a533b126fedfa025d47a209ca9
Git Branch: master
UTC Build Time: 2022-06-21 11:55:54
GoVersion: go1.18.3
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
Store: unistore |
",1,unexpected error by cast and char functions bug report minimal reproduce step required sql select cast char as char cannot convert string g xadw from binary to what did you expect to see required no error as a reference there is no error for mysql what did you see instead required cannot convert string g xadw from binary to what is your tidb version required release version alpha edition community git commit hash git branch master utc build time goversion race enabled false tikv min version check table before drop false store unistore ,1
13869,16593796542.0,IssuesEvent,2021-06-01 10:59:39,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Support column type conversion between non-varchar to varchar,compatibility-breaker sig/sql-infra type/feature-request,"## Development Task
We forbid changing column type conversion between non-varchar to varchar in master/v5.0.x(PR: #23688). Before #23688, this feature(conversion between char to varchar) was originally supported by modifying only the column structure without modifying the data.
However, it was later found that some scenarios(these cases are executed on the branch which before forbidding this feature) could not be handled in this way, such as:
```
tidb> create table t(a int, b varchar(10), primary key(a, b));
Query OK, 0 rows affected (0.01 sec)
tidb> insert into t values (1, ""aaa "");
Query OK, 1 row affected (0.00 sec)
tidb> alter table t change column b b char(10);
Query OK, 0 rows affected (0.01 sec)
tidb> Create table t1 like t;
Query OK, 0 rows affected (0.00 sec)
tidb> insert into t1 values (1, ""aaa "");
Query OK, 1 row affected (0.01 sec)
tidb> select * from t;
+---+--------+
| a | b |
+---+--------+
| 1 | aaa |
+---+--------+
1 row in set (0.00 sec)
tidb> select * from t1;
+---+-----+
| a | b |
+---+-----+
| 1 | aaa |
+---+-----+
1 row in set (0.00 sec)
tidb> admin check table t;
Query OK, 0 rows affected (0.01 sec)
```
Currently, we are working to support changing column types (not only changing column properties but also changing how column data is handled). This feature can also be supported by the way to modify the data which need to set`SET GLOBAL TIDB_ENABLE_CHANGE_COLUMN_TYPE = 1`.
## Materials
[old way to column type change](https://github.com/pingcap/tidb/blob/master/docs/design/2018-10-08-online-DDL.md#modify-column-operation)
[new way to to column type change proposal](https://github.com/pingcap/tidb/blob/master/docs/design/2020-07-07-change-column-types.md)
Related to issue: #23624, #23852.",True,"Support column type conversion between non-varchar to varchar - ## Development Task
We forbid changing column type conversion between non-varchar to varchar in master/v5.0.x(PR: #23688). Before #23688, this feature(conversion between char to varchar) was originally supported by modifying only the column structure without modifying the data.
However, it was later found that some scenarios(these cases are executed on the branch which before forbidding this feature) could not be handled in this way, such as:
```
tidb> create table t(a int, b varchar(10), primary key(a, b));
Query OK, 0 rows affected (0.01 sec)
tidb> insert into t values (1, ""aaa "");
Query OK, 1 row affected (0.00 sec)
tidb> alter table t change column b b char(10);
Query OK, 0 rows affected (0.01 sec)
tidb> Create table t1 like t;
Query OK, 0 rows affected (0.00 sec)
tidb> insert into t1 values (1, ""aaa "");
Query OK, 1 row affected (0.01 sec)
tidb> select * from t;
+---+--------+
| a | b |
+---+--------+
| 1 | aaa |
+---+--------+
1 row in set (0.00 sec)
tidb> select * from t1;
+---+-----+
| a | b |
+---+-----+
| 1 | aaa |
+---+-----+
1 row in set (0.00 sec)
tidb> admin check table t;
Query OK, 0 rows affected (0.01 sec)
```
Currently, we are working to support changing column types (not only changing column properties but also changing how column data is handled). This feature can also be supported by the way to modify the data which need to set`SET GLOBAL TIDB_ENABLE_CHANGE_COLUMN_TYPE = 1`.
## Materials
[old way to column type change](https://github.com/pingcap/tidb/blob/master/docs/design/2018-10-08-online-DDL.md#modify-column-operation)
[new way to to column type change proposal](https://github.com/pingcap/tidb/blob/master/docs/design/2020-07-07-change-column-types.md)
Related to issue: #23624, #23852.",1,support column type conversion between non varchar to varchar development task we forbid changing column type conversion between non varchar to varchar in master x pr before this feature conversion between char to varchar was originally supported by modifying only the column structure without modifying the data however it was later found that some scenarios these cases are executed on the branch which before forbidding this feature could not be handled in this way such as tidb create table t a int b varchar primary key a b query ok rows affected sec tidb insert into t values aaa query ok row affected sec tidb alter table t change column b b char query ok rows affected sec tidb create table like t query ok rows affected sec tidb insert into values aaa query ok row affected sec tidb select from t a b aaa row in set sec tidb select from a b aaa row in set sec tidb admin check table t query ok rows affected sec currently we are working to support changing column types not only changing column properties but also changing how column data is handled this feature can also be supported by the way to modify the data which need to set set global tidb enable change column type materials related to issue ,1
6691,8968057582.0,IssuesEvent,2019-01-29 06:35:07,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,"""show create table"" shows that the generated column is inconsistent with MySQL",help wanted type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
create table t(c int, b int as (c + 1));
show create table t;
```
2. What did you expect to see?
mysql> create table t(c int, b int as (c + 1));
Query OK, 0 rows affected (0.03 sec)
mysql> show create table t;
+-------+-------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+-------------------------------------------------------------------------------------------------------------------------------------------+
| t | CREATE TABLE `t` (
`c` int(11) DEFAULT NULL,
`b` int(11) GENERATED ALWAYS AS ((`c` + 1)) VIRTUAL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 |
+-------+-------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
3. What did you see instead?
tidb> create table t(c int, b int as (c + 1));
Query OK, 0 rows affected (0.01 sec)
tidb> show create table t;
+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| t | CREATE TABLE `t` (
`c` int(11) DEFAULT NULL,
`b` int(11) GENERATED ALWAYS AS (`c` + 1) VIRTUAL **DEFAULT NULL**
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin |
+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
Release Version: v3.0.0-beta-18-g7648317da
Git Commit Hash: 7648317dad4fe4b076158339fd205dfa76b0d5ea
Git Branch: master
UTC Build Time: 2019-01-28 07:42:09
",True,"""show create table"" shows that the generated column is inconsistent with MySQL - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
create table t(c int, b int as (c + 1));
show create table t;
```
2. What did you expect to see?
mysql> create table t(c int, b int as (c + 1));
Query OK, 0 rows affected (0.03 sec)
mysql> show create table t;
+-------+-------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+-------------------------------------------------------------------------------------------------------------------------------------------+
| t | CREATE TABLE `t` (
`c` int(11) DEFAULT NULL,
`b` int(11) GENERATED ALWAYS AS ((`c` + 1)) VIRTUAL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 |
+-------+-------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
3. What did you see instead?
tidb> create table t(c int, b int as (c + 1));
Query OK, 0 rows affected (0.01 sec)
tidb> show create table t;
+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| t | CREATE TABLE `t` (
`c` int(11) DEFAULT NULL,
`b` int(11) GENERATED ALWAYS AS (`c` + 1) VIRTUAL **DEFAULT NULL**
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin |
+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
Release Version: v3.0.0-beta-18-g7648317da
Git Commit Hash: 7648317dad4fe4b076158339fd205dfa76b0d5ea
Git Branch: master
UTC Build Time: 2019-01-28 07:42:09
",1, show create table shows that the generated column is inconsistent with mysql bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error create table t c int b int as c show create table t what did you expect to see mysql create table t c int b int as c query ok rows affected sec mysql show create table t table create table t create table t c int default null b int generated always as c virtual engine innodb default charset row in set sec what did you see instead tidb create table t c int b int as c query ok rows affected sec tidb show create table t table create table t create table t c int default null b int generated always as c virtual default null engine innodb default charset collate bin row in set sec what version of tidb are you using tidb server v or run select tidb version on tidb release version beta git commit hash git branch master utc build time ,1
3504,6487208940.0,IssuesEvent,2017-08-20 04:45:34,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,some querys that has `DISTINCT` and `ORDER BY` should be invalid,compatibility enhancement todo,"## 1. What did you do?
```sql
drop table if exists t;
create table t(a bigint, b bigint, c bigint);
insert into t values(1, 2, 1), (1, 2, 2), (1, 3, 1), (1, 3, 2);
select distinct a, b from t order by c;
```
To order the result, duplicates must be eliminated first. But to do so, which row should we keep ? This choice influences the retained value of `c`, which in turn influences ordering and makes it arbitrary as well.
In MySQL, a query that has `DISTINCT` and `ORDER BY` is rejected as invalid if any `ORDER BY` expression does not satisfy at least one of these conditions:
- The expression is equal to one in the select list
- All columns referenced by the expression and belonging to the query's selected tables are elements of the select list
## 2. What did you expect to see?
```sql
MySQL > select distinct a, b from t order by c;
ERROR 3065 (HY000): Expression #1 of ORDER BY clause is not in SELECT list, references column 'test.t.c' which is not in SELECT list; this is incompatible with DISTINCT
```
## 3. What did you see instead?
```sql
TiDB > select distinct a, b from t order by c;
+------+------+
| a | b |
+------+------+
| 1 | 2 |
| 1 | 3 |
+------+------+
2 rows in set (0.00 sec)
```
```sql
TiDB > desc select distinct a, b from t order by c;
+---------------+--------------+---------------+------+--------------------------------------------------------------------------------------------------------------+-------+
| id | parents | children | task | operator info | count |
+---------------+--------------+---------------+------+--------------------------------------------------------------------------------------------------------------+-------+
| TableScan_7 | HashAgg_6 | | cop | table:t, range:(-inf,+inf), keep order:false | 4 |
| HashAgg_6 | | TableScan_7 | cop | type:complete, group by:test.t.a, test.t.b, funcs:firstrow(test.t.a), firstrow(test.t.b), firstrow(test.t.c) | 1 |
| TableReader_9 | HashAgg_8 | | root | data:HashAgg_6 | 1 |
| HashAgg_8 | Sort_4 | TableReader_9 | root | type:final, group by:, , funcs:firstrow(col_0), firstrow(col_1), firstrow(col_2) | 1 |
| Sort_4 | Projection_5 | HashAgg_8 | root | test.t.c:asc | 1 |
| Projection_5 | | Sort_4 | root | test.t.a, test.t.b | 1 |
+---------------+--------------+---------------+------+--------------------------------------------------------------------------------------------------------------+-------+
6 rows in set (0.00 sec)
```
## 4. What version of TiDB are you using (`tidb-server -V`)?
",True,"some querys that has `DISTINCT` and `ORDER BY` should be invalid - ## 1. What did you do?
```sql
drop table if exists t;
create table t(a bigint, b bigint, c bigint);
insert into t values(1, 2, 1), (1, 2, 2), (1, 3, 1), (1, 3, 2);
select distinct a, b from t order by c;
```
To order the result, duplicates must be eliminated first. But to do so, which row should we keep ? This choice influences the retained value of `c`, which in turn influences ordering and makes it arbitrary as well.
In MySQL, a query that has `DISTINCT` and `ORDER BY` is rejected as invalid if any `ORDER BY` expression does not satisfy at least one of these conditions:
- The expression is equal to one in the select list
- All columns referenced by the expression and belonging to the query's selected tables are elements of the select list
## 2. What did you expect to see?
```sql
MySQL > select distinct a, b from t order by c;
ERROR 3065 (HY000): Expression #1 of ORDER BY clause is not in SELECT list, references column 'test.t.c' which is not in SELECT list; this is incompatible with DISTINCT
```
## 3. What did you see instead?
```sql
TiDB > select distinct a, b from t order by c;
+------+------+
| a | b |
+------+------+
| 1 | 2 |
| 1 | 3 |
+------+------+
2 rows in set (0.00 sec)
```
```sql
TiDB > desc select distinct a, b from t order by c;
+---------------+--------------+---------------+------+--------------------------------------------------------------------------------------------------------------+-------+
| id | parents | children | task | operator info | count |
+---------------+--------------+---------------+------+--------------------------------------------------------------------------------------------------------------+-------+
| TableScan_7 | HashAgg_6 | | cop | table:t, range:(-inf,+inf), keep order:false | 4 |
| HashAgg_6 | | TableScan_7 | cop | type:complete, group by:test.t.a, test.t.b, funcs:firstrow(test.t.a), firstrow(test.t.b), firstrow(test.t.c) | 1 |
| TableReader_9 | HashAgg_8 | | root | data:HashAgg_6 | 1 |
| HashAgg_8 | Sort_4 | TableReader_9 | root | type:final, group by:, , funcs:firstrow(col_0), firstrow(col_1), firstrow(col_2) | 1 |
| Sort_4 | Projection_5 | HashAgg_8 | root | test.t.c:asc | 1 |
| Projection_5 | | Sort_4 | root | test.t.a, test.t.b | 1 |
+---------------+--------------+---------------+------+--------------------------------------------------------------------------------------------------------------+-------+
6 rows in set (0.00 sec)
```
## 4. What version of TiDB are you using (`tidb-server -V`)?
",1,some querys that has distinct and order by should be invalid what did you do sql drop table if exists t create table t a bigint b bigint c bigint insert into t values select distinct a b from t order by c to order the result duplicates must be eliminated first but to do so which row should we keep this choice influences the retained value of c which in turn influences ordering and makes it arbitrary as well in mysql a query that has distinct and order by is rejected as invalid if any order by expression does not satisfy at least one of these conditions the expression is equal to one in the select list all columns referenced by the expression and belonging to the query s selected tables are elements of the select list what did you expect to see sql mysql select distinct a b from t order by c error expression of order by clause is not in select list references column test t c which is not in select list this is incompatible with distinct what did you see instead sql tidb select distinct a b from t order by c a b rows in set sec sql tidb desc select distinct a b from t order by c id parents children task operator info count tablescan hashagg cop table t range inf inf keep order false hashagg tablescan cop type complete group by test t a test t b funcs firstrow test t a firstrow test t b firstrow test t c tablereader hashagg root data hashagg hashagg sort tablereader root type final group by funcs firstrow col firstrow col firstrow col sort projection hashagg root test t c asc projection sort root test t a test t b rows in set sec what version of tidb are you using tidb server v ,1
16626,22764866505.0,IssuesEvent,2022-07-08 02:33:04,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,dbForge Can't connect to TiDB,type/bug severity/minor compatibility-mysql8,"![image](https://user-images.githubusercontent.com/41108848/177004218-3f4419f9-9ab1-4c7c-be60-14ecfa1d025a.png)
error : Table 'performance_schema.session_variables' doesn't exist",True,"dbForge Can't connect to TiDB - ![image](https://user-images.githubusercontent.com/41108848/177004218-3f4419f9-9ab1-4c7c-be60-14ecfa1d025a.png)
error : Table 'performance_schema.session_variables' doesn't exist",1,dbforge can t connect to tidb error table performance schema session variables doesn t exist,1
3846,6700420287.0,IssuesEvent,2017-10-11 04:38:55,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed, datetime zero in date when select or update with record with bad datetime field,compatibility,"
This can be inserted
```sql
TiDB-Server [test]> create table t1 (id int, t datetime not null, primary key(id));
Query OK, 0 rows affected (1.01 sec)
TiDB-Server [test]> insert into t1 values(3, '2017-00-00 00:00:00');
Query OK, 1 row affected (0.00 sec)
```
But query will fail:
```sql
TiDB-Server [test]> select * from t1;
ERROR 1105 (HY000): datetime zero in date
```
And the erroneous record can not be updated either
```sql
TiDB-Server [test]> update t1 set t = '2017-01-01 00:00:00' where id=3;
ERROR 1105 (HY000): datetime zero in date
```
IMHO, tidb should validate before insertion or if record with bad datetime field CAN be inserted tidb should not report error when being selected or updated later.",True," datetime zero in date when select or update with record with bad datetime field -
This can be inserted
```sql
TiDB-Server [test]> create table t1 (id int, t datetime not null, primary key(id));
Query OK, 0 rows affected (1.01 sec)
TiDB-Server [test]> insert into t1 values(3, '2017-00-00 00:00:00');
Query OK, 1 row affected (0.00 sec)
```
But query will fail:
```sql
TiDB-Server [test]> select * from t1;
ERROR 1105 (HY000): datetime zero in date
```
And the erroneous record can not be updated either
```sql
TiDB-Server [test]> update t1 set t = '2017-01-01 00:00:00' where id=3;
ERROR 1105 (HY000): datetime zero in date
```
IMHO, tidb should validate before insertion or if record with bad datetime field CAN be inserted tidb should not report error when being selected or updated later.",1, datetime zero in date when select or update with record with bad datetime field this can be inserted sql tidb server create table id int t datetime not null primary key id query ok rows affected sec tidb server insert into values query ok row affected sec but query will fail sql tidb server select from error datetime zero in date and the erroneous record can not be updated either sql tidb server update set t where id error datetime zero in date imho tidb should validate before insertion or if record with bad datetime field can be inserted tidb should not report error when being selected or updated later ,1
3578,6495233232.0,IssuesEvent,2017-08-22 03:31:25,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Behavior of str_to_date() is different from mysql,compatibility help wanted,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
`select str_to_date('1,9,2017','%d,%m,%Y');`
2. What did you expect to see?
MySQL
```
mysql> select str_to_date('01,09,2017','%d,%m,%Y');
+--------------------------------------+
| str_to_date('01,09,2017','%d,%m,%Y') |
+--------------------------------------+
| 2017-09-01 |
+--------------------------------------+
1 row in set (0.02 sec)
mysql> select str_to_date('1,9,2017','%d,%m,%Y');
+------------------------------------+
| str_to_date('1,9,2017','%d,%m,%Y') |
+------------------------------------+
| 2017-09-01 |
+------------------------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
TiDB
```
MySQL [(none)]> select str_to_date('01,09,2017','%d,%m,%Y');
+--------------------------------------+
| str_to_date('01,09,2017','%d,%m,%Y') |
+--------------------------------------+
| 2017-09-01 00:00:00 |
+--------------------------------------+
1 row in set (0.00 sec)
MySQL [(none)]> select str_to_date('1,9,2017','%d,%m,%Y');
+------------------------------------+
| str_to_date('1,9,2017','%d,%m,%Y') |
+------------------------------------+
| NULL |
+------------------------------------+
1 row in set (0.00 sec)
MySQL [(none)]> select str_to_date('1,09,2017','%d,%m,%Y');
+-------------------------------------+
| str_to_date('1,09,2017','%d,%m,%Y') |
+-------------------------------------+
| NULL |
+-------------------------------------+
1 row in set (0.00 sec)
MySQL [(none)]> select str_to_date('01,9,2017','%d,%m,%Y');
+-------------------------------------+
| str_to_date('01,9,2017','%d,%m,%Y') |
+-------------------------------------+
| NULL |
+-------------------------------------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V`)?
Git Commit Hash: 365e4ab
Git Commit Branch: master
UTC Build Time: 2017-08-16 01:24:27
",True,"Behavior of str_to_date() is different from mysql - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
`select str_to_date('1,9,2017','%d,%m,%Y');`
2. What did you expect to see?
MySQL
```
mysql> select str_to_date('01,09,2017','%d,%m,%Y');
+--------------------------------------+
| str_to_date('01,09,2017','%d,%m,%Y') |
+--------------------------------------+
| 2017-09-01 |
+--------------------------------------+
1 row in set (0.02 sec)
mysql> select str_to_date('1,9,2017','%d,%m,%Y');
+------------------------------------+
| str_to_date('1,9,2017','%d,%m,%Y') |
+------------------------------------+
| 2017-09-01 |
+------------------------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
TiDB
```
MySQL [(none)]> select str_to_date('01,09,2017','%d,%m,%Y');
+--------------------------------------+
| str_to_date('01,09,2017','%d,%m,%Y') |
+--------------------------------------+
| 2017-09-01 00:00:00 |
+--------------------------------------+
1 row in set (0.00 sec)
MySQL [(none)]> select str_to_date('1,9,2017','%d,%m,%Y');
+------------------------------------+
| str_to_date('1,9,2017','%d,%m,%Y') |
+------------------------------------+
| NULL |
+------------------------------------+
1 row in set (0.00 sec)
MySQL [(none)]> select str_to_date('1,09,2017','%d,%m,%Y');
+-------------------------------------+
| str_to_date('1,09,2017','%d,%m,%Y') |
+-------------------------------------+
| NULL |
+-------------------------------------+
1 row in set (0.00 sec)
MySQL [(none)]> select str_to_date('01,9,2017','%d,%m,%Y');
+-------------------------------------+
| str_to_date('01,9,2017','%d,%m,%Y') |
+-------------------------------------+
| NULL |
+-------------------------------------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V`)?
Git Commit Hash: 365e4ab
Git Commit Branch: master
UTC Build Time: 2017-08-16 01:24:27
",1,behavior of str to date is different from mysql please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error select str to date d m y what did you expect to see mysql mysql select str to date d m y str to date d m y row in set sec mysql select str to date d m y str to date d m y row in set sec what did you see instead tidb mysql select str to date d m y str to date d m y row in set sec mysql select str to date d m y str to date d m y null row in set sec mysql select str to date d m y str to date d m y null row in set sec mysql select str to date d m y str to date d m y null row in set sec what version of tidb are you using tidb server v git commit hash git commit branch master utc build time ,1
11074,13099086018.0,IssuesEvent,2020-08-03 20:50:06,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Invalid JSONs are allowed to insert,type/compatibility,"## Bug Report
MySQL:
```
mysql> create table tx (col json);
Query OK, 0 rows affected (0.06 sec)
mysql> insert into tx values ('""3""""');
ERROR 3140 (22032): Invalid JSON text: ""The document root must not be followed by other values."" at position 3 in value for column 'tx.col'.
```
TiDB:
```
mysql> create table tx (col json);
Query OK, 0 rows affected (0.13 sec)
mysql> insert into tx values ('""3""""');
Query OK, 1 row affected (0.03 sec)
mysql> select * from tx;
+------+
| col |
+------+
| ""3"" |
+------+
1 row in set (0.00 sec)
```",True,"Invalid JSONs are allowed to insert - ## Bug Report
MySQL:
```
mysql> create table tx (col json);
Query OK, 0 rows affected (0.06 sec)
mysql> insert into tx values ('""3""""');
ERROR 3140 (22032): Invalid JSON text: ""The document root must not be followed by other values."" at position 3 in value for column 'tx.col'.
```
TiDB:
```
mysql> create table tx (col json);
Query OK, 0 rows affected (0.13 sec)
mysql> insert into tx values ('""3""""');
Query OK, 1 row affected (0.03 sec)
mysql> select * from tx;
+------+
| col |
+------+
| ""3"" |
+------+
1 row in set (0.00 sec)
```",1,invalid jsons are allowed to insert bug report mysql mysql create table tx col json query ok rows affected sec mysql insert into tx values error invalid json text the document root must not be followed by other values at position in value for column tx col tidb mysql create table tx col json query ok rows affected sec mysql insert into tx values query ok row affected sec mysql select from tx col row in set sec ,1
11096,13124637047.0,IssuesEvent,2020-08-06 04:25:07,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,compatibility with schemaspy,type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
I created foreign keys that show up in the information schema and then ran schema spy
``` bash
#!/usr/bin/env bash
set -euo pipefail
mkdir -p doc/schema
sudo chown -R 1000:1000 doc/schema/
./scripts/docker -v ""$PWD/doc/schema:/output"" schemaspy/schemaspy -u root -db -t mysql -port 4000 -host -s
sudo chown -R $(whoami):$(whoami) doc/schema/
```
Foreign keys show up with this query:
```
SELECT
-> TABLE_NAME,COLUMN_NAME,CONSTRAINT_NAME, REFERENCED_TABLE_NAME,REFERENCED_COLUMN_NAME
-> FROM
-> INFORMATION_SCHEMA.KEY_COLUMN_USAGE
-> WHERE
-> REFERENCED_TABLE_SCHEMA = '' AND
-> REFERENCED_TABLE_NAME = 'clusters';
```
2. What did you expect to see?
Entity relations at relationships.html
3. What did you see instead?
All Relationships
×
Missed Relationships!
No relationships were detected in the schema.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
pingcap/tidb:v2.1.0-rc.4",True,"compatibility with schemaspy - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
I created foreign keys that show up in the information schema and then ran schema spy
``` bash
#!/usr/bin/env bash
set -euo pipefail
mkdir -p doc/schema
sudo chown -R 1000:1000 doc/schema/
./scripts/docker -v ""$PWD/doc/schema:/output"" schemaspy/schemaspy -u root -db -t mysql -port 4000 -host -s
sudo chown -R $(whoami):$(whoami) doc/schema/
```
Foreign keys show up with this query:
```
SELECT
-> TABLE_NAME,COLUMN_NAME,CONSTRAINT_NAME, REFERENCED_TABLE_NAME,REFERENCED_COLUMN_NAME
-> FROM
-> INFORMATION_SCHEMA.KEY_COLUMN_USAGE
-> WHERE
-> REFERENCED_TABLE_SCHEMA = '' AND
-> REFERENCED_TABLE_NAME = 'clusters';
```
2. What did you expect to see?
Entity relations at relationships.html
3. What did you see instead?
All Relationships
×
Missed Relationships!
No relationships were detected in the schema.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
pingcap/tidb:v2.1.0-rc.4",1,compatibility with schemaspy bug report please answer these questions before submitting your issue thanks what did you do i created foreign keys that show up in the information schema and then ran schema spy bash usr bin env bash set euo pipefail mkdir p doc schema sudo chown r doc schema scripts docker v pwd doc schema output schemaspy schemaspy u root db t mysql port host s sudo chown r whoami whoami doc schema foreign keys show up with this query select table name column name constraint name referenced table name referenced column name from information schema key column usage where referenced table schema and referenced table name clusters what did you expect to see entity relations at relationships html what did you see instead all relationships × missed relationships no relationships were detected in the schema what version of tidb are you using tidb server v or run select tidb version on tidb pingcap tidb rc ,1
6125,8553401526.0,IssuesEvent,2018-11-08 00:42:16,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,FORCE INDEX(PRIMARY) does not work,type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```
mysql> create table t (x int primary key);
mysql> select * from t force index(primary);
```
2. What did you expect to see?
```
Empty set (0.00 sec)
```
It is from Oracle MySQL 5.7.22.
3. What did you see instead?
```
ERROR 1105 (HY000): line 1 column 35 near "")"" (total length 36)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
tidb_version(): Release Version: v2.1.0-rc.4
Git Commit Hash: 500c9bb865b90a834bcd27b7b075c193556b9f37
Git Branch: release-2.1
UTC Build Time: 2018-10-24 05:28:25
GoVersion: go version go1.11 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
```",True,"FORCE INDEX(PRIMARY) does not work - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```
mysql> create table t (x int primary key);
mysql> select * from t force index(primary);
```
2. What did you expect to see?
```
Empty set (0.00 sec)
```
It is from Oracle MySQL 5.7.22.
3. What did you see instead?
```
ERROR 1105 (HY000): line 1 column 35 near "")"" (total length 36)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
tidb_version(): Release Version: v2.1.0-rc.4
Git Commit Hash: 500c9bb865b90a834bcd27b7b075c193556b9f37
Git Branch: release-2.1
UTC Build Time: 2018-10-24 05:28:25
GoVersion: go version go1.11 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
```",1,force index primary does not work bug report please answer these questions before submitting your issue thanks what did you do mysql create table t x int primary key mysql select from t force index primary what did you expect to see empty set sec it is from oracle mysql what did you see instead error line column near total length what version of tidb are you using tidb server v or run select tidb version on tidb tidb version release version rc git commit hash git branch release utc build time goversion go version linux race enabled false tikv min version alpha check table before drop false ,1
7434,9674066855.0,IssuesEvent,2019-05-22 09:03:30,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,`LOAD DATA LOCAL INFILE` with IGNORE will report an error,for new contributors help wanted type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
run `load data` with `ignore` will occur an error
`
mysql -h {host} -P {port} -u root --local-infile=1 -p{password} -D SCALIFIED -e LOAD DATA LOCAL INFILE 'SCALIFIED.T_STU' IGNORE INTO TABLE SCALIFIED.T_STU FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n';
`
the command run against mysql successfully.
2. What did you expect to see?
load data into tidb successfully.
3. What did you see instead?
error occurs.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
v2.1.4",True,"`LOAD DATA LOCAL INFILE` with IGNORE will report an error - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
run `load data` with `ignore` will occur an error
`
mysql -h {host} -P {port} -u root --local-infile=1 -p{password} -D SCALIFIED -e LOAD DATA LOCAL INFILE 'SCALIFIED.T_STU' IGNORE INTO TABLE SCALIFIED.T_STU FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n';
`
the command run against mysql successfully.
2. What did you expect to see?
load data into tidb successfully.
3. What did you see instead?
error occurs.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
v2.1.4",1, load data local infile with ignore will report an error bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error run load data with ignore will occur an error mysql h host p port u root local infile p password d scalified e load data local infile scalified t stu ignore into table scalified t stu fields terminated by t lines terminated by n the command run against mysql successfully what did you expect to see load data into tidb successfully what did you see instead error occurs what version of tidb are you using tidb server v or run select tidb version on tidb ,1
338494,30302050835.0,IssuesEvent,2023-07-10 06:51:45,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,"getCgroupCPU() v1 logic doesn't work with CPU controller that appears like 'cpuacct,cpu' in /proc/self/cgroup and /proc/self/mountinfo",type/bug component/test severity/major,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
With some Linux releases like RHEL 7.9, the cpu controller appears like 'cpuacct,cpu' rather than 'cpu,cpuacct'. Obviously, the logic doesn't work in such case. In cgroup_mock_test.go, try replacing 'cpu,cpuacct' with 'cpuacct,cpu' in the v1 cgroup files and 'rw,cpu,cpuacct' with 'rw,cpuacct,cpu' in the v1 mountinfo files, the test will fail.
### 2. What did you expect to see? (Required)
The API works in the case mentioned above.
### 3. What did you see instead (Required)
The API doesn't work.
### 4. What is your TiDB version? (Required)
v6.5.1
",1.0,"getCgroupCPU() v1 logic doesn't work with CPU controller that appears like 'cpuacct,cpu' in /proc/self/cgroup and /proc/self/mountinfo - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
With some Linux releases like RHEL 7.9, the cpu controller appears like 'cpuacct,cpu' rather than 'cpu,cpuacct'. Obviously, the logic doesn't work in such case. In cgroup_mock_test.go, try replacing 'cpu,cpuacct' with 'cpuacct,cpu' in the v1 cgroup files and 'rw,cpu,cpuacct' with 'rw,cpuacct,cpu' in the v1 mountinfo files, the test will fail.
### 2. What did you expect to see? (Required)
The API works in the case mentioned above.
### 3. What did you see instead (Required)
The API doesn't work.
### 4. What is your TiDB version? (Required)
v6.5.1
",0,getcgroupcpu logic doesn t work with cpu controller that appears like cpuacct cpu in proc self cgroup and proc self mountinfo bug report please answer these questions before submitting your issue thanks minimal reproduce step required with some linux releases like rhel the cpu controller appears like cpuacct cpu rather than cpu cpuacct obviously the logic doesn t work in such case in cgroup mock test go try replacing cpu cpuacct with cpuacct cpu in the cgroup files and rw cpu cpuacct with rw cpuacct cpu in the mountinfo files the test will fail what did you expect to see required the api works in the case mentioned above what did you see instead required the api doesn t work what is your tidb version required ,0
6267,8648564916.0,IssuesEvent,2018-11-26 16:53:53,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Support SQL like `select * from t where d < date '1998-01-01';`,help wanted type/compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
create table t (d date);
insert into t values (""1997-01-02"");
select * from t where d < date '1998-01-01';
2. What did you expect to see?
+------------+
| d |
+------------+
| 1997-01-02 |
+------------+
3. What did you see instead?
ERROR 1105 (HY000): line 0 column 17 near "" date '1998-01-01'"" (total length 35)
4. What version of TiDB are you using (`tidb-server -V`)?
mysql> select tidb_version();
+-----------------------------------------------------------------------------------------------+
| tidb_version() |
+-----------------------------------------------------------------------------------------------+
| Git Commit Hash: a178c024e333384ecc4bc6d4afd69767f10fe1ad
UTC Build Time: 2017-07-24 04:17:43 |
+-----------------------------------------------------------------------------------------------+
1 row in set (0.01 sec)
",True,"Support SQL like `select * from t where d < date '1998-01-01';` - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
create table t (d date);
insert into t values (""1997-01-02"");
select * from t where d < date '1998-01-01';
2. What did you expect to see?
+------------+
| d |
+------------+
| 1997-01-02 |
+------------+
3. What did you see instead?
ERROR 1105 (HY000): line 0 column 17 near "" date '1998-01-01'"" (total length 35)
4. What version of TiDB are you using (`tidb-server -V`)?
mysql> select tidb_version();
+-----------------------------------------------------------------------------------------------+
| tidb_version() |
+-----------------------------------------------------------------------------------------------+
| Git Commit Hash: a178c024e333384ecc4bc6d4afd69767f10fe1ad
UTC Build Time: 2017-07-24 04:17:43 |
+-----------------------------------------------------------------------------------------------+
1 row in set (0.01 sec)
",1,support sql like select from t where d date please answer these questions before submitting your issue thanks what did you do create table t d date insert into t values select from t where d date what did you expect to see d what did you see instead error line column near date total length what version of tidb are you using tidb server v mysql select tidb version tidb version git commit hash utc build time row in set sec ,1
6255,8641670569.0,IssuesEvent,2018-11-24 20:18:01,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Incorrect error code and message at implicit join,type/compatibility,"Table definition:
```sql
CREATE TABLE `t2` (
`pk` int key,
`hello` text
);
CREATE TABLE `t3` (
`pk` int key,
`hello` text
);
```
MySQL query:
```
mysql> select * from t3 where t2.hello = t3.hello;
ERROR 1054 (42S22): Unknown column 't2.hello' in 'where clause'
```
TiDB query:
```
mysql> select * from t3 where t2.hello = t3.hello;
ERROR 1105 (HY000): unknown column hello
```",True,"Incorrect error code and message at implicit join - Table definition:
```sql
CREATE TABLE `t2` (
`pk` int key,
`hello` text
);
CREATE TABLE `t3` (
`pk` int key,
`hello` text
);
```
MySQL query:
```
mysql> select * from t3 where t2.hello = t3.hello;
ERROR 1054 (42S22): Unknown column 't2.hello' in 'where clause'
```
TiDB query:
```
mysql> select * from t3 where t2.hello = t3.hello;
ERROR 1105 (HY000): unknown column hello
```",1,incorrect error code and message at implicit join table definition sql create table pk int key hello text create table pk int key hello text mysql query mysql select from where hello hello error unknown column hello in where clause tidb query mysql select from where hello hello error unknown column hello ,1
4994,7600556755.0,IssuesEvent,2018-04-28 03:29:55,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,"Support ""ALTER TABLE ti1 AUTO_INCREMENT 3""",DDL compatibility help wanted,"```
CREATE TABLE ti1(a INT NOT NULL, b INT, c INT) engine=InnoDB;
ALTER TABLE ti1 AUTO_INCREMENT 3;
```
report `line 1 column 32 near "";"" (total length 33)`",True,"Support ""ALTER TABLE ti1 AUTO_INCREMENT 3"" - ```
CREATE TABLE ti1(a INT NOT NULL, b INT, c INT) engine=InnoDB;
ALTER TABLE ti1 AUTO_INCREMENT 3;
```
report `line 1 column 32 near "";"" (total length 33)`",1,support alter table auto increment create table a int not null b int c int engine innodb alter table auto increment report line column near total length ,1
12362,14623397954.0,IssuesEvent,2020-12-23 03:14:05,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,extended latin character set not support,component/charset type/compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```
set names latin1;
drop table if exists t1;
create table t1(c varchar(1) not null, name varchar(64) not null) character set latin1;
insert into t1 values(0xC0, 'LATIN CAPITAL LETTER A WITH GRAVE');
```
2. What did you expect to see?
```
mysql> create table t1(c varchar(1) not null, name varchar(64) not null);
Query OK, 0 rows affected (0.01 sec)
mysql> insert into t1 values(0xC0, 'LATIN CAPITAL LETTER A WITH GRAVE');
Query OK, 1 row affected (0.01 sec)
```
3. What did you see instead?
```
mysql> create table t1(c varchar(1) not null, name varchar(64) not null);
Query OK, 0 rows affected (0.08 sec)
mysql> insert into t1 values(0xC0, 'LATIN CAPITAL LETTER A WITH GRAVE');
ERROR 1366 (HY000): Incorrect value
```
4. What version of TiDB are you using (`tidb-server -V`)?
",True,"extended latin character set not support - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```
set names latin1;
drop table if exists t1;
create table t1(c varchar(1) not null, name varchar(64) not null) character set latin1;
insert into t1 values(0xC0, 'LATIN CAPITAL LETTER A WITH GRAVE');
```
2. What did you expect to see?
```
mysql> create table t1(c varchar(1) not null, name varchar(64) not null);
Query OK, 0 rows affected (0.01 sec)
mysql> insert into t1 values(0xC0, 'LATIN CAPITAL LETTER A WITH GRAVE');
Query OK, 1 row affected (0.01 sec)
```
3. What did you see instead?
```
mysql> create table t1(c varchar(1) not null, name varchar(64) not null);
Query OK, 0 rows affected (0.08 sec)
mysql> insert into t1 values(0xC0, 'LATIN CAPITAL LETTER A WITH GRAVE');
ERROR 1366 (HY000): Incorrect value
```
4. What version of TiDB are you using (`tidb-server -V`)?
",1,extended latin character set not support please answer these questions before submitting your issue thanks what did you do set names drop table if exists create table c varchar not null name varchar not null character set insert into values latin capital letter a with grave what did you expect to see mysql create table c varchar not null name varchar not null query ok rows affected sec mysql insert into values latin capital letter a with grave query ok row affected sec what did you see instead mysql create table c varchar not null name varchar not null query ok rows affected sec mysql insert into values latin capital letter a with grave error incorrect value what version of tidb are you using tidb server v ,1
11625,13672437994.0,IssuesEvent,2020-09-29 08:30:18,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,_utf8mb4 not supported,type/compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
select left(_utf8mb4 0xD0B0D0B1D0B2, 1);
select right(_utf8mb4 0xD0B0D0B2D0B2, 1);
```
2. What did you expect to see?
```
+----------------------------------+
| left(_utf8mb4 0xD0B0D0B1D0B2, 1) |
+----------------------------------+
| а |
+----------------------------------+
1 row in set (0.00 sec)
+-----------------------------------+
| right(_utf8mb4 0xD0B0D0B2D0B2, 1) |
+-----------------------------------+
| в |
+-----------------------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
ERROR 1105 (HY000): line 0 column 35 near "", 1)"" (total length 39)
4. What version of TiDB are you using (`tidb-server -V`)?
",True,"_utf8mb4 not supported - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
select left(_utf8mb4 0xD0B0D0B1D0B2, 1);
select right(_utf8mb4 0xD0B0D0B2D0B2, 1);
```
2. What did you expect to see?
```
+----------------------------------+
| left(_utf8mb4 0xD0B0D0B1D0B2, 1) |
+----------------------------------+
| а |
+----------------------------------+
1 row in set (0.00 sec)
+-----------------------------------+
| right(_utf8mb4 0xD0B0D0B2D0B2, 1) |
+-----------------------------------+
| в |
+-----------------------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
ERROR 1105 (HY000): line 0 column 35 near "", 1)"" (total length 39)
4. What version of TiDB are you using (`tidb-server -V`)?
",1, not supported please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error sql select left select right what did you expect to see left а row in set sec right в row in set sec what did you see instead error line column near total length what version of tidb are you using tidb server v ,1
5543,8015047121.0,IssuesEvent,2018-07-25 08:47:24,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,"need to handle ""ER_WARN_ALLOWED_PACKET_OVERFLOWED"" for some string functions",component/expression help wanted type/compatibility,"Take this as an example:
```sql
select rpad('hello', 18446744073709551617, '1');
```
In MySQL, the result is NULL and a warning about **""Result of rpad() was larger than max_allowed_packet""** is returned:
```sql
MySQL(localhost:3306) > select rpad('hello', 18446744073709551617, '1');
+------------------------------------------+
| rpad('hello', 18446744073709551617, '1') |
+------------------------------------------+
| NULL |
+------------------------------------------+
1 row in set, 3 warnings (0.01 sec)
MySQL(localhost:3306) > show warnings;
+---------+------+---------------------------------------------------------------------------+
| Level | Code | Message |
+---------+------+---------------------------------------------------------------------------+
| Warning | 1292 | Truncated incorrect DECIMAL value: '18446744073709551617' |
| Warning | 1292 | Truncated incorrect DECIMAL value: '18446744073709551617' |
| Warning | 1301 | Result of rpad() was larger than max_allowed_packet (4194304) - truncated |
+---------+------+---------------------------------------------------------------------------+
3 rows in set (0.00 sec)
MySQL(localhost:3306) > select version();
+-----------+
| version() |
+-----------+
| 5.7.22 |
+-----------+
1 row in set (0.00 sec)
```
In TiDB, this query results in a ""lost connection"" and the panic is **""runtime error: makeslice: len out of range""**, and the panic stack is:
```
2018/07/25 16:33:10.027 conn.go:427: [error] lastCmd select rpad('hello', 18446744073709551617, '1'), runtime error: makeslice: len out of range, goroutine 743 [running]:
github.com/pingcap/tidb/server.(*clientConn).Run.func1(0xc43bbea000, 0xc4203bddff)
/Users/jianzhang.zj/opt/gopath/src/github.com/pingcap/tidb/server/conn.go:425 +0x10e
panic(0x1d54500, 0x2024180)
/Users/jianzhang.zj/opt/goroot/src/runtime/panic.go:505 +0x229
strings.Repeat(0xc43c64253d, 0x1, 0x7ffffffffffffffb, 0xc4203bca18, 0x1)
/Users/jianzhang.zj/opt/goroot/src/strings/strings.go:543 +0x83
github.com/pingcap/tidb/expression.(*builtinRpadSig).evalString(0xc422664f40, 0x0, 0x0, 0x0, 0x17f2c44, 0xc422664f40, 0x205eb00, 0xc43e274000)
/Users/jianzhang.zj/opt/gopath/src/github.com/pingcap/tidb/expression/builtin_string.go:1959 +0x38c
github.com/pingcap/tidb/expression.(*ScalarFunction).EvalString(0xc43d1e0aa0, 0x205eb00, 0xc43e274000, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc4203bcca8, 0x1741c17)
/Users/jianzhang.zj/opt/gopath/src/github.com/pingcap/tidb/expression/scalar_function.go:216 +0x4c
github.com/pingcap/tidb/expression.(*ScalarFunction).Eval(0xc43d1e0aa0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/jianzhang.zj/opt/gopath/src/github.com/pingcap/tidb/expression/scalar_function.go:188 +0x481
github.com/pingcap/tidb/expression.foldConstant(0x205df00, 0xc43d1e0aa0, 0x1e18b60, 0xc43c642501, 0xc43d1e0aa0)
/Users/jianzhang.zj/opt/gopath/src/github.com/pingcap/tidb/expression/constant_fold.go:102 +0x5e2
github.com/pingcap/tidb/expression.FoldConstant(0x205df00, 0xc43d1e0aa0, 0xc43c642518, 0x4)
/Users/jianzhang.zj/opt/gopath/src/github.com/pingcap/tidb/expression/constant_fold.go:33 +0x35
github.com/pingcap/tidb/expression.NewFunction(0x205eb00, 0xc43e274000, 0xc43c642518, 0x4, 0xc43c6406c0, 0xc422664ec0, 0x3, 0x4, 0x1e18aa0, 0xc422664ec0, ...)
/Users/jianzhang.zj/opt/gopath/src/github.com/pingcap/tidb/expression/scalar_function.go:98 +0x341
github.com/pingcap/tidb/plan.(*expressionRewriter).funcCallToExpression(0xc421a80d00, 0xc43c8e87e0)
/Users/jianzhang.zj/opt/gopath/src/github.com/pingcap/tidb/plan/expression_rewriter.go:1198 +0x174
github.com/pingcap/tidb/plan.(*expressionRewriter).Leave(0xc421a80d00, 0x20313e0, 0xc43c8e87e0, 0x2048e40, 0xc438357e40, 0x1aa0b01)
/Users/jianzhang.zj/opt/gopath/src/github.com/pingcap/tidb/plan/expression_rewriter.go:746 +0x86a
github.com/pingcap/tidb/ast.(*FuncCallExpr).Accept(0xc43c8e87e0, 0x202cae0, 0xc421a80d00, 0x1a2fd5c, 0x205e800, 0xc421a80c80)
/Users/jianzhang.zj/opt/gopath/src/github.com/pingcap/tidb/ast/functions.go:363 +0x1bf
github.com/pingcap/tidb/plan.(*planBuilder).rewriteExprNode(0xc43b7e3e00, 0xc421a80d00, 0x2048740, 0xc43c8e87e0, 0xc4203bd301, 0x1010559, 0xc422664e40, 0x40, 0x38, 0x1dedf60, ...)
/Users/jianzhang.zj/opt/gopath/src/github.com/pingcap/tidb/plan/expression_rewriter.go:132 +0x54
github.com/pingcap/tidb/plan.(*planBuilder).rewriteWithPreprocess(0xc43b7e3e00, 0x2048740, 0xc43c8e87e0, 0x205e800, 0xc421a80c80, 0x0, 0x1eba401, 0x0, 0x0, 0x0, ...)
/Users/jianzhang.zj/opt/gopath/src/github.com/pingcap/tidb/plan/expression_rewriter.go:104 +0x12b
github.com/pingcap/tidb/plan.(*planBuilder).rewrite(0xc43b7e3e00, 0x2048740, 0xc43c8e87e0, 0x205e800, 0xc421a80c80, 0x0, 0x1, 0x0, 0x0, 0x0, ...)
/Users/jianzhang.zj/opt/gopath/src/github.com/pingcap/tidb/plan/expression_rewriter.go:80 +0x96
github.com/pingcap/tidb/plan.(*planBuilder).buildProjection(0xc43b7e3e00, 0x205e800, 0xc421a80c80, 0xc42402e6e0, 0x1, 0x1, 0x0, 0x1, 0x1, 0x1e17360)
/Users/jianzhang.zj/opt/gopath/src/github.com/pingcap/tidb/plan/logical_plan_builder.go:572 +0x220
github.com/pingcap/tidb/plan.(*planBuilder).buildSelect(0xc43b7e3e00, 0xc4210bb4a0, 0x0, 0x0)
/Users/jianzhang.zj/opt/gopath/src/github.com/pingcap/tidb/plan/logical_plan_builder.go:1664 +0x309
github.com/pingcap/tidb/plan.(*planBuilder).build(0xc43b7e3e00, 0x2031ca0, 0xc4210bb4a0, 0xc421a293b0, 0x205eb00)
/Users/jianzhang.zj/opt/gopath/src/github.com/pingcap/tidb/plan/planbuilder.go:155 +0x603
github.com/pingcap/tidb/plan.Optimize(0x205eb00, 0xc43e274000, 0x2031ca0, 0xc4210bb4a0, 0x2048fc0, 0xc421a293b0, 0x2a7bd00, 0x0, 0x0, 0x2f)
/Users/jianzhang.zj/opt/gopath/src/github.com/pingcap/tidb/plan/optimize
2018/07/25 16:33:10.027 server.go:316: [info] con:1 close connection
```
What we need to do is **not** allocate a buffer larger than **""max_allowed_packet""** for these string functions:
- [ ] to_base64
- [ ] from_base64
- [ ] concat
- [ ] concat_ws
- [ ] replace
- [ ] insert
- [ ] repeat
- [ ] space
- [ ] rpad
- [ ] lpad
- [ ] cast
- [ ] export_set
- [ ] quote
All the above functions implemented in MySQL are located in the **""sql/item_strfunc.cc""** file, you can grep the function name to see specific implementations.
All the above functions can be found in TiDB from the source file **""expression/builtin.go""**.",True,"need to handle ""ER_WARN_ALLOWED_PACKET_OVERFLOWED"" for some string functions - Take this as an example:
```sql
select rpad('hello', 18446744073709551617, '1');
```
In MySQL, the result is NULL and a warning about **""Result of rpad() was larger than max_allowed_packet""** is returned:
```sql
MySQL(localhost:3306) > select rpad('hello', 18446744073709551617, '1');
+------------------------------------------+
| rpad('hello', 18446744073709551617, '1') |
+------------------------------------------+
| NULL |
+------------------------------------------+
1 row in set, 3 warnings (0.01 sec)
MySQL(localhost:3306) > show warnings;
+---------+------+---------------------------------------------------------------------------+
| Level | Code | Message |
+---------+------+---------------------------------------------------------------------------+
| Warning | 1292 | Truncated incorrect DECIMAL value: '18446744073709551617' |
| Warning | 1292 | Truncated incorrect DECIMAL value: '18446744073709551617' |
| Warning | 1301 | Result of rpad() was larger than max_allowed_packet (4194304) - truncated |
+---------+------+---------------------------------------------------------------------------+
3 rows in set (0.00 sec)
MySQL(localhost:3306) > select version();
+-----------+
| version() |
+-----------+
| 5.7.22 |
+-----------+
1 row in set (0.00 sec)
```
In TiDB, this query results in a ""lost connection"" and the panic is **""runtime error: makeslice: len out of range""**, and the panic stack is:
```
2018/07/25 16:33:10.027 conn.go:427: [error] lastCmd select rpad('hello', 18446744073709551617, '1'), runtime error: makeslice: len out of range, goroutine 743 [running]:
github.com/pingcap/tidb/server.(*clientConn).Run.func1(0xc43bbea000, 0xc4203bddff)
/Users/jianzhang.zj/opt/gopath/src/github.com/pingcap/tidb/server/conn.go:425 +0x10e
panic(0x1d54500, 0x2024180)
/Users/jianzhang.zj/opt/goroot/src/runtime/panic.go:505 +0x229
strings.Repeat(0xc43c64253d, 0x1, 0x7ffffffffffffffb, 0xc4203bca18, 0x1)
/Users/jianzhang.zj/opt/goroot/src/strings/strings.go:543 +0x83
github.com/pingcap/tidb/expression.(*builtinRpadSig).evalString(0xc422664f40, 0x0, 0x0, 0x0, 0x17f2c44, 0xc422664f40, 0x205eb00, 0xc43e274000)
/Users/jianzhang.zj/opt/gopath/src/github.com/pingcap/tidb/expression/builtin_string.go:1959 +0x38c
github.com/pingcap/tidb/expression.(*ScalarFunction).EvalString(0xc43d1e0aa0, 0x205eb00, 0xc43e274000, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc4203bcca8, 0x1741c17)
/Users/jianzhang.zj/opt/gopath/src/github.com/pingcap/tidb/expression/scalar_function.go:216 +0x4c
github.com/pingcap/tidb/expression.(*ScalarFunction).Eval(0xc43d1e0aa0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/jianzhang.zj/opt/gopath/src/github.com/pingcap/tidb/expression/scalar_function.go:188 +0x481
github.com/pingcap/tidb/expression.foldConstant(0x205df00, 0xc43d1e0aa0, 0x1e18b60, 0xc43c642501, 0xc43d1e0aa0)
/Users/jianzhang.zj/opt/gopath/src/github.com/pingcap/tidb/expression/constant_fold.go:102 +0x5e2
github.com/pingcap/tidb/expression.FoldConstant(0x205df00, 0xc43d1e0aa0, 0xc43c642518, 0x4)
/Users/jianzhang.zj/opt/gopath/src/github.com/pingcap/tidb/expression/constant_fold.go:33 +0x35
github.com/pingcap/tidb/expression.NewFunction(0x205eb00, 0xc43e274000, 0xc43c642518, 0x4, 0xc43c6406c0, 0xc422664ec0, 0x3, 0x4, 0x1e18aa0, 0xc422664ec0, ...)
/Users/jianzhang.zj/opt/gopath/src/github.com/pingcap/tidb/expression/scalar_function.go:98 +0x341
github.com/pingcap/tidb/plan.(*expressionRewriter).funcCallToExpression(0xc421a80d00, 0xc43c8e87e0)
/Users/jianzhang.zj/opt/gopath/src/github.com/pingcap/tidb/plan/expression_rewriter.go:1198 +0x174
github.com/pingcap/tidb/plan.(*expressionRewriter).Leave(0xc421a80d00, 0x20313e0, 0xc43c8e87e0, 0x2048e40, 0xc438357e40, 0x1aa0b01)
/Users/jianzhang.zj/opt/gopath/src/github.com/pingcap/tidb/plan/expression_rewriter.go:746 +0x86a
github.com/pingcap/tidb/ast.(*FuncCallExpr).Accept(0xc43c8e87e0, 0x202cae0, 0xc421a80d00, 0x1a2fd5c, 0x205e800, 0xc421a80c80)
/Users/jianzhang.zj/opt/gopath/src/github.com/pingcap/tidb/ast/functions.go:363 +0x1bf
github.com/pingcap/tidb/plan.(*planBuilder).rewriteExprNode(0xc43b7e3e00, 0xc421a80d00, 0x2048740, 0xc43c8e87e0, 0xc4203bd301, 0x1010559, 0xc422664e40, 0x40, 0x38, 0x1dedf60, ...)
/Users/jianzhang.zj/opt/gopath/src/github.com/pingcap/tidb/plan/expression_rewriter.go:132 +0x54
github.com/pingcap/tidb/plan.(*planBuilder).rewriteWithPreprocess(0xc43b7e3e00, 0x2048740, 0xc43c8e87e0, 0x205e800, 0xc421a80c80, 0x0, 0x1eba401, 0x0, 0x0, 0x0, ...)
/Users/jianzhang.zj/opt/gopath/src/github.com/pingcap/tidb/plan/expression_rewriter.go:104 +0x12b
github.com/pingcap/tidb/plan.(*planBuilder).rewrite(0xc43b7e3e00, 0x2048740, 0xc43c8e87e0, 0x205e800, 0xc421a80c80, 0x0, 0x1, 0x0, 0x0, 0x0, ...)
/Users/jianzhang.zj/opt/gopath/src/github.com/pingcap/tidb/plan/expression_rewriter.go:80 +0x96
github.com/pingcap/tidb/plan.(*planBuilder).buildProjection(0xc43b7e3e00, 0x205e800, 0xc421a80c80, 0xc42402e6e0, 0x1, 0x1, 0x0, 0x1, 0x1, 0x1e17360)
/Users/jianzhang.zj/opt/gopath/src/github.com/pingcap/tidb/plan/logical_plan_builder.go:572 +0x220
github.com/pingcap/tidb/plan.(*planBuilder).buildSelect(0xc43b7e3e00, 0xc4210bb4a0, 0x0, 0x0)
/Users/jianzhang.zj/opt/gopath/src/github.com/pingcap/tidb/plan/logical_plan_builder.go:1664 +0x309
github.com/pingcap/tidb/plan.(*planBuilder).build(0xc43b7e3e00, 0x2031ca0, 0xc4210bb4a0, 0xc421a293b0, 0x205eb00)
/Users/jianzhang.zj/opt/gopath/src/github.com/pingcap/tidb/plan/planbuilder.go:155 +0x603
github.com/pingcap/tidb/plan.Optimize(0x205eb00, 0xc43e274000, 0x2031ca0, 0xc4210bb4a0, 0x2048fc0, 0xc421a293b0, 0x2a7bd00, 0x0, 0x0, 0x2f)
/Users/jianzhang.zj/opt/gopath/src/github.com/pingcap/tidb/plan/optimize
2018/07/25 16:33:10.027 server.go:316: [info] con:1 close connection
```
What we need to do is **not** allocate a buffer larger than **""max_allowed_packet""** for these string functions:
- [ ] to_base64
- [ ] from_base64
- [ ] concat
- [ ] concat_ws
- [ ] replace
- [ ] insert
- [ ] repeat
- [ ] space
- [ ] rpad
- [ ] lpad
- [ ] cast
- [ ] export_set
- [ ] quote
All the above functions implemented in MySQL are located in the **""sql/item_strfunc.cc""** file, you can grep the function name to see specific implementations.
All the above functions can be found in TiDB from the source file **""expression/builtin.go""**.",1,need to handle er warn allowed packet overflowed for some string functions take this as an example sql select rpad hello in mysql the result is null and a warning about result of rpad was larger than max allowed packet is returned sql mysql localhost select rpad hello rpad hello null row in set warnings sec mysql localhost show warnings level code message warning truncated incorrect decimal value warning truncated incorrect decimal value warning result of rpad was larger than max allowed packet truncated rows in set sec mysql localhost select version version row in set sec in tidb this query results in a lost connection and the panic is runtime error makeslice len out of range and the panic stack is conn go lastcmd select rpad hello runtime error makeslice len out of range goroutine github com pingcap tidb server clientconn run users jianzhang zj opt gopath src github com pingcap tidb server conn go panic users jianzhang zj opt goroot src runtime panic go strings repeat users jianzhang zj opt goroot src strings strings go github com pingcap tidb expression builtinrpadsig evalstring users jianzhang zj opt gopath src github com pingcap tidb expression builtin string go github com pingcap tidb expression scalarfunction evalstring users jianzhang zj opt gopath src github com pingcap tidb expression scalar function go github com pingcap tidb expression scalarfunction eval users jianzhang zj opt gopath src github com pingcap tidb expression scalar function go github com pingcap tidb expression foldconstant users jianzhang zj opt gopath src github com pingcap tidb expression constant fold go github com pingcap tidb expression foldconstant users jianzhang zj opt gopath src github com pingcap tidb expression constant fold go github com pingcap tidb expression newfunction users jianzhang zj opt gopath src github com pingcap tidb expression scalar function go github com pingcap tidb plan expressionrewriter funccalltoexpression users jianzhang zj opt gopath src github com pingcap tidb plan expression rewriter go github com pingcap tidb plan expressionrewriter leave users jianzhang zj opt gopath src github com pingcap tidb plan expression rewriter go github com pingcap tidb ast funccallexpr accept users jianzhang zj opt gopath src github com pingcap tidb ast functions go github com pingcap tidb plan planbuilder rewriteexprnode users jianzhang zj opt gopath src github com pingcap tidb plan expression rewriter go github com pingcap tidb plan planbuilder rewritewithpreprocess users jianzhang zj opt gopath src github com pingcap tidb plan expression rewriter go github com pingcap tidb plan planbuilder rewrite users jianzhang zj opt gopath src github com pingcap tidb plan expression rewriter go github com pingcap tidb plan planbuilder buildprojection users jianzhang zj opt gopath src github com pingcap tidb plan logical plan builder go github com pingcap tidb plan planbuilder buildselect users jianzhang zj opt gopath src github com pingcap tidb plan logical plan builder go github com pingcap tidb plan planbuilder build users jianzhang zj opt gopath src github com pingcap tidb plan planbuilder go github com pingcap tidb plan optimize users jianzhang zj opt gopath src github com pingcap tidb plan optimize server go con close connection what we need to do is not allocate a buffer larger than max allowed packet for these string functions to from concat concat ws replace insert repeat space rpad lpad cast export set quote all the above functions implemented in mysql are located in the sql item strfunc cc file you can grep the function name to see specific implementations all the above functions can be found in tidb from the source file expression builtin go ,1
11106,13130816853.0,IssuesEvent,2020-08-06 15:56:41,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,TiDB don't trim the space char at the end of a string value.,type/compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
create table t(a varchar(50), b varchar(50), unique a(a), index b(b));
```
2. What did you expect to see?
```
insert into t values('a ', 'a'), ('a', 'b');
```
This will raise error that 'a' have duplicate key **in mysql**.
```
insert into t values('a', 'a'), ('b', 'a ');
select b, char_length(b) from t where b = 'a';
select b, char_length(b) from t where b = 'a ';
```
This two select all return result as follows:
```
a 1
a 6
```
3. What did you see instead?
TiDB won't raise error in first case.
TiDB won't return the exact data, not trim the data and return two row.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
e96cda003e07ca732d04657924dc48a0c0c4fc82
",True,"TiDB don't trim the space char at the end of a string value. - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
create table t(a varchar(50), b varchar(50), unique a(a), index b(b));
```
2. What did you expect to see?
```
insert into t values('a ', 'a'), ('a', 'b');
```
This will raise error that 'a' have duplicate key **in mysql**.
```
insert into t values('a', 'a'), ('b', 'a ');
select b, char_length(b) from t where b = 'a';
select b, char_length(b) from t where b = 'a ';
```
This two select all return result as follows:
```
a 1
a 6
```
3. What did you see instead?
TiDB won't raise error in first case.
TiDB won't return the exact data, not trim the data and return two row.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
e96cda003e07ca732d04657924dc48a0c0c4fc82
",1,tidb don t trim the space char at the end of a string value please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error create table t a varchar b varchar unique a a index b b what did you expect to see insert into t values a a a b this will raise error that a have duplicate key in mysql insert into t values a a b a select b char length b from t where b a select b char length b from t where b a this two select all return result as follows a a what did you see instead tidb won t raise error in first case tidb won t return the exact data not trim the data and return two row what version of tidb are you using tidb server v or run select tidb version on tidb ,1
10891,12877874370.0,IssuesEvent,2020-07-11 13:38:48,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,ASC and DESC after GROUP BY does not work.,type/bug type/compatibility type/duplicate,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
mysql> SELECT sex FROM t1 GROUP BY sex DESC;
+------+
| sex |
+------+
| M |
| F |
+------+
2 rows in set (0.00 sec)
mysql> SELECT sex FROM t1 GROUP BY sex DESC;
+------+
| sex |
+------+
| F |
| M |
+------+
2 rows in set (0.00 sec)
```
2. What did you expect to see?
Outputs with descending order.
3. What did you see instead?
Outputs with inexplicit orders.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
Git Commit Hash: b5dd1bdc7275f3200d829a6705c305da74fb4592
Git Branch: master
UTC Build Time: 2019-06-14 02:48:29
GoVersion: go version go1.12.1 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false ",True,"ASC and DESC after GROUP BY does not work. - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
mysql> SELECT sex FROM t1 GROUP BY sex DESC;
+------+
| sex |
+------+
| M |
| F |
+------+
2 rows in set (0.00 sec)
mysql> SELECT sex FROM t1 GROUP BY sex DESC;
+------+
| sex |
+------+
| F |
| M |
+------+
2 rows in set (0.00 sec)
```
2. What did you expect to see?
Outputs with descending order.
3. What did you see instead?
Outputs with inexplicit orders.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
Git Commit Hash: b5dd1bdc7275f3200d829a6705c305da74fb4592
Git Branch: master
UTC Build Time: 2019-06-14 02:48:29
GoVersion: go version go1.12.1 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false ",1,asc and desc after group by does not work bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error sql mysql select sex from group by sex desc sex m f rows in set sec mysql select sex from group by sex desc sex f m rows in set sec what did you expect to see outputs with descending order what did you see instead outputs with inexplicit orders what version of tidb are you using tidb server v or run select tidb version on tidb git commit hash git branch master utc build time goversion go version darwin race enabled false tikv min version alpha check table before drop false ,1
7071,9359069328.0,IssuesEvent,2019-04-02 05:25:58,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,json_type and cast cannot keep same with MySQL,type/bug type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```SQL
select json_type(cast(cast('2014-11-25 18:00' as datetime) as json));
select json_type(cast(cast('2014-11-25' as date) as json));
select json_type(cast(cast('18:00:59' as time) as json));
```
2. What did you expect to see?
## In MySQL
```SQL
mysql> select json_type(cast(cast('2014-11-25 18:00' as datetime) as json));
+---------------------------------------------------------------+
| json_type(cast(cast('2014-11-25 18:00' as datetime) as json)) |
+---------------------------------------------------------------+
| DATETIME |
+---------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> select json_type(cast(cast('2014-11-25' as date) as json));
+-----------------------------------------------------+
| json_type(cast(cast('2014-11-25' as date) as json)) |
+-----------------------------------------------------+
| DATE |
+-----------------------------------------------------+
1 row in set (0.00 sec)
mysql> select json_type(cast(cast('18:00:59' as time) as json));
+---------------------------------------------------+
| json_type(cast(cast('18:00:59' as time) as json)) |
+---------------------------------------------------+
| TIME |
+---------------------------------------------------+
1 row in set (0.01 sec)
mysql>
mysql> select version();
+-------------------------+
| version() |
+-------------------------+
| 5.7.25-0ubuntu0.18.04.2 |
+-------------------------+
1 row in set (0.00 sec)
mysql>
```
3. What did you see instead?
## In TiDB
```SQL
mysql> select json_type(cast(cast('2014-11-25 18:00' as datetime) as json));
+---------------------------------------------------------------+
| json_type(cast(cast('2014-11-25 18:00' as datetime) as json)) |
+---------------------------------------------------------------+
| STRING |
+---------------------------------------------------------------+
1 row in set (0.01 sec)
mysql> select json_type(cast(cast('2014-11-25' as date) as json));
+-----------------------------------------------------+
| json_type(cast(cast('2014-11-25' as date) as json)) |
+-----------------------------------------------------+
| STRING |
+-----------------------------------------------------+
1 row in set (0.00 sec)
mysql> select json_type(cast(cast('18:00:59' as time) as json));
+---------------------------------------------------+
| json_type(cast(cast('18:00:59' as time) as json)) |
+---------------------------------------------------+
| STRING |
+---------------------------------------------------+
1 row in set (0.00 sec)
mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v3.0.0-beta-321-gc6a757b24
Git Commit Hash: c6a757b2435965a72ada9d61ea8b7a367bd89b5f
Git Branch: master
UTC Build Time: 2019-04-02 02:38:04
GoVersion: go version go1.12.1 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
1 row in set (0.00 sec)
mysql>
```
",True,"json_type and cast cannot keep same with MySQL - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```SQL
select json_type(cast(cast('2014-11-25 18:00' as datetime) as json));
select json_type(cast(cast('2014-11-25' as date) as json));
select json_type(cast(cast('18:00:59' as time) as json));
```
2. What did you expect to see?
## In MySQL
```SQL
mysql> select json_type(cast(cast('2014-11-25 18:00' as datetime) as json));
+---------------------------------------------------------------+
| json_type(cast(cast('2014-11-25 18:00' as datetime) as json)) |
+---------------------------------------------------------------+
| DATETIME |
+---------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> select json_type(cast(cast('2014-11-25' as date) as json));
+-----------------------------------------------------+
| json_type(cast(cast('2014-11-25' as date) as json)) |
+-----------------------------------------------------+
| DATE |
+-----------------------------------------------------+
1 row in set (0.00 sec)
mysql> select json_type(cast(cast('18:00:59' as time) as json));
+---------------------------------------------------+
| json_type(cast(cast('18:00:59' as time) as json)) |
+---------------------------------------------------+
| TIME |
+---------------------------------------------------+
1 row in set (0.01 sec)
mysql>
mysql> select version();
+-------------------------+
| version() |
+-------------------------+
| 5.7.25-0ubuntu0.18.04.2 |
+-------------------------+
1 row in set (0.00 sec)
mysql>
```
3. What did you see instead?
## In TiDB
```SQL
mysql> select json_type(cast(cast('2014-11-25 18:00' as datetime) as json));
+---------------------------------------------------------------+
| json_type(cast(cast('2014-11-25 18:00' as datetime) as json)) |
+---------------------------------------------------------------+
| STRING |
+---------------------------------------------------------------+
1 row in set (0.01 sec)
mysql> select json_type(cast(cast('2014-11-25' as date) as json));
+-----------------------------------------------------+
| json_type(cast(cast('2014-11-25' as date) as json)) |
+-----------------------------------------------------+
| STRING |
+-----------------------------------------------------+
1 row in set (0.00 sec)
mysql> select json_type(cast(cast('18:00:59' as time) as json));
+---------------------------------------------------+
| json_type(cast(cast('18:00:59' as time) as json)) |
+---------------------------------------------------+
| STRING |
+---------------------------------------------------+
1 row in set (0.00 sec)
mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v3.0.0-beta-321-gc6a757b24
Git Commit Hash: c6a757b2435965a72ada9d61ea8b7a367bd89b5f
Git Branch: master
UTC Build Time: 2019-04-02 02:38:04
GoVersion: go version go1.12.1 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
1 row in set (0.00 sec)
mysql>
```
",1,json type and cast cannot keep same with mysql bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error sql select json type cast cast as datetime as json select json type cast cast as date as json select json type cast cast as time as json what did you expect to see in mysql sql mysql select json type cast cast as datetime as json json type cast cast as datetime as json datetime row in set sec mysql select json type cast cast as date as json json type cast cast as date as json date row in set sec mysql select json type cast cast as time as json json type cast cast as time as json time row in set sec mysql mysql select version version row in set sec mysql what did you see instead in tidb sql mysql select json type cast cast as datetime as json json type cast cast as datetime as json string row in set sec mysql select json type cast cast as date as json json type cast cast as date as json string row in set sec mysql select json type cast cast as time as json json type cast cast as time as json string row in set sec mysql select tidb version g row tidb version release version beta git commit hash git branch master utc build time goversion go version linux race enabled false tikv min version alpha check table before drop false row in set sec mysql ,1
12186,14370907407.0,IssuesEvent,2020-12-01 11:46:50,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Index name too long for anonymous index,severity/moderate sig/DDL status/help-wanted type/bug type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
create table ttttt(bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb int, b int);
alter table ttttt add index bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb(b);
alter table ttttt add index (bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb);
```
2. What did you expect to see?
```
mysql> alter table ttttt add index (bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb);
Query OK, 0 rows affected (0.04 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> show create table ttttt;
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ttttt | CREATE TABLE `ttttt` (
`bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL,
KEY `bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb` (`b`),
KEY `bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb_2` (`bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
```
TiDB> alter table ttttt add index (bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb);
[ddl:1059]Identifier name 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb_2' is too long
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
TiDB> select tidb_version();
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v4.0.0-alpha-677-g18e42cfd2
Git Commit Hash: 18e42cfd233fa04850c24469c413237e38f02726
Git Branch: feature/wasm
UTC Build Time: 2019-11-28 08:41:07
GoVersion: go version go1.13.4 linux/amd64
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
",True,"Index name too long for anonymous index - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
create table ttttt(bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb int, b int);
alter table ttttt add index bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb(b);
alter table ttttt add index (bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb);
```
2. What did you expect to see?
```
mysql> alter table ttttt add index (bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb);
Query OK, 0 rows affected (0.04 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> show create table ttttt;
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ttttt | CREATE TABLE `ttttt` (
`bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL,
KEY `bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb` (`b`),
KEY `bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb_2` (`bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
```
TiDB> alter table ttttt add index (bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb);
[ddl:1059]Identifier name 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb_2' is too long
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
TiDB> select tidb_version();
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v4.0.0-alpha-677-g18e42cfd2
Git Commit Hash: 18e42cfd233fa04850c24469c413237e38f02726
Git Branch: feature/wasm
UTC Build Time: 2019-11-28 08:41:07
GoVersion: go version go1.13.4 linux/amd64
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
",1,index name too long for anonymous index bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error create table ttttt bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb int b int alter table ttttt add index bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb b alter table ttttt add index bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb what did you expect to see mysql alter table ttttt add index bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb query ok rows affected sec records duplicates warnings mysql show create table ttttt table create table ttttt create table ttttt bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb int default null b int default null key bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb b key bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb engine innodb default charset collate ai ci row in set sec what did you see instead tidb alter table ttttt add index bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb identifier name bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb is too long what version of tidb are you using tidb server v or run select tidb version on tidb tidb select tidb version tidb version release version alpha git commit hash git branch feature wasm utc build time goversion go version linux race enabled false tikv min version check table before drop false row in set sec ,1
14844,18344170075.0,IssuesEvent,2021-10-08 02:27:25,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,SET PASSWORD FOR CURRENT_USER() fails,type/bug type/compatibility sig/execution severity/moderate,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```sql
select current_user();
SET PASSWORD FOR CURRENT_USER() = ""admin""; # fails
SET PASSWORD for ""root""@""%"" = ""admin""; # works
```
### 2. What did you expect to see? (Required)
The statements should both work.
### 3. What did you see instead (Required)
```sql
mysql> select current_user();
+----------------+
| current_user() |
+----------------+
| root@% |
+----------------+
1 row in set (0.00 sec)
mysql> SET PASSWORD FOR CURRENT_USER() = ""admin""; # fails
ERROR 1133 (42000): Can't find any matching row in the user table
mysql> SET PASSWORD for ""root""@""%"" = ""admin""; # works
Query OK, 0 rows affected (0.00 sec)
```
### 4. What is your TiDB version? (Required)
```sql
mysql> SELECT tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v5.3.0-alpha-256-gb0b559f23
Edition: Community
Git Commit Hash: b0b559f2389de5e27d0d2e12d2bfae049186b54b
Git Branch: master
UTC Build Time: 2021-10-01 14:52:33
GoVersion: go1.16.7
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.00 sec)
```
",True,"SET PASSWORD FOR CURRENT_USER() fails - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```sql
select current_user();
SET PASSWORD FOR CURRENT_USER() = ""admin""; # fails
SET PASSWORD for ""root""@""%"" = ""admin""; # works
```
### 2. What did you expect to see? (Required)
The statements should both work.
### 3. What did you see instead (Required)
```sql
mysql> select current_user();
+----------------+
| current_user() |
+----------------+
| root@% |
+----------------+
1 row in set (0.00 sec)
mysql> SET PASSWORD FOR CURRENT_USER() = ""admin""; # fails
ERROR 1133 (42000): Can't find any matching row in the user table
mysql> SET PASSWORD for ""root""@""%"" = ""admin""; # works
Query OK, 0 rows affected (0.00 sec)
```
### 4. What is your TiDB version? (Required)
```sql
mysql> SELECT tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v5.3.0-alpha-256-gb0b559f23
Edition: Community
Git Commit Hash: b0b559f2389de5e27d0d2e12d2bfae049186b54b
Git Branch: master
UTC Build Time: 2021-10-01 14:52:33
GoVersion: go1.16.7
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.00 sec)
```
",1,set password for current user fails bug report please answer these questions before submitting your issue thanks minimal reproduce step required sql select current user set password for current user admin fails set password for root admin works what did you expect to see required the statements should both work what did you see instead required sql mysql select current user current user root row in set sec mysql set password for current user admin fails error can t find any matching row in the user table mysql set password for root admin works query ok rows affected sec what is your tidb version required sql mysql select tidb version g row tidb version release version alpha edition community git commit hash git branch master utc build time goversion race enabled false tikv min version check table before drop false row in set sec ,1
10310,12297230960.0,IssuesEvent,2020-05-11 08:29:02,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Diff regexp matching result with MySQL 5.7 on multi-byte charsets,type/compatibility,"For example:
```
''' TiDB '''
mysql> select version();
+---------------------------------------------+
| version() |
+---------------------------------------------+
| 5.7.10-TiDB-v2.0.0-rc.4-248-g25d7d74d-dirty |
+---------------------------------------------+
1 row in set (0.01 sec)
mysql> SHOW VARIABLES LIKE 'character%';
+--------------------------+--------------------------------------------------------+
| Variable_name | Value |
+--------------------------+--------------------------------------------------------+
| character_set_server | utf8 |
| character_set_database | utf8 |
| character_sets_dir | /usr/local/mysql-5.6.25-osx10.8-x86_64/share/charsets/ |
| character_set_results | utf8 |
| character_set_system | utf8 |
| character_set_connection | utf8 |
| character_set_client | utf8 |
| character_set_filesystem | binary |
+--------------------------+--------------------------------------------------------+
8 rows in set (0.01 sec)
mysql> select ""我"" rlike ""^...$"";
+---------------------+
| ""我"" rlike ""^...$"" |
+---------------------+
| 0 |
+---------------------+
1 row in set (0.00 sec)
mysql> select ""我"" rlike ""^.$"";
+-------------------+
| ""我"" rlike ""^.$"" |
+-------------------+
| 1 |
+-------------------+
1 row in set (0.00 sec)
```
```
''' MySQL 5.7 '''
mysql> select version();
+-----------+
| version() |
+-----------+
| 5.7.22 |
+-----------+
1 row in set (0.00 sec)
mysql> SHOW VARIABLES LIKE 'character%';
+--------------------------+-----------------------------------------------------------+
| Variable_name | Value |
+--------------------------+-----------------------------------------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/local/mysql-5.7.22-macos10.13-x86_64/share/charsets/ |
+--------------------------+-----------------------------------------------------------+
8 rows in set (0.04 sec)
mysql> select ""我"" rlike ""^...$"";
+---------------------+
| ""我"" rlike ""^...$"" |
+---------------------+
| 1 |
+---------------------+
1 row in set (0.00 sec)
mysql> select ""我"" rlike ""^.$"";
+-------------------+
| ""我"" rlike ""^.$"" |
+-------------------+
| 0 |
+-------------------+
1 row in set (0.00 sec)
```
MySQL actually explained the per-byte matching behavior on multi-byte charsets, which differs on 8.0 and the prior versions('Prior to MySQL 8.0.4, MySQL used the Henry Spencer regular expression library to support regular expression operations, rather than International Components for Unicode (ICU).'):
https://dev.mysql.com/doc/refman/8.0/en/regexp.html
So, if currently TiDB aim to be compatible with MySQL 5.7, I guess this is a bug we need to fix",True,"Diff regexp matching result with MySQL 5.7 on multi-byte charsets - For example:
```
''' TiDB '''
mysql> select version();
+---------------------------------------------+
| version() |
+---------------------------------------------+
| 5.7.10-TiDB-v2.0.0-rc.4-248-g25d7d74d-dirty |
+---------------------------------------------+
1 row in set (0.01 sec)
mysql> SHOW VARIABLES LIKE 'character%';
+--------------------------+--------------------------------------------------------+
| Variable_name | Value |
+--------------------------+--------------------------------------------------------+
| character_set_server | utf8 |
| character_set_database | utf8 |
| character_sets_dir | /usr/local/mysql-5.6.25-osx10.8-x86_64/share/charsets/ |
| character_set_results | utf8 |
| character_set_system | utf8 |
| character_set_connection | utf8 |
| character_set_client | utf8 |
| character_set_filesystem | binary |
+--------------------------+--------------------------------------------------------+
8 rows in set (0.01 sec)
mysql> select ""我"" rlike ""^...$"";
+---------------------+
| ""我"" rlike ""^...$"" |
+---------------------+
| 0 |
+---------------------+
1 row in set (0.00 sec)
mysql> select ""我"" rlike ""^.$"";
+-------------------+
| ""我"" rlike ""^.$"" |
+-------------------+
| 1 |
+-------------------+
1 row in set (0.00 sec)
```
```
''' MySQL 5.7 '''
mysql> select version();
+-----------+
| version() |
+-----------+
| 5.7.22 |
+-----------+
1 row in set (0.00 sec)
mysql> SHOW VARIABLES LIKE 'character%';
+--------------------------+-----------------------------------------------------------+
| Variable_name | Value |
+--------------------------+-----------------------------------------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/local/mysql-5.7.22-macos10.13-x86_64/share/charsets/ |
+--------------------------+-----------------------------------------------------------+
8 rows in set (0.04 sec)
mysql> select ""我"" rlike ""^...$"";
+---------------------+
| ""我"" rlike ""^...$"" |
+---------------------+
| 1 |
+---------------------+
1 row in set (0.00 sec)
mysql> select ""我"" rlike ""^.$"";
+-------------------+
| ""我"" rlike ""^.$"" |
+-------------------+
| 0 |
+-------------------+
1 row in set (0.00 sec)
```
MySQL actually explained the per-byte matching behavior on multi-byte charsets, which differs on 8.0 and the prior versions('Prior to MySQL 8.0.4, MySQL used the Henry Spencer regular expression library to support regular expression operations, rather than International Components for Unicode (ICU).'):
https://dev.mysql.com/doc/refman/8.0/en/regexp.html
So, if currently TiDB aim to be compatible with MySQL 5.7, I guess this is a bug we need to fix",1,diff regexp matching result with mysql on multi byte charsets for example tidb mysql select version version tidb rc dirty row in set sec mysql show variables like character variable name value character set server character set database character sets dir usr local mysql share charsets character set results character set system character set connection character set client character set filesystem binary rows in set sec mysql select 我 rlike 我 rlike row in set sec mysql select 我 rlike 我 rlike row in set sec mysql mysql select version version row in set sec mysql show variables like character variable name value character set client character set connection character set database character set filesystem binary character set results character set server character set system character sets dir usr local mysql share charsets rows in set sec mysql select 我 rlike 我 rlike row in set sec mysql select 我 rlike 我 rlike row in set sec mysql actually explained the per byte matching behavior on multi byte charsets which differs on and the prior versions prior to mysql mysql used the henry spencer regular expression library to support regular expression operations rather than international components for unicode icu so if currently tidb aim to be compatible with mysql i guess this is a bug we need to fix,1
5795,8244393157.0,IssuesEvent,2018-09-11 06:03:36,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,syntax .tbl_name is not supported,type/compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
MySQL [mysql]> use mysql;
Database changed
MySQL [mysql]> select * from .db;
ERROR 1105 (HY000): line 0 column 15 near ""db"" (total length 17)
```
refer: https://dev.mysql.com/doc/refman/5.7/en/identifier-qualifiers.html
",True,"syntax .tbl_name is not supported - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
MySQL [mysql]> use mysql;
Database changed
MySQL [mysql]> select * from .db;
ERROR 1105 (HY000): line 0 column 15 near ""db"" (total length 17)
```
refer: https://dev.mysql.com/doc/refman/5.7/en/identifier-qualifiers.html
",1,syntax tbl name is not supported please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error sql mysql use mysql database changed mysql select from db error line column near db total length refer ,1
3402,6368254226.0,IssuesEvent,2017-08-01 08:47:40,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,"Builtin function ""CAST"" compatibilities",compatibility rc3.1,"select cast(cast(1-2 as unsigned) as signed integer);
MySQL:
mysql> select cast(cast(1-2 as unsigned) as signed integer);
+-----------------------------------------------+
| cast(cast(1-2 as unsigned) as signed integer) |
+-----------------------------------------------+
| -1 |
+-----------------------------------------------+
1 row in set (0.00 sec)
TiDB:
mysql> select cast(cast(1-2 as unsigned) as signed integer);
ERROR 1690 (22003): constant 18446744073709551615 overflows bigint
",True,"Builtin function ""CAST"" compatibilities - select cast(cast(1-2 as unsigned) as signed integer);
MySQL:
mysql> select cast(cast(1-2 as unsigned) as signed integer);
+-----------------------------------------------+
| cast(cast(1-2 as unsigned) as signed integer) |
+-----------------------------------------------+
| -1 |
+-----------------------------------------------+
1 row in set (0.00 sec)
TiDB:
mysql> select cast(cast(1-2 as unsigned) as signed integer);
ERROR 1690 (22003): constant 18446744073709551615 overflows bigint
",1,builtin function cast compatibilities select cast cast as unsigned as signed integer mysql mysql select cast cast as unsigned as signed integer cast cast as unsigned as signed integer row in set sec tidb mysql select cast cast as unsigned as signed integer error constant overflows bigint ,1
17214,23735063883.0,IssuesEvent,2022-08-31 07:20:24,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,`order by` of json value is different with MySQL,type/enhancement type/compatibility component/json,"## Enhancement
```
create table t(i INT, j JSON);
insert into t values (0,'[1,2,3,4]');
insert into t values (0,'[1,2,3]');
insert into t values (0,'[5]');
```
Then consider the following two query:
```
select j from t order by j;
select j from t where j > json_array(5);
```
The first line returns:
```
+--------------+
| j |
+--------------+
| [5] |
| [1, 2, 3] |
| [1, 2, 3, 4] |
+--------------+
```
It indicates that `[5]` is the smallest one. However, the second one returns:
```
Empty Set
```
It shows no one is greater than `[5]`. It's not consistent :cry: .
For TiDB, it follows the json order, and returns:
```
+--------------+
| j |
+--------------+
| [1, 2, 3] |
| [1, 2, 3, 4] |
| [5] |
+--------------+
```
For the first selection.
",True,"`order by` of json value is different with MySQL - ## Enhancement
```
create table t(i INT, j JSON);
insert into t values (0,'[1,2,3,4]');
insert into t values (0,'[1,2,3]');
insert into t values (0,'[5]');
```
Then consider the following two query:
```
select j from t order by j;
select j from t where j > json_array(5);
```
The first line returns:
```
+--------------+
| j |
+--------------+
| [5] |
| [1, 2, 3] |
| [1, 2, 3, 4] |
+--------------+
```
It indicates that `[5]` is the smallest one. However, the second one returns:
```
Empty Set
```
It shows no one is greater than `[5]`. It's not consistent :cry: .
For TiDB, it follows the json order, and returns:
```
+--------------+
| j |
+--------------+
| [1, 2, 3] |
| [1, 2, 3, 4] |
| [5] |
+--------------+
```
For the first selection.
",1, order by of json value is different with mysql enhancement create table t i int j json insert into t values insert into t values insert into t values then consider the following two query select j from t order by j select j from t where j json array the first line returns j it indicates that is the smallest one however the second one returns empty set it shows no one is greater than it s not consistent cry for tidb it follows the json order and returns j for the first selection ,1
6970,9249131351.0,IssuesEvent,2019-03-15 08:41:08,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,get wrong query result when use self-define rank ,type/compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```
create table a (f1 int ,f2 varchar(32) ,primary key (f1));
insert into a(f1,f2)
values(1,'a'),
(2,'b'),
(3,'d'),
(4,'d'),
(5,'e'),
(6,'f'),
(7,'g'),
(8,'h'),
(9,'i'),
(10,'j');
CREATE TABLE `b` (
`k` INT NOT NULL AUTO_INCREMENT,
`k1` INT NOT NULL,
`k2` VARCHAR(45) NULL,
PRIMARY KEY (`k`));
insert into b(k1,k2)
values(1,'1-1'),
(1,'1-2'),
(2,'2'),
(3,'3'),
(4,'4'),
(5,'5'),
(100,'100');
select t.f1,t.f2,t.k2,t.rank
from (
select a.f1,a.f2,b.k1,b.k2
,case when @cur=a.f1 then @rank:=@rank else @rank:=@rank+1 end as rank
,@cur:=a.f1 as lst
from a inner join b on a.f1=b.k1
,(select @cur:=0,@rank:=0) as c
order by f1 asc
) as t
where t.rank between 1 and 3;
```
2. What did you expect to see?
```
get correct return:
------------------
f1 f2 k2 rank
1 a 1-1 1
1 a 1-2 1
2 b 2 2
3 d 3 3
```
3. What did you see instead?
```
get wrong return:
------------------
f1 f2 k2 rank
1 a 1-1 21
1 a 1-2 21
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
Release Version: v2.0.0
Git Commit Hash: 637e130e6a9ba2e54e158131c0466233db39a60e
Git Branch: release-2.0
UTC Build Time: 2018-04-27 11:43:00
GoVersion: go version go1.10 linux/amd64
TiKV Min Version: 2.0.0-rc.4.1
```",True,"get wrong query result when use self-define rank - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```
create table a (f1 int ,f2 varchar(32) ,primary key (f1));
insert into a(f1,f2)
values(1,'a'),
(2,'b'),
(3,'d'),
(4,'d'),
(5,'e'),
(6,'f'),
(7,'g'),
(8,'h'),
(9,'i'),
(10,'j');
CREATE TABLE `b` (
`k` INT NOT NULL AUTO_INCREMENT,
`k1` INT NOT NULL,
`k2` VARCHAR(45) NULL,
PRIMARY KEY (`k`));
insert into b(k1,k2)
values(1,'1-1'),
(1,'1-2'),
(2,'2'),
(3,'3'),
(4,'4'),
(5,'5'),
(100,'100');
select t.f1,t.f2,t.k2,t.rank
from (
select a.f1,a.f2,b.k1,b.k2
,case when @cur=a.f1 then @rank:=@rank else @rank:=@rank+1 end as rank
,@cur:=a.f1 as lst
from a inner join b on a.f1=b.k1
,(select @cur:=0,@rank:=0) as c
order by f1 asc
) as t
where t.rank between 1 and 3;
```
2. What did you expect to see?
```
get correct return:
------------------
f1 f2 k2 rank
1 a 1-1 1
1 a 1-2 1
2 b 2 2
3 d 3 3
```
3. What did you see instead?
```
get wrong return:
------------------
f1 f2 k2 rank
1 a 1-1 21
1 a 1-2 21
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
Release Version: v2.0.0
Git Commit Hash: 637e130e6a9ba2e54e158131c0466233db39a60e
Git Branch: release-2.0
UTC Build Time: 2018-04-27 11:43:00
GoVersion: go version go1.10 linux/amd64
TiKV Min Version: 2.0.0-rc.4.1
```",1,get wrong query result when use self define rank please answer these questions before submitting your issue thanks what did you do create table a int varchar primary key insert into a values a b d d e f g h i j create table b k int not null auto increment int not null varchar null primary key k insert into b values select t t t t rank from select a a b b case when cur a then rank rank else rank rank end as rank cur a as lst from a inner join b on a b select cur rank as c order by asc as t where t rank between and what did you expect to see get correct return rank a a b d what did you see instead get wrong return rank a a what version of tidb are you using tidb server v or run select tidb version on tidb release version git commit hash git branch release utc build time goversion go version linux tikv min version rc ,1
3646,6527700015.0,IssuesEvent,2017-08-30 02:34:52,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,FieldType.CompactStr() Not Escaped,bug compatibility for-new-contributors help wanted,"```sql
create table test_table (col set('a\nb'));
```
MySQL:
```
mysql> show create table test_table;
Field 1: `Table`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: VAR_STRING
Collation: utf8_general_ci (33)
Length: 192
Max_length: 10
Decimals: 31
Flags: NOT_NULL
Field 2: `Create Table`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: VAR_STRING
Collation: utf8_general_ci (33)
Length: 3072
Max_length: 97
Decimals: 31
Flags: NOT_NULL
+------------+---------------------------------------------------------------------------------------------------+
| Table | Create Table |
+------------+---------------------------------------------------------------------------------------------------+
| test_table | CREATE TABLE `test_table` (
`col` set('a\nb') DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 |
+------------+---------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
TiDB:
```
mysql> show create table test_table;
Field 1: `Table`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: VAR_STRING
Collation: utf8_general_ci (33)
Length: 256
Max_length: 10
Decimals: 0
Flags:
Field 2: `Create Table`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: VAR_STRING
Collation: utf8_general_ci (33)
Length: 256
Max_length: 113
Decimals: 0
Flags:
+------------+-------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+------------+-------------------------------------------------------------------------------------------------------------------+
| test_table | CREATE TABLE `test_table` (
`col` set('a
b') DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin |
+------------+-------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
Similar issue: https://github.com/pingcap/tidb/issues/4074
We need to implement escaping function somewhere, maybe in utils.",True,"FieldType.CompactStr() Not Escaped - ```sql
create table test_table (col set('a\nb'));
```
MySQL:
```
mysql> show create table test_table;
Field 1: `Table`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: VAR_STRING
Collation: utf8_general_ci (33)
Length: 192
Max_length: 10
Decimals: 31
Flags: NOT_NULL
Field 2: `Create Table`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: VAR_STRING
Collation: utf8_general_ci (33)
Length: 3072
Max_length: 97
Decimals: 31
Flags: NOT_NULL
+------------+---------------------------------------------------------------------------------------------------+
| Table | Create Table |
+------------+---------------------------------------------------------------------------------------------------+
| test_table | CREATE TABLE `test_table` (
`col` set('a\nb') DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 |
+------------+---------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
TiDB:
```
mysql> show create table test_table;
Field 1: `Table`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: VAR_STRING
Collation: utf8_general_ci (33)
Length: 256
Max_length: 10
Decimals: 0
Flags:
Field 2: `Create Table`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: VAR_STRING
Collation: utf8_general_ci (33)
Length: 256
Max_length: 113
Decimals: 0
Flags:
+------------+-------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+------------+-------------------------------------------------------------------------------------------------------------------+
| test_table | CREATE TABLE `test_table` (
`col` set('a
b') DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin |
+------------+-------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
Similar issue: https://github.com/pingcap/tidb/issues/4074
We need to implement escaping function somewhere, maybe in utils.",1,fieldtype compactstr not escaped sql create table test table col set a nb mysql mysql show create table test table field table catalog def database table org table type var string collation general ci length max length decimals flags not null field create table catalog def database table org table type var string collation general ci length max length decimals flags not null table create table test table create table test table col set a nb default null engine innodb default charset row in set sec tidb mysql show create table test table field table catalog def database table org table type var string collation general ci length max length decimals flags field create table catalog def database table org table type var string collation general ci length max length decimals flags table create table test table create table test table col set a b default null engine innodb default charset collate bin row in set sec similar issue we need to implement escaping function somewhere maybe in utils ,1
12240,14448942427.0,IssuesEvent,2020-12-08 07:13:59,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Parsing `datetime` when insert is not compatible with MySQL,good-first-issue severity/major status/help-wanted type/bug type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
create table t1 (t datetime) ENGINE=InnoDB;
insert ignore into t1 values (20030100000000),(20030000000000);
select * from t1;
```
2. What did you expect to see?
In Mysql
```
mysql> create table t1 (t datetime) ENGINE=InnoDB;
Query OK, 0 rows affected (0.02 sec)
mysql> insert ignore into t1 values (20030100000000),(20030000000000);
Query OK, 2 rows affected, 2 warnings (0.01 sec)
Records: 2 Duplicates: 0 Warnings: 2
mysql> select * from t1;
+---------------------+
| t |
+---------------------+
| 0000-00-00 00:00:00 |
| 0000-00-00 00:00:00 |
+---------------------+
2 rows in set (0.00 sec)
```
3. What did you see instead?
In TiDB
```
mysql> create table t1 (t datetime) ENGINE=InnoDB;
Query OK, 0 rows affected (0.01 sec)
mysql> insert ignore into t1 values (20030100000000),(20030000000000);
Query OK, 2 rows affected (0.01 sec)
Records: 2 Duplicates: 0 Warnings: 0
mysql> select * from t1;
+---------------------+
| t |
+---------------------+
| 2003-01-00 00:00:00 |
| 2003-00-00 00:00:00 |
+---------------------+
2 rows in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
+---------------------+
| t |
+---------------------+
| 2003-01-00 00:00:00 |
| 2003-00-00 00:00:00 |
+---------------------+
2 rows in set (0.00 sec)
mysql> select tidb_version();
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v3.0.0-beta-227-g06183393e-dirty
Git Commit Hash: 06183393ed536aa248248b72d4bf9f5010947f66
Git Branch: master
UTC Build Time: 2019-03-15 08:22:53
GoVersion: go version go1.12 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.01 sec)
```
",True,"Parsing `datetime` when insert is not compatible with MySQL - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
create table t1 (t datetime) ENGINE=InnoDB;
insert ignore into t1 values (20030100000000),(20030000000000);
select * from t1;
```
2. What did you expect to see?
In Mysql
```
mysql> create table t1 (t datetime) ENGINE=InnoDB;
Query OK, 0 rows affected (0.02 sec)
mysql> insert ignore into t1 values (20030100000000),(20030000000000);
Query OK, 2 rows affected, 2 warnings (0.01 sec)
Records: 2 Duplicates: 0 Warnings: 2
mysql> select * from t1;
+---------------------+
| t |
+---------------------+
| 0000-00-00 00:00:00 |
| 0000-00-00 00:00:00 |
+---------------------+
2 rows in set (0.00 sec)
```
3. What did you see instead?
In TiDB
```
mysql> create table t1 (t datetime) ENGINE=InnoDB;
Query OK, 0 rows affected (0.01 sec)
mysql> insert ignore into t1 values (20030100000000),(20030000000000);
Query OK, 2 rows affected (0.01 sec)
Records: 2 Duplicates: 0 Warnings: 0
mysql> select * from t1;
+---------------------+
| t |
+---------------------+
| 2003-01-00 00:00:00 |
| 2003-00-00 00:00:00 |
+---------------------+
2 rows in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
+---------------------+
| t |
+---------------------+
| 2003-01-00 00:00:00 |
| 2003-00-00 00:00:00 |
+---------------------+
2 rows in set (0.00 sec)
mysql> select tidb_version();
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v3.0.0-beta-227-g06183393e-dirty
Git Commit Hash: 06183393ed536aa248248b72d4bf9f5010947f66
Git Branch: master
UTC Build Time: 2019-03-15 08:22:53
GoVersion: go version go1.12 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.01 sec)
```
",1,parsing datetime when insert is not compatible with mysql bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error create table t datetime engine innodb insert ignore into values select from what did you expect to see in mysql mysql create table t datetime engine innodb query ok rows affected sec mysql insert ignore into values query ok rows affected warnings sec records duplicates warnings mysql select from t rows in set sec what did you see instead in tidb mysql create table t datetime engine innodb query ok rows affected sec mysql insert ignore into values query ok rows affected sec records duplicates warnings mysql select from t rows in set sec what version of tidb are you using tidb server v or run select tidb version on tidb t rows in set sec mysql select tidb version tidb version release version beta dirty git commit hash git branch master utc build time goversion go version darwin race enabled false tikv min version alpha check table before drop false row in set sec ,1
12188,14381020870.0,IssuesEvent,2020-12-02 04:18:50,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,P1-[4.0 bug hunting]-[SQL Plan Management]-NATURAL LEFT JOIN results in incorrect result for <=> operator,component/expression severity/major sig/execution type/bug type/compatibility,"Bug Hunter issue tidb-challenge-program/bug-hunting-issue#5
---
Consider the following statements:
```sql
CREATE TABLE t0(c0 INT);
CREATE TABLE t1(c0 INT);
INSERT INTO t0 VALUES (0);
INSERT INTO t1 VALUES (0);
SELECT * FROM t1 NATURAL LEFT JOIN t0 WHERE NOT(t0.c0<=>t1.c0); -- expected: {}, actual: {0}
```
Unexpectedly, the `SELECT` fetches a row:
```
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1452
Server version: 5.7.25-TiDB-v4.0.0-beta.2-231-gc66320c46 TiDB Server (Apache License 2.0), MySQL 5.7 compatible
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> CREATE TABLE t0(c0 INT);
Query OK, 0 rows affected (0.01 sec)
mysql> CREATE TABLE t1(c0 INT);
Query OK, 0 rows affected (0.00 sec)
mysql> INSERT INTO t0 VALUES (0);
Query OK, 1 row affected (0.00 sec)
mysql> INSERT INTO t1 VALUES (0);
Query OK, 1 row affected (0.00 sec)
mysql> SELECT * FROM t1 NATURAL LEFT JOIN t0 WHERE NOT(t0.c0<=>t1.c0); -- expected: {}, actual: {0}
+------+
| c0 |
+------+
| 0 |
+------+
1 row in set (0.00 sec)
```
Interestingly, the following query with the negated predicate also fetches a row, which is expected:
```sql
SELECT t1.c0 FROM t1 NATURAL LEFT JOIN t0 WHERE t0.c0<=>t1.c0 -- {0}
```
I double-checked with MySQL 8.0.19, which does not fetch a row for the first query, as expected:
```
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 14
Server version: 8.0.19 MySQL Community Server - GPL
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> CREATE TABLE t0(c0 INT);
Query OK, 0 rows affected (0.04 sec)
mysql> CREATE TABLE t1(c0 INT);
Query OK, 0 rows affected (0.04 sec)
mysql> INSERT INTO t0 VALUES (0);
Query OK, 1 row affected (0.01 sec)
mysql> INSERT INTO t1 VALUES (0);
Query OK, 1 row affected (0.01 sec)
mysql> SELECT * FROM t1 NATURAL LEFT JOIN t0 WHERE NOT(t0.c0<=>t1.c0); -- expected: {}, actual: {0}
Empty set (0.00 sec)
```
Environment:
```
| Release Version: v4.0.0-beta.2-231-gc66320c46
Git Commit Hash: c66320c46456c0d5b23b3b0403be6b9f8227d6d8
Git Branch: master
UTC Build Time: 2020-04-14 11:12:29
GoVersion: go1.13.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
```
I propose P0 as a bug level, since it matches the following description: `wrong results returned by the query, and inconsistent results returned by the SQL output`.",True,"P1-[4.0 bug hunting]-[SQL Plan Management]-NATURAL LEFT JOIN results in incorrect result for <=> operator - Bug Hunter issue tidb-challenge-program/bug-hunting-issue#5
---
Consider the following statements:
```sql
CREATE TABLE t0(c0 INT);
CREATE TABLE t1(c0 INT);
INSERT INTO t0 VALUES (0);
INSERT INTO t1 VALUES (0);
SELECT * FROM t1 NATURAL LEFT JOIN t0 WHERE NOT(t0.c0<=>t1.c0); -- expected: {}, actual: {0}
```
Unexpectedly, the `SELECT` fetches a row:
```
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1452
Server version: 5.7.25-TiDB-v4.0.0-beta.2-231-gc66320c46 TiDB Server (Apache License 2.0), MySQL 5.7 compatible
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> CREATE TABLE t0(c0 INT);
Query OK, 0 rows affected (0.01 sec)
mysql> CREATE TABLE t1(c0 INT);
Query OK, 0 rows affected (0.00 sec)
mysql> INSERT INTO t0 VALUES (0);
Query OK, 1 row affected (0.00 sec)
mysql> INSERT INTO t1 VALUES (0);
Query OK, 1 row affected (0.00 sec)
mysql> SELECT * FROM t1 NATURAL LEFT JOIN t0 WHERE NOT(t0.c0<=>t1.c0); -- expected: {}, actual: {0}
+------+
| c0 |
+------+
| 0 |
+------+
1 row in set (0.00 sec)
```
Interestingly, the following query with the negated predicate also fetches a row, which is expected:
```sql
SELECT t1.c0 FROM t1 NATURAL LEFT JOIN t0 WHERE t0.c0<=>t1.c0 -- {0}
```
I double-checked with MySQL 8.0.19, which does not fetch a row for the first query, as expected:
```
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 14
Server version: 8.0.19 MySQL Community Server - GPL
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> CREATE TABLE t0(c0 INT);
Query OK, 0 rows affected (0.04 sec)
mysql> CREATE TABLE t1(c0 INT);
Query OK, 0 rows affected (0.04 sec)
mysql> INSERT INTO t0 VALUES (0);
Query OK, 1 row affected (0.01 sec)
mysql> INSERT INTO t1 VALUES (0);
Query OK, 1 row affected (0.01 sec)
mysql> SELECT * FROM t1 NATURAL LEFT JOIN t0 WHERE NOT(t0.c0<=>t1.c0); -- expected: {}, actual: {0}
Empty set (0.00 sec)
```
Environment:
```
| Release Version: v4.0.0-beta.2-231-gc66320c46
Git Commit Hash: c66320c46456c0d5b23b3b0403be6b9f8227d6d8
Git Branch: master
UTC Build Time: 2020-04-14 11:12:29
GoVersion: go1.13.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
```
I propose P0 as a bug level, since it matches the following description: `wrong results returned by the query, and inconsistent results returned by the SQL output`.",1, natural left join results in incorrect result for operator bug hunter issue tidb challenge program bug hunting issue consider the following statements sql create table int create table int insert into values insert into values select from natural left join where not expected actual unexpectedly the select fetches a row welcome to the mysql monitor commands end with or g your mysql connection id is server version tidb beta tidb server apache license mysql compatible copyright c oracle and or its affiliates all rights reserved oracle is a registered trademark of oracle corporation and or its affiliates other names may be trademarks of their respective owners type help or h for help type c to clear the current input statement mysql create table int query ok rows affected sec mysql create table int query ok rows affected sec mysql insert into values query ok row affected sec mysql insert into values query ok row affected sec mysql select from natural left join where not expected actual row in set sec interestingly the following query with the negated predicate also fetches a row which is expected sql select from natural left join where i double checked with mysql which does not fetch a row for the first query as expected welcome to the mysql monitor commands end with or g your mysql connection id is server version mysql community server gpl copyright c oracle and or its affiliates all rights reserved oracle is a registered trademark of oracle corporation and or its affiliates other names may be trademarks of their respective owners type help or h for help type c to clear the current input statement mysql create table int query ok rows affected sec mysql create table int query ok rows affected sec mysql insert into values query ok row affected sec mysql insert into values query ok row affected sec mysql select from natural left join where not expected actual empty set sec environment release version beta git commit hash git branch master utc build time goversion race enabled false tikv min version check table before drop false i propose as a bug level since it matches the following description wrong results returned by the query and inconsistent results returned by the sql output ,1
11930,14060443330.0,IssuesEvent,2020-11-03 06:01:32,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Behavior on VARCHAR data type of comparison operator '=' is different from mysql,challenge-program severity/major sig/planner status/help-wanted type/bug type/compatibility type/duplicate,"## Description
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
create table t (a char(10), b varchar(10), c binary(10), d varbinary(10));
insert into t values ('text ','text ','text ','text '); <-----there're trailing spaces
mysql> desc t;
+-------+---------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------------+------+-----+---------+-------+
| a | char(10) | YES | | NULL | |
| b | varchar(10) | YES | | NULL | |
| c | binary(10) | YES | | NULL | |
| d | varbinary(10) | YES | | NULL | |
+-------+---------------+------+-----+---------+-------+
4 rows in set (0.00 sec)
mysql> select * from t;
+------+--------+------------+--------+
| a | b | c | d |
+------+--------+------------+--------+
| text | text | text | text |
+------+--------+------------+--------+
1 row in set (0.00 sec)
```
2. What did you expect to see?
MySQL
```
mysql> select * from t where a = 'text';
+------+--------+------------+--------+
| a | b | c | d |
+------+--------+------------+--------+
| text | text | text | text |
+------+--------+------------+--------+
1 row in set (0.00 sec)
mysql> select * from t where b = 'text';
+------+--------+------------+--------+
| a | b | c | d |
+------+--------+------------+--------+
| text | text | text | text |
+------+--------+------------+--------+
1 row in set (0.00 sec)
mysql> select * from t where c = 'text';
Empty set (0.00 sec)
mysql> select * from t where d = 'text';
Empty set (0.00 sec)
```
3. What did you see instead?
TiDB treats CHAR and VARCHAR in different ways, so I guess operator '=' is not designed to strictly compare the trailing spaces.
```
MySQL [gin]> select * from t where a='text';
+------+--------+------------+--------+
| a | b | c | d |
+------+--------+------------+--------+
| text | text | text | text |
+------+--------+------------+--------+
1 row in set (0.00 sec)
MySQL [gin]> select * from t where b='text';
Empty set (0.00 sec)
MySQL [gin]> select * from t where c='text';
Empty set (0.01 sec)
MySQL [gin]> select * from t where d='text';
Empty set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V`)?
Git Commit Hash: 365e4ab491b683a69c2004f30b1ae4f86256e2ad
Git Commit Branch: master
UTC Build Time: 2017-08-16 01:24:27
## SIG slack channel
[#sig-planner](https://slack.tidb.io/invite?team=tidb-community&channel=sig-planner&ref=high-performance)
## Score
- 900
## Mentor
* @lzmhhh123
",True,"Behavior on VARCHAR data type of comparison operator '=' is different from mysql - ## Description
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
create table t (a char(10), b varchar(10), c binary(10), d varbinary(10));
insert into t values ('text ','text ','text ','text '); <-----there're trailing spaces
mysql> desc t;
+-------+---------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------------+------+-----+---------+-------+
| a | char(10) | YES | | NULL | |
| b | varchar(10) | YES | | NULL | |
| c | binary(10) | YES | | NULL | |
| d | varbinary(10) | YES | | NULL | |
+-------+---------------+------+-----+---------+-------+
4 rows in set (0.00 sec)
mysql> select * from t;
+------+--------+------------+--------+
| a | b | c | d |
+------+--------+------------+--------+
| text | text | text | text |
+------+--------+------------+--------+
1 row in set (0.00 sec)
```
2. What did you expect to see?
MySQL
```
mysql> select * from t where a = 'text';
+------+--------+------------+--------+
| a | b | c | d |
+------+--------+------------+--------+
| text | text | text | text |
+------+--------+------------+--------+
1 row in set (0.00 sec)
mysql> select * from t where b = 'text';
+------+--------+------------+--------+
| a | b | c | d |
+------+--------+------------+--------+
| text | text | text | text |
+------+--------+------------+--------+
1 row in set (0.00 sec)
mysql> select * from t where c = 'text';
Empty set (0.00 sec)
mysql> select * from t where d = 'text';
Empty set (0.00 sec)
```
3. What did you see instead?
TiDB treats CHAR and VARCHAR in different ways, so I guess operator '=' is not designed to strictly compare the trailing spaces.
```
MySQL [gin]> select * from t where a='text';
+------+--------+------------+--------+
| a | b | c | d |
+------+--------+------------+--------+
| text | text | text | text |
+------+--------+------------+--------+
1 row in set (0.00 sec)
MySQL [gin]> select * from t where b='text';
Empty set (0.00 sec)
MySQL [gin]> select * from t where c='text';
Empty set (0.01 sec)
MySQL [gin]> select * from t where d='text';
Empty set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V`)?
Git Commit Hash: 365e4ab491b683a69c2004f30b1ae4f86256e2ad
Git Commit Branch: master
UTC Build Time: 2017-08-16 01:24:27
## SIG slack channel
[#sig-planner](https://slack.tidb.io/invite?team=tidb-community&channel=sig-planner&ref=high-performance)
## Score
- 900
## Mentor
* @lzmhhh123
",1,behavior on varchar data type of comparison operator is different from mysql description please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error create table t a char b varchar c binary d varbinary insert into t values text text text text there re trailing spaces mysql desc t field type null key default extra a char yes null b varchar yes null c binary yes null d varbinary yes null rows in set sec mysql select from t a b c d text text text text row in set sec what did you expect to see mysql mysql select from t where a text a b c d text text text text row in set sec mysql select from t where b text a b c d text text text text row in set sec mysql select from t where c text empty set sec mysql select from t where d text empty set sec what did you see instead tidb treats char and varchar in different ways so i guess operator is not designed to strictly compare the trailing spaces mysql select from t where a text a b c d text text text text row in set sec mysql select from t where b text empty set sec mysql select from t where c text empty set sec mysql select from t where d text empty set sec what version of tidb are you using tidb server v git commit hash git commit branch master utc build time sig slack channel score mentor ,1
14785,18170221258.0,IssuesEvent,2021-09-27 19:04:32,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,Sysvar `identity` returns wrong value,type/bug help wanted type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
Manual code inspection. See: https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_identity -- the identity sysvar is an alias for `last_insert_id`
### 2. What did you expect to see? (Required)
There should be a `GetSession()` func for Identity that does the same thing. Instead it is a noop and does nothing:
https://github.com/pingcap/tidb/blob/74b329402dac67da23a142e04f013d3355e4b6f3/sessionctx/variable/noop.go#L488
See: https://github.com/pingcap/tidb/pull/28072 for where this was implemented for `last_insert_id`.
### 3. What did you see instead (Required)
Noop
### 4. What is your TiDB version? (Required)
master
",True,"Sysvar `identity` returns wrong value - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
Manual code inspection. See: https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_identity -- the identity sysvar is an alias for `last_insert_id`
### 2. What did you expect to see? (Required)
There should be a `GetSession()` func for Identity that does the same thing. Instead it is a noop and does nothing:
https://github.com/pingcap/tidb/blob/74b329402dac67da23a142e04f013d3355e4b6f3/sessionctx/variable/noop.go#L488
See: https://github.com/pingcap/tidb/pull/28072 for where this was implemented for `last_insert_id`.
### 3. What did you see instead (Required)
Noop
### 4. What is your TiDB version? (Required)
master
",1,sysvar identity returns wrong value bug report please answer these questions before submitting your issue thanks minimal reproduce step required manual code inspection see the identity sysvar is an alias for last insert id what did you expect to see required there should be a getsession func for identity that does the same thing instead it is a noop and does nothing see for where this was implemented for last insert id what did you see instead required noop what is your tidb version required master ,1
9941,11946608578.0,IssuesEvent,2020-04-03 08:26:39,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Support explain on replace/insert statement,type/compatibility type/new-feature,"## Feature Request
**Is your feature request related to a problem? Please describe:**
`explain` for `insert` or `replace` statement returns `ERROR 1105 (HY000): Unsupported type *core.Insert` now
**Describe the feature you'd like:**
we can get right `execute plan` for `insert` and `replace` statement.
**Describe alternatives you've considered:**
I don't know whether run explain on `insert` or `replace` is a little weird, it seems `insert` has no query plan?
",True,"Support explain on replace/insert statement - ## Feature Request
**Is your feature request related to a problem? Please describe:**
`explain` for `insert` or `replace` statement returns `ERROR 1105 (HY000): Unsupported type *core.Insert` now
**Describe the feature you'd like:**
we can get right `execute plan` for `insert` and `replace` statement.
**Describe alternatives you've considered:**
I don't know whether run explain on `insert` or `replace` is a little weird, it seems `insert` has no query plan?
",1,support explain on replace insert statement feature request is your feature request related to a problem please describe explain for insert or replace statement returns error unsupported type core insert now describe the feature you d like we can get right execute plan for insert and replace statement describe alternatives you ve considered i don t know whether run explain on insert or replace is a little weird it seems insert has no query plan ,1
8680,10606147953.0,IssuesEvent,2019-10-10 22:19:36,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,tidb gives error while mysql gives warning when time is invalid,help wanted type/compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
CREATE TABLE t1 (
a INT,
ts TIMESTAMP DEFAULT NOW(),
PRIMARY KEY (ts)
);
SELECT * FROM t1 WHERE ts = '2008-12-31 23:59:60';
```
2. What did you expect to see?
mysql:
```
mysql> SELECT * FROM t1 WHERE ts = '2008-12-31 23:59:60';
Empty set, 2 warnings (0.00 sec)
mysql> show warnings;
+---------+------+--------------------------------------------------------------------------+
| Level | Code | Message |
+---------+------+--------------------------------------------------------------------------+
| Warning | 1292 | Incorrect datetime value: '2008-12-31 23:59:60' for column 'ts' at row 1 |
| Warning | 1292 | Incorrect datetime value: '2008-12-31 23:59:60' for column 'ts' at row 1 |
+---------+------+--------------------------------------------------------------------------+
2 rows in set (0.00 sec)
```
3. What did you see instead?
tidb:
```
mysql> SELECT * FROM t1 WHERE ts = '2008-12-31 23:59:60';
ERROR 1292 (22007): invalid time format: '60'
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
Release Version: v2.0.3
Git Commit Hash: e4878329f0c69d7b810b8b40fb3b8071c69b5e02
Git Commit Branch: HEAD
UTC Build Time: 2018-06-29 11:43:51
GoVersion: go version go1.10.3 darwin/amd64
TiKV Min Version: 2.0.0-rc.4.1
```",True,"tidb gives error while mysql gives warning when time is invalid - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
CREATE TABLE t1 (
a INT,
ts TIMESTAMP DEFAULT NOW(),
PRIMARY KEY (ts)
);
SELECT * FROM t1 WHERE ts = '2008-12-31 23:59:60';
```
2. What did you expect to see?
mysql:
```
mysql> SELECT * FROM t1 WHERE ts = '2008-12-31 23:59:60';
Empty set, 2 warnings (0.00 sec)
mysql> show warnings;
+---------+------+--------------------------------------------------------------------------+
| Level | Code | Message |
+---------+------+--------------------------------------------------------------------------+
| Warning | 1292 | Incorrect datetime value: '2008-12-31 23:59:60' for column 'ts' at row 1 |
| Warning | 1292 | Incorrect datetime value: '2008-12-31 23:59:60' for column 'ts' at row 1 |
+---------+------+--------------------------------------------------------------------------+
2 rows in set (0.00 sec)
```
3. What did you see instead?
tidb:
```
mysql> SELECT * FROM t1 WHERE ts = '2008-12-31 23:59:60';
ERROR 1292 (22007): invalid time format: '60'
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
Release Version: v2.0.3
Git Commit Hash: e4878329f0c69d7b810b8b40fb3b8071c69b5e02
Git Commit Branch: HEAD
UTC Build Time: 2018-06-29 11:43:51
GoVersion: go version go1.10.3 darwin/amd64
TiKV Min Version: 2.0.0-rc.4.1
```",1,tidb gives error while mysql gives warning when time is invalid please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error sql create table a int ts timestamp default now primary key ts select from where ts what did you expect to see mysql mysql select from where ts empty set warnings sec mysql show warnings level code message warning incorrect datetime value for column ts at row warning incorrect datetime value for column ts at row rows in set sec what did you see instead tidb mysql select from where ts error invalid time format what version of tidb are you using tidb server v or run select tidb version on tidb release version git commit hash git commit branch head utc build time goversion go version darwin tikv min version rc ,1
3854,6712451399.0,IssuesEvent,2017-10-13 09:25:24,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,sql_mode `high_not_precedence` is not supported.,compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
create table t1 (a int);
insert into t1 values (0),(1),(NULL);
set sql_mode='high_not_precedence';
select * from t1 where not a between 2 and 3;
```
2. What did you expect to see?
```
a
0
1
```
3. What did you see instead?
empty result set.
4. What version of TiDB are you using (`tidb-server -V`)?
Release Version: 0.9.0
Git Commit Hash: 95a6e1e720824ae739f4478e46912daadd783820
Git Commit Branch: master
UTC Build Time: 2017-10-13 08:00:59
",True,"sql_mode `high_not_precedence` is not supported. - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
create table t1 (a int);
insert into t1 values (0),(1),(NULL);
set sql_mode='high_not_precedence';
select * from t1 where not a between 2 and 3;
```
2. What did you expect to see?
```
a
0
1
```
3. What did you see instead?
empty result set.
4. What version of TiDB are you using (`tidb-server -V`)?
Release Version: 0.9.0
Git Commit Hash: 95a6e1e720824ae739f4478e46912daadd783820
Git Commit Branch: master
UTC Build Time: 2017-10-13 08:00:59
",1,sql mode high not precedence is not supported please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error create table a int insert into values null set sql mode high not precedence select from where not a between and what did you expect to see a what did you see instead empty result set what version of tidb are you using tidb server v release version git commit hash git commit branch master utc build time ,1
11010,13046793697.0,IssuesEvent,2020-07-29 09:35:10,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,SHOW CREATE TABLE should show added foreign keys,type/compatibility,"## Bug Report
See #8303: I do not know how to create a proper Entity-Relationship diagram with TiDB due to this issue.
Additionally, it may not be possible to retrieve the name of an added foreign key (needed for dropping it).
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
Created a table, then as a separate step added foreign keys, then ran `SHOW CREATE `.
2. What did you expect to see?
Foreign keys among the output.
3. What did you see instead?
No foreign keys.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
pingcap/tidb:v2.1.0-rc.4",True,"SHOW CREATE TABLE should show added foreign keys - ## Bug Report
See #8303: I do not know how to create a proper Entity-Relationship diagram with TiDB due to this issue.
Additionally, it may not be possible to retrieve the name of an added foreign key (needed for dropping it).
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
Created a table, then as a separate step added foreign keys, then ran `SHOW CREATE `.
2. What did you expect to see?
Foreign keys among the output.
3. What did you see instead?
No foreign keys.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
pingcap/tidb:v2.1.0-rc.4",1,show create table should show added foreign keys bug report see i do not know how to create a proper entity relationship diagram with tidb due to this issue additionally it may not be possible to retrieve the name of an added foreign key needed for dropping it please answer these questions before submitting your issue thanks what did you do created a table then as a separate step added foreign keys then ran show create what did you expect to see foreign keys among the output what did you see instead no foreign keys what version of tidb are you using tidb server v or run select tidb version on tidb pingcap tidb rc ,1
7270,9536898762.0,IssuesEvent,2019-04-30 10:59:38,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,JSON_CONTAIN is not same with mysql.,help wanted type/bug type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```SQL
drop table if exists jemp;
CREATE TABLE jemp (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`category` JSON,
`tags` JSON,
PRIMARY KEY (`id`)
);
INSERT INTO `jemp` (category, tags) VALUES ('{""id"": 1, ""name"": ""TiDB""}', '[1, 2, 3]');
INSERT INTO `jemp` (category, tags) VALUES (JSON_OBJECT(""id"", 2, ""name"", ""pingcap.com""), JSON_ARRAY(1, 3, 5));
SELECT * FROM jemp WHERE JSON_CONTAINS(category, 1, '$.id');
```
2. What did you expect to see?
## In MySQL
```SQL
mysql> drop table if exists jemp;
Query OK, 0 rows affected (0.01 sec)
mysql> CREATE TABLE jemp (
-> `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
-> `category` JSON,
-> `tags` JSON,
-> PRIMARY KEY (`id`)
-> );
Query OK, 0 rows affected (0.03 sec)
mysql> INSERT INTO `jemp` (category, tags) VALUES ('{""id"": 1, ""name"": ""TiDB""}', '[1, 2, 3]');
Query OK, 1 row affected (0.01 sec)
mysql> INSERT INTO `jemp` (category, tags) VALUES (JSON_OBJECT(""id"", 2, ""name"", ""pingcap.com""), JSON_ARRAY(1, 3, 5));
Query OK, 1 row affected (0.00 sec)
mysql> SELECT * FROM jemp WHERE JSON_CONTAINS(category, 1, '$.id');
ERROR 3146 (22032): Invalid data type for JSON data in argument 2 to function json_contains; a JSON string or JSON type is required.
mysql> select version();
+-------------------------+
| version() |
+-------------------------+
| 5.7.25-0ubuntu0.18.04.2 |
+-------------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
## In TiDB
```SQL
mysql> drop table if exists jemp;
Query OK, 0 rows affected (0.03 sec)
mysql> CREATE TABLE jemp (
-> `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
-> `category` JSON,
-> `tags` JSON,
-> PRIMARY KEY (`id`)
-> );
Query OK, 0 rows affected (0.03 sec)
mysql> INSERT INTO `jemp` (category, tags) VALUES ('{""id"": 1, ""name"": ""TiDB""}', '[1, 2, 3]');
Query OK, 1 row affected (0.01 sec)
mysql> INSERT INTO `jemp` (category, tags) VALUES (JSON_OBJECT(""id"", 2, ""name"", ""pingcap.com""), JSON_ARRAY(1, 3, 5));
Query OK, 1 row affected (0.00 sec)
mysql> SELECT * FROM jemp WHERE JSON_CONTAINS(category, 1, '$.id');
+----+---------------------------+-----------+
| id | category | tags |
+----+---------------------------+-----------+
| 1 | {""id"": 1, ""name"": ""TiDB""} | [1, 2, 3] |
+----+---------------------------+-----------+
1 row in set (0.01 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v3.0.0-beta-295-g97f88f70d
Git Commit Hash: 97f88f70d56e69d6aef584b2bd4c9ada2ce26598
Git Branch: master
UTC Build Time: 2019-03-29 07:34:36
GoVersion: go version go1.12.1 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
1 row in set (0.00 sec)
```
",True,"JSON_CONTAIN is not same with mysql. - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```SQL
drop table if exists jemp;
CREATE TABLE jemp (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`category` JSON,
`tags` JSON,
PRIMARY KEY (`id`)
);
INSERT INTO `jemp` (category, tags) VALUES ('{""id"": 1, ""name"": ""TiDB""}', '[1, 2, 3]');
INSERT INTO `jemp` (category, tags) VALUES (JSON_OBJECT(""id"", 2, ""name"", ""pingcap.com""), JSON_ARRAY(1, 3, 5));
SELECT * FROM jemp WHERE JSON_CONTAINS(category, 1, '$.id');
```
2. What did you expect to see?
## In MySQL
```SQL
mysql> drop table if exists jemp;
Query OK, 0 rows affected (0.01 sec)
mysql> CREATE TABLE jemp (
-> `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
-> `category` JSON,
-> `tags` JSON,
-> PRIMARY KEY (`id`)
-> );
Query OK, 0 rows affected (0.03 sec)
mysql> INSERT INTO `jemp` (category, tags) VALUES ('{""id"": 1, ""name"": ""TiDB""}', '[1, 2, 3]');
Query OK, 1 row affected (0.01 sec)
mysql> INSERT INTO `jemp` (category, tags) VALUES (JSON_OBJECT(""id"", 2, ""name"", ""pingcap.com""), JSON_ARRAY(1, 3, 5));
Query OK, 1 row affected (0.00 sec)
mysql> SELECT * FROM jemp WHERE JSON_CONTAINS(category, 1, '$.id');
ERROR 3146 (22032): Invalid data type for JSON data in argument 2 to function json_contains; a JSON string or JSON type is required.
mysql> select version();
+-------------------------+
| version() |
+-------------------------+
| 5.7.25-0ubuntu0.18.04.2 |
+-------------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
## In TiDB
```SQL
mysql> drop table if exists jemp;
Query OK, 0 rows affected (0.03 sec)
mysql> CREATE TABLE jemp (
-> `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
-> `category` JSON,
-> `tags` JSON,
-> PRIMARY KEY (`id`)
-> );
Query OK, 0 rows affected (0.03 sec)
mysql> INSERT INTO `jemp` (category, tags) VALUES ('{""id"": 1, ""name"": ""TiDB""}', '[1, 2, 3]');
Query OK, 1 row affected (0.01 sec)
mysql> INSERT INTO `jemp` (category, tags) VALUES (JSON_OBJECT(""id"", 2, ""name"", ""pingcap.com""), JSON_ARRAY(1, 3, 5));
Query OK, 1 row affected (0.00 sec)
mysql> SELECT * FROM jemp WHERE JSON_CONTAINS(category, 1, '$.id');
+----+---------------------------+-----------+
| id | category | tags |
+----+---------------------------+-----------+
| 1 | {""id"": 1, ""name"": ""TiDB""} | [1, 2, 3] |
+----+---------------------------+-----------+
1 row in set (0.01 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v3.0.0-beta-295-g97f88f70d
Git Commit Hash: 97f88f70d56e69d6aef584b2bd4c9ada2ce26598
Git Branch: master
UTC Build Time: 2019-03-29 07:34:36
GoVersion: go version go1.12.1 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
1 row in set (0.00 sec)
```
",1,json contain is not same with mysql bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error sql drop table if exists jemp create table jemp id int unsigned not null auto increment category json tags json primary key id insert into jemp category tags values id name tidb insert into jemp category tags values json object id name pingcap com json array select from jemp where json contains category id what did you expect to see in mysql sql mysql drop table if exists jemp query ok rows affected sec mysql create table jemp id int unsigned not null auto increment category json tags json primary key id query ok rows affected sec mysql insert into jemp category tags values id name tidb query ok row affected sec mysql insert into jemp category tags values json object id name pingcap com json array query ok row affected sec mysql select from jemp where json contains category id error invalid data type for json data in argument to function json contains a json string or json type is required mysql select version version row in set sec what did you see instead in tidb sql mysql drop table if exists jemp query ok rows affected sec mysql create table jemp id int unsigned not null auto increment category json tags json primary key id query ok rows affected sec mysql insert into jemp category tags values id name tidb query ok row affected sec mysql insert into jemp category tags values json object id name pingcap com json array query ok row affected sec mysql select from jemp where json contains category id id category tags id name tidb row in set sec what version of tidb are you using tidb server v or run select tidb version on tidb mysql select tidb version g row tidb version release version beta git commit hash git branch master utc build time goversion go version linux race enabled false tikv min version alpha check table before drop false row in set sec ,1
3472,6447689761.0,IssuesEvent,2017-08-14 08:37:37,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Cannot authenticate users which username contains '@',compatibility,"MySQL:
```
mysql> create user 'test@example.com'@'localhost' identified by '';
Query OK, 0 rows affected (0.03 sec)
```
```
$ mysql -u 'test@example.com' --host 127.0.0.1
Welcome to the MySQL monitor. Commands end with ; or \g.
....
```
TiDB:
```
mysql> create user 'test@example.com'@'localhost' identified by '';
Query OK, 1 row affected (0.00 sec)
```
```
$ mysql -u 'test@example.com' --host 127.0.0.1 --port 4000
ERROR 1045 (28000): Access denied for user 'test@example.com'@'127.0.0.1' (using password: YES)
```",True,"Cannot authenticate users which username contains '@' - MySQL:
```
mysql> create user 'test@example.com'@'localhost' identified by '';
Query OK, 0 rows affected (0.03 sec)
```
```
$ mysql -u 'test@example.com' --host 127.0.0.1
Welcome to the MySQL monitor. Commands end with ; or \g.
....
```
TiDB:
```
mysql> create user 'test@example.com'@'localhost' identified by '';
Query OK, 1 row affected (0.00 sec)
```
```
$ mysql -u 'test@example.com' --host 127.0.0.1 --port 4000
ERROR 1045 (28000): Access denied for user 'test@example.com'@'127.0.0.1' (using password: YES)
```",1,cannot authenticate users which username contains mysql mysql create user test example com localhost identified by query ok rows affected sec mysql u test example com host welcome to the mysql monitor commands end with or g tidb mysql create user test example com localhost identified by query ok row affected sec mysql u test example com host port error access denied for user test example com using password yes ,1
6922,9213835266.0,IssuesEvent,2019-03-10 15:17:05,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Error message about `select ... inner join` is not same with MYSQL.,help wanted type/compatibility,"# Bug Report
Please answer these questions before submitting your issue. Thanks!
## 1. What did you do?
If possible, provide a recipe for reproducing the error.
### Scene 1
Execute `select person.id from person inner join person on person.id = person.id;` with no table;
### Scene 2
Execute `select person.id from person inner join person on person.id = person.id;` with table exist;
## 2. What did you expect to see?
### Scene 1
**In MYSQL**
```SQL
mysql> select person.id from person inner join person on person.id = person.id;
ERROR 1066 (42000): Not unique table/alias: 'person'
mysql>
mysql> select version();
+-------------------------+
| version() |
+-------------------------+
| 5.7.25-0ubuntu0.18.04.2 |
+-------------------------+
1 row in set (0.00 sec)
mysql>
```
### Scene 2
**In MYSQL**
```SQL
mysql> select version();
+-------------------------+
| version() |
+-------------------------+
| 5.7.25-0ubuntu0.18.04.2 |
+-------------------------+
1 row in set (0.00 sec)
mysql> create table person(id int(4));
Query OK, 0 rows affected (0.02 sec)
mysql> select person.id from person inner join person on person.id = person.id;
ERROR 1066 (42000): Not unique table/alias: 'person'
```
3. What did you see instead?
### Scene 1
**In TiDB**
```SQL
TiDB> select person.id from person inner join person on person.id = person.id;
ERROR 1146 (42S02): Table 'test.person' doesn't exist
```
### Scene 2
**In TiDB**
```SQL
TiDB> create table person(id int(4));
Query OK, 0 rows affected (0.01 sec)
TiDB> select person.id from person inner join person on person.id = person.id;
ERROR 1052 (23000): Column 'id' in field list is ambiguous
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```SQL
TiDB> select tidb_version()\G;
*************************** 1. row ***************************
tidb_version(): Release Version: v3.0.0-beta-155-g4ccc4c1bc-dirty
Git Commit Hash: 4ccc4c1bcb41e4dd958c7ae5eb23e905957e7433
Git Branch: master
UTC Build Time: 2019-03-06 07:11:01
GoVersion: go version go1.12 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
1 row in set (0.00 sec)
```",True,"Error message about `select ... inner join` is not same with MYSQL. - # Bug Report
Please answer these questions before submitting your issue. Thanks!
## 1. What did you do?
If possible, provide a recipe for reproducing the error.
### Scene 1
Execute `select person.id from person inner join person on person.id = person.id;` with no table;
### Scene 2
Execute `select person.id from person inner join person on person.id = person.id;` with table exist;
## 2. What did you expect to see?
### Scene 1
**In MYSQL**
```SQL
mysql> select person.id from person inner join person on person.id = person.id;
ERROR 1066 (42000): Not unique table/alias: 'person'
mysql>
mysql> select version();
+-------------------------+
| version() |
+-------------------------+
| 5.7.25-0ubuntu0.18.04.2 |
+-------------------------+
1 row in set (0.00 sec)
mysql>
```
### Scene 2
**In MYSQL**
```SQL
mysql> select version();
+-------------------------+
| version() |
+-------------------------+
| 5.7.25-0ubuntu0.18.04.2 |
+-------------------------+
1 row in set (0.00 sec)
mysql> create table person(id int(4));
Query OK, 0 rows affected (0.02 sec)
mysql> select person.id from person inner join person on person.id = person.id;
ERROR 1066 (42000): Not unique table/alias: 'person'
```
3. What did you see instead?
### Scene 1
**In TiDB**
```SQL
TiDB> select person.id from person inner join person on person.id = person.id;
ERROR 1146 (42S02): Table 'test.person' doesn't exist
```
### Scene 2
**In TiDB**
```SQL
TiDB> create table person(id int(4));
Query OK, 0 rows affected (0.01 sec)
TiDB> select person.id from person inner join person on person.id = person.id;
ERROR 1052 (23000): Column 'id' in field list is ambiguous
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```SQL
TiDB> select tidb_version()\G;
*************************** 1. row ***************************
tidb_version(): Release Version: v3.0.0-beta-155-g4ccc4c1bc-dirty
Git Commit Hash: 4ccc4c1bcb41e4dd958c7ae5eb23e905957e7433
Git Branch: master
UTC Build Time: 2019-03-06 07:11:01
GoVersion: go version go1.12 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
1 row in set (0.00 sec)
```",1,error message about select inner join is not same with mysql bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error scene execute select person id from person inner join person on person id person id with no table scene execute select person id from person inner join person on person id person id with table exist what did you expect to see scene in mysql sql mysql select person id from person inner join person on person id person id error not unique table alias person mysql mysql select version version row in set sec mysql scene in mysql sql mysql select version version row in set sec mysql create table person id int query ok rows affected sec mysql select person id from person inner join person on person id person id error not unique table alias person what did you see instead scene in tidb sql tidb select person id from person inner join person on person id person id error table test person doesn t exist scene in tidb sql tidb create table person id int query ok rows affected sec tidb select person id from person inner join person on person id person id error column id in field list is ambiguous what version of tidb are you using tidb server v or run select tidb version on tidb sql tidb select tidb version g row tidb version release version beta dirty git commit hash git branch master utc build time goversion go version linux race enabled false tikv min version alpha check table before drop false row in set sec ,1
11029,13065149148.0,IssuesEvent,2020-07-30 19:18:28,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Collate attribute of column can not be separated by other column attributes,type/compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
CREATE TABLE t1 (a enum ('Y', 'N') DEFAULT 'N' COLLATE utf8_bin);
```
2. What did you expect to see?
```
Query OK, 0 rows affected (0.02 sec)
```
3. What did you see instead?
```
ERROR 1105 (HY000): line 0 column 54 near "" utf8_bin)"" (total length 64)
```
4. What version of TiDB are you using (`tidb-server -V`)?
",True,"Collate attribute of column can not be separated by other column attributes - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
CREATE TABLE t1 (a enum ('Y', 'N') DEFAULT 'N' COLLATE utf8_bin);
```
2. What did you expect to see?
```
Query OK, 0 rows affected (0.02 sec)
```
3. What did you see instead?
```
ERROR 1105 (HY000): line 0 column 54 near "" utf8_bin)"" (total length 64)
```
4. What version of TiDB are you using (`tidb-server -V`)?
",1,collate attribute of column can not be separated by other column attributes please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error sql create table a enum y n default n collate bin what did you expect to see query ok rows affected sec what did you see instead error line column near bin total length what version of tidb are you using tidb server v ,1
7062,9345047350.0,IssuesEvent,2019-03-30 03:27:06,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Converting `decimal` to `datetime` or `timestamp` when insert is not compatible with MySQL,for new contributors help wanted type/bug type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
CREATE TABLE t1 (a DATETIME(6));
INSERT INTO t1 VALUES (20010101100000.1234567);
CREATE TABLE t2(a TIMESTAMP);
INSERT INTO t2 VALUES (20010101100000.1234567);
```
2. What did you expect to see?
In MySQL
```
mysql> CREATE TABLE t1 (a DATETIME(6));
Query OK, 0 rows affected (0.03 sec)
mysql> INSERT INTO t1 VALUES (20010101100000.1234567);
Query OK, 1 row affected (0.00 sec)
mysql> CREATE TABLE t2(a TIMESTAMP);
Query OK, 0 rows affected (0.01 sec)
mysql> INSERT INTO t2 VALUES (20010101100000.1234567);
Query OK, 1 row affected (0.00 sec)
```
3. What did you see instead?
In TiDB
```
mysql> CREATE TABLE t1 (a DATETIME(6));
Query OK, 0 rows affected (0.02 sec)
mysql> INSERT INTO t1 VALUES (20010101100000.1234567);
ERROR 1105 (HY000): cannot convert datum from decimal to type datetime.
mysql> CREATE TABLE t2(a TIMESTAMP);
Query OK, 0 rows affected (0.01 sec)
mysql> INSERT INTO t2 VALUES (20010101100000.1234567);
ERROR 1105 (HY000): cannot convert datum from decimal to type timestamp.
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v3.0.0-beta-227-g06183393e-dirty
Git Commit Hash: 06183393ed536aa248248b72d4bf9f5010947f66
Git Branch: master
UTC Build Time: 2019-03-15 08:22:53
GoVersion: go version go1.12 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
```
",True,"Converting `decimal` to `datetime` or `timestamp` when insert is not compatible with MySQL - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
CREATE TABLE t1 (a DATETIME(6));
INSERT INTO t1 VALUES (20010101100000.1234567);
CREATE TABLE t2(a TIMESTAMP);
INSERT INTO t2 VALUES (20010101100000.1234567);
```
2. What did you expect to see?
In MySQL
```
mysql> CREATE TABLE t1 (a DATETIME(6));
Query OK, 0 rows affected (0.03 sec)
mysql> INSERT INTO t1 VALUES (20010101100000.1234567);
Query OK, 1 row affected (0.00 sec)
mysql> CREATE TABLE t2(a TIMESTAMP);
Query OK, 0 rows affected (0.01 sec)
mysql> INSERT INTO t2 VALUES (20010101100000.1234567);
Query OK, 1 row affected (0.00 sec)
```
3. What did you see instead?
In TiDB
```
mysql> CREATE TABLE t1 (a DATETIME(6));
Query OK, 0 rows affected (0.02 sec)
mysql> INSERT INTO t1 VALUES (20010101100000.1234567);
ERROR 1105 (HY000): cannot convert datum from decimal to type datetime.
mysql> CREATE TABLE t2(a TIMESTAMP);
Query OK, 0 rows affected (0.01 sec)
mysql> INSERT INTO t2 VALUES (20010101100000.1234567);
ERROR 1105 (HY000): cannot convert datum from decimal to type timestamp.
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v3.0.0-beta-227-g06183393e-dirty
Git Commit Hash: 06183393ed536aa248248b72d4bf9f5010947f66
Git Branch: master
UTC Build Time: 2019-03-15 08:22:53
GoVersion: go version go1.12 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
```
",1,converting decimal to datetime or timestamp when insert is not compatible with mysql bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error create table a datetime insert into values create table a timestamp insert into values what did you expect to see in mysql mysql create table a datetime query ok rows affected sec mysql insert into values query ok row affected sec mysql create table a timestamp query ok rows affected sec mysql insert into values query ok row affected sec what did you see instead in tidb mysql create table a datetime query ok rows affected sec mysql insert into values error cannot convert datum from decimal to type datetime mysql create table a timestamp query ok rows affected sec mysql insert into values error cannot convert datum from decimal to type timestamp what version of tidb are you using tidb server v or run select tidb version on tidb tidb version release version beta dirty git commit hash git branch master utc build time goversion go version darwin race enabled false tikv min version alpha check table before drop false ,1
14538,17629423369.0,IssuesEvent,2021-08-19 05:28:01,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,`extract` result incompatible with mysql ,type/bug type/compatibility sig/execution severity/critical,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```sql
select extract(hour_second from ""-838:59:59.00"");
```
### 2. What did you expect to see? (Required)
```sql
mysql> select extract(hour_second from ""-838:59:59.00"");
+-------------------------------------------+
| extract(hour_second from ""-838:59:59.00"") |
+-------------------------------------------+
| -8385959 |
+-------------------------------------------+
1 row in set (0.22 sec)
```
### 3. What did you see instead (Required)
```sql
MySQL > select extract(hour_second from ""-838:59:59.00"");
+-------------------------------------------+
| extract(hour_second from ""-838:59:59.00"") |
+-------------------------------------------+
| 8385959 |
+-------------------------------------------+
1 row in set
Time: 0.051s
```
### 4. What is your TiDB version? (Required)
v5.0.3, v4.0.14,
master: da8bb5ea8c00bcbbb10afd0ae41a42fa
release-5.2.0: 4c68defe055a7040280
",True,"`extract` result incompatible with mysql - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```sql
select extract(hour_second from ""-838:59:59.00"");
```
### 2. What did you expect to see? (Required)
```sql
mysql> select extract(hour_second from ""-838:59:59.00"");
+-------------------------------------------+
| extract(hour_second from ""-838:59:59.00"") |
+-------------------------------------------+
| -8385959 |
+-------------------------------------------+
1 row in set (0.22 sec)
```
### 3. What did you see instead (Required)
```sql
MySQL > select extract(hour_second from ""-838:59:59.00"");
+-------------------------------------------+
| extract(hour_second from ""-838:59:59.00"") |
+-------------------------------------------+
| 8385959 |
+-------------------------------------------+
1 row in set
Time: 0.051s
```
### 4. What is your TiDB version? (Required)
v5.0.3, v4.0.14,
master: da8bb5ea8c00bcbbb10afd0ae41a42fa
release-5.2.0: 4c68defe055a7040280
",1, extract result incompatible with mysql bug report please answer these questions before submitting your issue thanks minimal reproduce step required sql select extract hour second from what did you expect to see required sql mysql select extract hour second from extract hour second from row in set sec what did you see instead required sql mysql select extract hour second from extract hour second from row in set time what is your tidb version required master release ,1
3438,6404571757.0,IssuesEvent,2017-08-07 03:49:53,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,Insert value with prefix date should not failed,compatibility help wanted rc3.1,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
create table t1(
a1 char(3) primary key,
a2 smallint,
a3 char(3),
a4 real,
a5 date
);
insert into t1 values('AME',0,'SEA',0.100,date'1942-02-19');
```
2. What did you expect to see?
```
Query OK, 1 row affected (0.00 sec)
```
3. What did you see instead?
```
ERROR 1105 (HY000) at line 8: line 0 column 58 near "")"" (total length 59)
```
4. What version of TiDB are you using (`tidb-server -V`)?
",True,"Insert value with prefix date should not failed - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
create table t1(
a1 char(3) primary key,
a2 smallint,
a3 char(3),
a4 real,
a5 date
);
insert into t1 values('AME',0,'SEA',0.100,date'1942-02-19');
```
2. What did you expect to see?
```
Query OK, 1 row affected (0.00 sec)
```
3. What did you see instead?
```
ERROR 1105 (HY000) at line 8: line 0 column 58 near "")"" (total length 59)
```
4. What version of TiDB are you using (`tidb-server -V`)?
",1,insert value with prefix date should not failed please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error sql create table char primary key smallint char real date insert into values ame sea date what did you expect to see query ok row affected sec what did you see instead error at line line column near total length what version of tidb are you using tidb server v ,1
11104,13130710385.0,IssuesEvent,2020-08-06 15:46:40,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,'load data' problem from file whose lines separated by unicode string,status/TODO type/compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
The file 000000_2 contains fields terminated by unicode '\u0017', then
load data local infile '/root/test/test_table/000000_2' into table test.test_table fields TERMINATED by X'\11';
or
load data local infile '/root/test/test_table/000000_2' into table test.test_table fields TERMINATED by '\021';
or
load data local infile '/root/test/test_table/000000_2' into table test.test_table fields TERMINATED by '\u0017';
2. What did you expect to see?
like mysql , load data successfully.
3. What did you see instead?
ERROR 1105 (HY000): line 1 column 125 near """" (total length 125)
or
ERROR 2013 (HY000): Lost connection to MySQL server during query
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
tidb:v2.0.5
",True,"'load data' problem from file whose lines separated by unicode string - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
The file 000000_2 contains fields terminated by unicode '\u0017', then
load data local infile '/root/test/test_table/000000_2' into table test.test_table fields TERMINATED by X'\11';
or
load data local infile '/root/test/test_table/000000_2' into table test.test_table fields TERMINATED by '\021';
or
load data local infile '/root/test/test_table/000000_2' into table test.test_table fields TERMINATED by '\u0017';
2. What did you expect to see?
like mysql , load data successfully.
3. What did you see instead?
ERROR 1105 (HY000): line 1 column 125 near """" (total length 125)
or
ERROR 2013 (HY000): Lost connection to MySQL server during query
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
tidb:v2.0.5
",1, load data problem from file whose lines separated by unicode string please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error the file contains fields terminated by unicode then load data local infile root test test table into table test test table fields terminated by x or load data local infile root test test table into table test test table fields terminated by or load data local infile root test test table into table test test table fields terminated by what did you expect to see like mysql load data successfully what did you see instead error line column near total length or error lost connection to mysql server during query what version of tidb are you using tidb server v or run select tidb version on tidb tidb ,1
4342,7055046089.0,IssuesEvent,2018-01-04 05:37:50,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,table option PACK_KEYS compatibility in CREATE TABLE syntax,compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
`create table t (a int(11)) ENGINE=InnoDB DEFAULT CHARSET=latin1 PACK_KEYS=1`
2. What did you expect to see?
```
mysql> create table t (a int(11)) ENGINE=InnoDB DEFAULT CHARSET=latin1 PACK_KEYS=1;
Query OK, 0 rows affected (0.02 sec)
```
3. What did you see instead?
```
MySQL [gin]> create table t (a int(11)) ENGINE=InnoDB DEFAULT CHARSET=latin1 PACK_KEYS=1;
ERROR 1105 (HY000): line 1 column 73 near ""=1"" (total length 75)
MySQL [gin]> create table t (a int(11)) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Query OK, 0 rows affected (0.10 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
Release Version: v1.0.5
Git Commit Hash: efb13f13b331b340147a63271161e7920eba7e96
Git Branch: release-1.0
UTC Build Time: 2017-12-26 01:45:54
```
",True,"table option PACK_KEYS compatibility in CREATE TABLE syntax - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
`create table t (a int(11)) ENGINE=InnoDB DEFAULT CHARSET=latin1 PACK_KEYS=1`
2. What did you expect to see?
```
mysql> create table t (a int(11)) ENGINE=InnoDB DEFAULT CHARSET=latin1 PACK_KEYS=1;
Query OK, 0 rows affected (0.02 sec)
```
3. What did you see instead?
```
MySQL [gin]> create table t (a int(11)) ENGINE=InnoDB DEFAULT CHARSET=latin1 PACK_KEYS=1;
ERROR 1105 (HY000): line 1 column 73 near ""=1"" (total length 75)
MySQL [gin]> create table t (a int(11)) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Query OK, 0 rows affected (0.10 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
Release Version: v1.0.5
Git Commit Hash: efb13f13b331b340147a63271161e7920eba7e96
Git Branch: release-1.0
UTC Build Time: 2017-12-26 01:45:54
```
",1,table option pack keys compatibility in create table syntax please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error create table t a int engine innodb default charset pack keys what did you expect to see mysql create table t a int engine innodb default charset pack keys query ok rows affected sec what did you see instead mysql create table t a int engine innodb default charset pack keys error line column near total length mysql create table t a int engine innodb default charset query ok rows affected sec what version of tidb are you using tidb server v or run select tidb version on tidb release version git commit hash git branch release utc build time ,1
3644,6527624498.0,IssuesEvent,2017-08-30 02:03:36,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,empty bit-value literal support,compatibility help wanted,"refer https://dev.mysql.com/doc/refman/5.7/en/bit-value-literals.html
>An empty bit value (b'') evaluates to a zero-length binary string. Converted to a number, it produces 0
and TiDB:
```
mysql> SELECT b'';
ERROR 1105 (HY000): line 0 column 10 near """"bit literal: strconv.ParseUint: parsing """": invalid syntax (total length 10)
```
MySQL:
```
mysql> SELECT b'', LENGTH(b''), b''+1;
+-----+-------------+-------+
| b'' | LENGTH(b'') | b''+1 |
+-----+-------------+-------+
| | 0 | 1 |
+-----+-------------+-------+
1 row in set (0.00 sec)
```
tidb_version:
```
mysql> select tidb_version();
+-----------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+-----------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: 0.8.0
Git Commit Hash: ae512b3e3e66eb2464be71d42cc61cbd2302b302
Git Branch: master
UTC Build Time: 2017-08-20 09:27:45 |
+-----------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```",True,"empty bit-value literal support - refer https://dev.mysql.com/doc/refman/5.7/en/bit-value-literals.html
>An empty bit value (b'') evaluates to a zero-length binary string. Converted to a number, it produces 0
and TiDB:
```
mysql> SELECT b'';
ERROR 1105 (HY000): line 0 column 10 near """"bit literal: strconv.ParseUint: parsing """": invalid syntax (total length 10)
```
MySQL:
```
mysql> SELECT b'', LENGTH(b''), b''+1;
+-----+-------------+-------+
| b'' | LENGTH(b'') | b''+1 |
+-----+-------------+-------+
| | 0 | 1 |
+-----+-------------+-------+
1 row in set (0.00 sec)
```
tidb_version:
```
mysql> select tidb_version();
+-----------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+-----------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: 0.8.0
Git Commit Hash: ae512b3e3e66eb2464be71d42cc61cbd2302b302
Git Branch: master
UTC Build Time: 2017-08-20 09:27:45 |
+-----------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```",1,empty bit value literal support refer an empty bit value b evaluates to a zero length binary string converted to a number it produces and tidb mysql select b error line column near bit literal strconv parseuint parsing invalid syntax total length mysql mysql select b length b b b length b b row in set sec tidb version mysql select tidb version tidb version release version git commit hash git branch master utc build time row in set sec ,1
6587,8854545270.0,IssuesEvent,2019-01-09 01:51:28,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,tidb-server options -socket and -host are incompatible,type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```
./bin/tidb-server -socket /tmp/mysql.sock -host 127.0.0.1 -P 3306
```
2. What did you expect to see?
I would expect it to listen on both. This is important because of MySQL's special handling of localhost:
- For the libmysql derived clients it will switch to using unix socket.
- For other drivers like JDBC it will only ever use tcp.
So it is useful to be able to have the server listen on both for a fully local install.
3. What did you see instead?
It will only listen on one (the socket!)
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v2.1.0-beta-644-g89cd59d21
Git Commit Hash: 89cd59d217637f5e79fdc81681c98531c668e688
Git Branch: newmaster
UTC Build Time: 2018-11-26 04:47:59
GoVersion: go version go1.11 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
1 row in set (0.00 sec)
```",True,"tidb-server options -socket and -host are incompatible - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```
./bin/tidb-server -socket /tmp/mysql.sock -host 127.0.0.1 -P 3306
```
2. What did you expect to see?
I would expect it to listen on both. This is important because of MySQL's special handling of localhost:
- For the libmysql derived clients it will switch to using unix socket.
- For other drivers like JDBC it will only ever use tcp.
So it is useful to be able to have the server listen on both for a fully local install.
3. What did you see instead?
It will only listen on one (the socket!)
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v2.1.0-beta-644-g89cd59d21
Git Commit Hash: 89cd59d217637f5e79fdc81681c98531c668e688
Git Branch: newmaster
UTC Build Time: 2018-11-26 04:47:59
GoVersion: go version go1.11 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
1 row in set (0.00 sec)
```",1,tidb server options socket and host are incompatible bug report please answer these questions before submitting your issue thanks what did you do bin tidb server socket tmp mysql sock host p what did you expect to see i would expect it to listen on both this is important because of mysql s special handling of localhost for the libmysql derived clients it will switch to using unix socket for other drivers like jdbc it will only ever use tcp so it is useful to be able to have the server listen on both for a fully local install what did you see instead it will only listen on one the socket what version of tidb are you using tidb server v or run select tidb version on tidb mysql select tidb version g row tidb version release version beta git commit hash git branch newmaster utc build time goversion go version linux race enabled false tikv min version alpha check table before drop false row in set sec ,1
8201,10280413100.0,IssuesEvent,2019-08-26 05:12:07,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,Different results of time(),component/expression for new contributors help wanted type/bug type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
select time(""10:11:1212"");
select time(""-1? 10:11:12"");
```
+ Need to refine ParseDuration in types/time.go
2. What did you expect to see?
```
mysql> select time(""10:11:1212"");
+--------------------+
| time(""10:11:1212"") |
+--------------------+
| NULL |
+--------------------+
1 row in set, 1 warning (0.00 sec)
mysql> select time(""-1? 10:11:12"");
+----------------------+
| time(""-1? 10:11:12"") |
+----------------------+
| -00:00:01 |
+----------------------+
1 row in set, 1 warning (0.00 sec)
```
Note: according to https://dev.mysql.com/doc/refman/5.7/en/time.html
The first result should be `00:00:00` insteal of `NULL`
3. What did you see instead?
```
mysql> select time(""10:11:1212"");
+--------------------+
| time(""10:11:1212"") |
+--------------------+
| 10:11:12 |
+--------------------+
1 row in set (0.00 sec)
mysql> select time(""-1? 10:11:12"");
+----------------------+
| time(""-1? 10:11:12"") |
+----------------------+
| -10:11:12 |
+----------------------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
mysql> select tidb_version();
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v4.0.0-alpha-119-ge8597cd03
Git Commit Hash: e8597cd0398e9ef3fc71803271270c179cd1fb7d
Git Branch: fix_time
UTC Build Time: 2019-08-26 05:04:46
GoVersion: go version go1.12.4 linux/amd64
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
",True,"Different results of time() - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
select time(""10:11:1212"");
select time(""-1? 10:11:12"");
```
+ Need to refine ParseDuration in types/time.go
2. What did you expect to see?
```
mysql> select time(""10:11:1212"");
+--------------------+
| time(""10:11:1212"") |
+--------------------+
| NULL |
+--------------------+
1 row in set, 1 warning (0.00 sec)
mysql> select time(""-1? 10:11:12"");
+----------------------+
| time(""-1? 10:11:12"") |
+----------------------+
| -00:00:01 |
+----------------------+
1 row in set, 1 warning (0.00 sec)
```
Note: according to https://dev.mysql.com/doc/refman/5.7/en/time.html
The first result should be `00:00:00` insteal of `NULL`
3. What did you see instead?
```
mysql> select time(""10:11:1212"");
+--------------------+
| time(""10:11:1212"") |
+--------------------+
| 10:11:12 |
+--------------------+
1 row in set (0.00 sec)
mysql> select time(""-1? 10:11:12"");
+----------------------+
| time(""-1? 10:11:12"") |
+----------------------+
| -10:11:12 |
+----------------------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
mysql> select tidb_version();
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v4.0.0-alpha-119-ge8597cd03
Git Commit Hash: e8597cd0398e9ef3fc71803271270c179cd1fb7d
Git Branch: fix_time
UTC Build Time: 2019-08-26 05:04:46
GoVersion: go version go1.12.4 linux/amd64
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
",1,different results of time bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error select time select time need to refine parseduration in types time go what did you expect to see mysql select time time null row in set warning sec mysql select time time row in set warning sec note according to the first result should be insteal of null what did you see instead mysql select time time row in set sec mysql select time time row in set sec what version of tidb are you using tidb server v or run select tidb version on tidb mysql select tidb version tidb version release version alpha git commit hash git branch fix time utc build time goversion go version linux race enabled false tikv min version check table before drop false row in set sec ,1
7137,9421808134.0,IssuesEvent,2019-04-11 07:51:57,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,`monthname` is not compatible with Mysql,for new contributors help wanted type/bug type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
select monthname(str_to_date(null, '%m')), monthname(str_to_date(null, '%m')),
monthname(str_to_date(1, '%m')), monthname(str_to_date(0, '%m'));
```
2. What did you expect to see?
In Mysql
```
mysql> select monthname(str_to_date(null, '%m')), monthname(str_to_date(null, '%m')),
-> monthname(str_to_date(1, '%m')), monthname(str_to_date(0, '%m'));
+------------------------------------+------------------------------------+---------------------------------+---------------------------------+
| monthname(str_to_date(null, '%m')) | monthname(str_to_date(null, '%m')) | monthname(str_to_date(1, '%m')) | monthname(str_to_date(0, '%m')) |
+------------------------------------+------------------------------------+---------------------------------+---------------------------------+
| NULL | NULL | NULL | NULL |
+------------------------------------+------------------------------------+---------------------------------+---------------------------------+
1 row in set, 2 warnings (0.00 sec)
```
3. What did you see instead?
In TiDB
```
mysql> select monthname(str_to_date(null, '%m')), monthname(str_to_date(null, '%m')),
-> monthname(str_to_date(1, '%m')), monthname(str_to_date(0, '%m'));
+------------------------------------+------------------------------------+---------------------------------+---------------------------------+
| monthname(str_to_date(null, '%m')) | monthname(str_to_date(null, '%m')) | monthname(str_to_date(1, '%m')) | monthname(str_to_date(0, '%m')) |
+------------------------------------+------------------------------------+---------------------------------+---------------------------------+
| NULL | NULL | January | NULL |
+------------------------------------+------------------------------------+---------------------------------+---------------------------------+
1 row in set, 1 warning (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v3.0.0-beta-212-g0681b8125
Git Commit Hash: 0681b8125080045ee0d4747ce61923164c6f2dd1
Git Branch: master
UTC Build Time: 2019-03-14 04:39:19
GoVersion: go version go1.12 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
```
",True,"`monthname` is not compatible with Mysql - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
select monthname(str_to_date(null, '%m')), monthname(str_to_date(null, '%m')),
monthname(str_to_date(1, '%m')), monthname(str_to_date(0, '%m'));
```
2. What did you expect to see?
In Mysql
```
mysql> select monthname(str_to_date(null, '%m')), monthname(str_to_date(null, '%m')),
-> monthname(str_to_date(1, '%m')), monthname(str_to_date(0, '%m'));
+------------------------------------+------------------------------------+---------------------------------+---------------------------------+
| monthname(str_to_date(null, '%m')) | monthname(str_to_date(null, '%m')) | monthname(str_to_date(1, '%m')) | monthname(str_to_date(0, '%m')) |
+------------------------------------+------------------------------------+---------------------------------+---------------------------------+
| NULL | NULL | NULL | NULL |
+------------------------------------+------------------------------------+---------------------------------+---------------------------------+
1 row in set, 2 warnings (0.00 sec)
```
3. What did you see instead?
In TiDB
```
mysql> select monthname(str_to_date(null, '%m')), monthname(str_to_date(null, '%m')),
-> monthname(str_to_date(1, '%m')), monthname(str_to_date(0, '%m'));
+------------------------------------+------------------------------------+---------------------------------+---------------------------------+
| monthname(str_to_date(null, '%m')) | monthname(str_to_date(null, '%m')) | monthname(str_to_date(1, '%m')) | monthname(str_to_date(0, '%m')) |
+------------------------------------+------------------------------------+---------------------------------+---------------------------------+
| NULL | NULL | January | NULL |
+------------------------------------+------------------------------------+---------------------------------+---------------------------------+
1 row in set, 1 warning (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v3.0.0-beta-212-g0681b8125
Git Commit Hash: 0681b8125080045ee0d4747ce61923164c6f2dd1
Git Branch: master
UTC Build Time: 2019-03-14 04:39:19
GoVersion: go version go1.12 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
```
",1, monthname is not compatible with mysql bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error select monthname str to date null m monthname str to date null m monthname str to date m monthname str to date m what did you expect to see in mysql mysql select monthname str to date null m monthname str to date null m monthname str to date m monthname str to date m monthname str to date null m monthname str to date null m monthname str to date m monthname str to date m null null null null row in set warnings sec what did you see instead in tidb mysql select monthname str to date null m monthname str to date null m monthname str to date m monthname str to date m monthname str to date null m monthname str to date null m monthname str to date m monthname str to date m null null january null row in set warning sec what version of tidb are you using tidb server v or run select tidb version on tidb tidb version release version beta git commit hash git branch master utc build time goversion go version darwin race enabled false tikv min version alpha check table before drop false ,1
4829,7447904735.0,IssuesEvent,2018-03-28 13:54:27,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Navicat compatible problem,compatibility,"Meet the following error:
`
[parser:1064]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '/*100,3), '%') AS `Percentage` FROM INFORMATION_SCHEMA.PROFILING WHERE QUERY_ID=' at line 1
SELECT STATE AS `Status`, ROUND(SUM(DURATION),7) AS `Duration`, CONCAT(ROUND(SUM(DURATION)/*100,3), '%') AS `Percentage` FROM INFORMATION_SCHEMA.PROFILING WHERE QUERY_ID= GROUP BY STATE ORDER BY SEQ;
2017/12/26 15:26:18.982 conn.go:428: [warning] [23] dispatch error:
id:23, addr:10.233.104.0:56637 status:2, collation:utf8_general_ci, user:root
""SELECT STATE AS `Status`, ROUND(SUM(DURATION),7) AS `Duration`, CONCAT(ROUND(SUM(DURATION)/*100,3), '%') AS `Percentage` FROM INFORMATION_SCHEMA.PROFILING WHERE QUERY_ID= GROUP BY STATE ORDER BY SEQ;""
/home/jenkins/workspace/build_tidb_1.0/go/src/github.com/pingcap/tidb/parser/yy_parser.go:138: [parser:1064]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '/*100,3), '%') AS `Percentage` FROM INFORMATION_SCHEMA.PROFILING WHERE QUERY_ID=' at line 1
`
Navicat: 10.1.7
",True,"Navicat compatible problem - Meet the following error:
`
[parser:1064]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '/*100,3), '%') AS `Percentage` FROM INFORMATION_SCHEMA.PROFILING WHERE QUERY_ID=' at line 1
SELECT STATE AS `Status`, ROUND(SUM(DURATION),7) AS `Duration`, CONCAT(ROUND(SUM(DURATION)/*100,3), '%') AS `Percentage` FROM INFORMATION_SCHEMA.PROFILING WHERE QUERY_ID= GROUP BY STATE ORDER BY SEQ;
2017/12/26 15:26:18.982 conn.go:428: [warning] [23] dispatch error:
id:23, addr:10.233.104.0:56637 status:2, collation:utf8_general_ci, user:root
""SELECT STATE AS `Status`, ROUND(SUM(DURATION),7) AS `Duration`, CONCAT(ROUND(SUM(DURATION)/*100,3), '%') AS `Percentage` FROM INFORMATION_SCHEMA.PROFILING WHERE QUERY_ID= GROUP BY STATE ORDER BY SEQ;""
/home/jenkins/workspace/build_tidb_1.0/go/src/github.com/pingcap/tidb/parser/yy_parser.go:138: [parser:1064]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '/*100,3), '%') AS `Percentage` FROM INFORMATION_SCHEMA.PROFILING WHERE QUERY_ID=' at line 1
`
Navicat: 10.1.7
",1,navicat compatible problem meet the following error you have an error in your sql syntax check the manual that corresponds to your mysql server version for the right syntax to use near as percentage from information schema profiling where query id at line select state as status round sum duration as duration concat round sum duration as percentage from information schema profiling where query id group by state order by seq conn go dispatch error id addr status collation general ci user root select state as status round sum duration as duration concat round sum duration as percentage from information schema profiling where query id group by state order by seq home jenkins workspace build tidb go src github com pingcap tidb parser yy parser go you have an error in your sql syntax check the manual that corresponds to your mysql server version for the right syntax to use near as percentage from information schema profiling where query id at line navicat ,1
5495,7937199932.0,IssuesEvent,2018-07-09 12:06:28,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,"Intellij IDEA database plugin return an error ""Unknown column 'generation_expression' in 'field list'""",help wanted type/compatibility,"Error encountered when performing Introspect schema xlqy: Unknown column 'generation_expression' in 'field list'.
Unknown column 'generation_expression' in 'field list'",True,"Intellij IDEA database plugin return an error ""Unknown column 'generation_expression' in 'field list'"" - Error encountered when performing Introspect schema xlqy: Unknown column 'generation_expression' in 'field list'.
Unknown column 'generation_expression' in 'field list'",1,intellij idea database plugin return an error unknown column generation expression in field list error encountered when performing introspect schema xlqy unknown column generation expression in field list unknown column generation expression in field list ,1
11080,13100718142.0,IssuesEvent,2020-08-04 01:27:46,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,The result of Function COALESCE is different from MySQL. ,component/expression status/help-wanted type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```mysql
create table test2 ( a decimal(40,20) unsigned);
insert into test2 value(12.98731000000000000000);
select cast(COALESCE(a, 'xxx' ) as unsigned) from test2;
```
2. What did you expect to see?
In MySQL,
```mysql
mysql> select cast(COALESCE(a, 'xxx' ) as unsigned) from test2;
+---------------------------------------+
| cast(COALESCE(a, 'xxx' ) as unsigned) |
+---------------------------------------+
| 12 |
+---------------------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> show warnings;
+---------+------+--------------------------------------------------------------+
| Level | Code | Message |
+---------+------+--------------------------------------------------------------+
| Warning | 1292 | Truncated incorrect INTEGER value: '12.98731000000000000000' |
+---------+------+--------------------------------------------------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
In TiDB,
```mysql
mysql> select cast(COALESCE(a, 'xxx' ) as unsigned) from test2;
+---------------------------------------+
| cast(COALESCE(a, 'xxx' ) as unsigned) |
+---------------------------------------+
| 13 |
+---------------------------------------+
1 row in set (0.01 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
8c20289c7",True,"The result of Function COALESCE is different from MySQL. - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```mysql
create table test2 ( a decimal(40,20) unsigned);
insert into test2 value(12.98731000000000000000);
select cast(COALESCE(a, 'xxx' ) as unsigned) from test2;
```
2. What did you expect to see?
In MySQL,
```mysql
mysql> select cast(COALESCE(a, 'xxx' ) as unsigned) from test2;
+---------------------------------------+
| cast(COALESCE(a, 'xxx' ) as unsigned) |
+---------------------------------------+
| 12 |
+---------------------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> show warnings;
+---------+------+--------------------------------------------------------------+
| Level | Code | Message |
+---------+------+--------------------------------------------------------------+
| Warning | 1292 | Truncated incorrect INTEGER value: '12.98731000000000000000' |
+---------+------+--------------------------------------------------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
In TiDB,
```mysql
mysql> select cast(COALESCE(a, 'xxx' ) as unsigned) from test2;
+---------------------------------------+
| cast(COALESCE(a, 'xxx' ) as unsigned) |
+---------------------------------------+
| 13 |
+---------------------------------------+
1 row in set (0.01 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
8c20289c7",1,the result of function coalesce is different from mysql bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error mysql create table a decimal unsigned insert into value select cast coalesce a xxx as unsigned from what did you expect to see in mysql mysql mysql select cast coalesce a xxx as unsigned from cast coalesce a xxx as unsigned row in set warning sec mysql show warnings level code message warning truncated incorrect integer value row in set sec what did you see instead in tidb mysql mysql select cast coalesce a xxx as unsigned from cast coalesce a xxx as unsigned row in set sec what version of tidb are you using tidb server v or run select tidb version on tidb ,1
3386,6348528922.0,IssuesEvent,2017-07-28 10:12:25,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,No table name validity check in drop table if exists,compatibility rc3.1,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
drop table if exists ``;
```
2. What did you expect to see?
ERROR 1103 (42000): Incorrect table name ''
3. What did you see instead?
Query OK, 0 rows affected (0.00 sec)
4. What version of TiDB are you using (`tidb-server -V`)?
",True,"No table name validity check in drop table if exists - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
drop table if exists ``;
```
2. What did you expect to see?
ERROR 1103 (42000): Incorrect table name ''
3. What did you see instead?
Query OK, 0 rows affected (0.00 sec)
4. What version of TiDB are you using (`tidb-server -V`)?
",1,no table name validity check in drop table if exists please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error sql drop table if exists what did you expect to see error incorrect table name what did you see instead query ok rows affected sec what version of tidb are you using tidb server v ,1
10671,12609985513.0,IssuesEvent,2020-06-12 03:25:44,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,reopened,Feature request: Support CHECKSUM TABLE command,status/help-wanted type/compatibility type/enhancement,"When importing data into TiDB we want to be sure the data is correct. A convenient command in MySQL is CHECKSUM TABLE and this command is not currently supported by TiDB.
Adding it would make it easy to confirm if the data loaded in from an external source matches or not.
Example I did something like:
`$ ssh mysqlhost sudo mysqldump test SomeTable | mysql -h tidbhost -P 4000 -u root -D test`
MySQL 5.6:
```
root@mysqlhost [test]> checksum table SomeTable;
+-----------+------------+
| Table | Checksum |
+-----------+------------+
| SomeTable | 2867272629 |
+-----------+------------+
1 row in set (0.01 sec)
```
TiDB:
```
root@tidbhost [test]> checksum table SomeTable;
ERROR 1105 (HY000): line 0 column 8 near "" table SomeTable""
root@tidbhost [test]>
```
So providing some sort of CHECKSUM table command would be great.
",True,"Feature request: Support CHECKSUM TABLE command - When importing data into TiDB we want to be sure the data is correct. A convenient command in MySQL is CHECKSUM TABLE and this command is not currently supported by TiDB.
Adding it would make it easy to confirm if the data loaded in from an external source matches or not.
Example I did something like:
`$ ssh mysqlhost sudo mysqldump test SomeTable | mysql -h tidbhost -P 4000 -u root -D test`
MySQL 5.6:
```
root@mysqlhost [test]> checksum table SomeTable;
+-----------+------------+
| Table | Checksum |
+-----------+------------+
| SomeTable | 2867272629 |
+-----------+------------+
1 row in set (0.01 sec)
```
TiDB:
```
root@tidbhost [test]> checksum table SomeTable;
ERROR 1105 (HY000): line 0 column 8 near "" table SomeTable""
root@tidbhost [test]>
```
So providing some sort of CHECKSUM table command would be great.
",1,feature request support checksum table command when importing data into tidb we want to be sure the data is correct a convenient command in mysql is checksum table and this command is not currently supported by tidb adding it would make it easy to confirm if the data loaded in from an external source matches or not example i did something like ssh mysqlhost sudo mysqldump test sometable mysql h tidbhost p u root d test mysql root mysqlhost checksum table sometable table checksum sometable row in set sec tidb root tidbhost checksum table sometable error line column near table sometable root tidbhost so providing some sort of checksum table command would be great ,1
4826,7447210836.0,IssuesEvent,2018-03-28 11:45:27,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,scientific notation compatibility,compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
exec `select 1e18;`
2. What did you expect to see?
```
mysql> select 1e18;
+------+
| 1e18 |
+------+
| 1e18 |
+------+
1 row in set (0.00 sec)
```
3. What did you see instead?
mysql> select 1e18;
+---------------------+
| 1e18 |
+---------------------+
| 1000000000000000000 |
+---------------------+
1 row in set (0.00 sec)
4. What version of TiDB are you using (`tidb-server -V`)?
",True,"scientific notation compatibility - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
exec `select 1e18;`
2. What did you expect to see?
```
mysql> select 1e18;
+------+
| 1e18 |
+------+
| 1e18 |
+------+
1 row in set (0.00 sec)
```
3. What did you see instead?
mysql> select 1e18;
+---------------------+
| 1e18 |
+---------------------+
| 1000000000000000000 |
+---------------------+
1 row in set (0.00 sec)
4. What version of TiDB are you using (`tidb-server -V`)?
",1,scientific notation compatibility please answer these questions before submitting your issue thanks what did you do exec select what did you expect to see mysql select row in set sec what did you see instead mysql select row in set sec what version of tidb are you using tidb server v ,1
6246,8641041238.0,IssuesEvent,2018-11-24 13:36:21,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,"sql mode ""NO_UNSIGNED_SUBTRACTION"" support",type/compatibility,"MySQL:
mysql> SET sql_mode = 'NO_UNSIGNED_SUBTRACTION';
mysql> SELECT CAST(0 AS UNSIGNED) - 1;
+-------------------------+
| CAST(0 AS UNSIGNED) - 1 |
+-------------------------+
| -1 |
+-------------------------+
TiDB:
mysql> SET sql_mode = '';
Query OK, 0 rows affected (0.00 sec)
mysql> SELECT CAST(0 AS UNSIGNED) - 1;
ERROR 1690 (22003): BIGINT UNSIGNED value is out of range in '(cast(0 as unsigned) - 1)'
see [sql mode](https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sqlmode_no_unsigned_subtraction)",True,"sql mode ""NO_UNSIGNED_SUBTRACTION"" support - MySQL:
mysql> SET sql_mode = 'NO_UNSIGNED_SUBTRACTION';
mysql> SELECT CAST(0 AS UNSIGNED) - 1;
+-------------------------+
| CAST(0 AS UNSIGNED) - 1 |
+-------------------------+
| -1 |
+-------------------------+
TiDB:
mysql> SET sql_mode = '';
Query OK, 0 rows affected (0.00 sec)
mysql> SELECT CAST(0 AS UNSIGNED) - 1;
ERROR 1690 (22003): BIGINT UNSIGNED value is out of range in '(cast(0 as unsigned) - 1)'
see [sql mode](https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sqlmode_no_unsigned_subtraction)",1,sql mode no unsigned subtraction support mysql mysql set sql mode no unsigned subtraction mysql select cast as unsigned cast as unsigned tidb mysql set sql mode query ok rows affected sec mysql select cast as unsigned error bigint unsigned value is out of range in cast as unsigned see ,1
16545,22497376051.0,IssuesEvent,2022-06-23 08:46:52,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,to_days(1001-00-00) returns 365576 instead of NULL,type/bug sig/execution compatibility-breaker severity/major affects-5.0 affects-5.1 affects-5.2 affects-5.3 compatibility-mysql8 affects-5.4 affects-6.0 affects-6.1,"## Bug Report
to_days() does return a value instead of NULL, like MySQL.
This is most likely true for any invalid dates.
Found while testing MySQL test file `partition_pruning.test`
### 1. Minimal reproduce step (Required)
```sql
select to_days('1001-00-00');
```
### 2. What did you expect to see? (Required)
```sql
mysql> select to_days('1001-00-00');
+-----------------------+
| to_days('1001-00-00') |
+-----------------------+
| NULL |
+-----------------------+
1 row in set, 1 warning (0,00 sec)
mysql> show warnings;
+---------+------+----------------------------------------+
| Level | Code | Message |
+---------+------+----------------------------------------+
| Warning | 1292 | Incorrect datetime value: '1001-00-00' |
+---------+------+----------------------------------------+
1 row in set (0,00 sec)
```
### 3. What did you see instead (Required)
```sql
tidb> select to_days('1001-00-00');
+-----------------------+
| to_days('1001-00-00') |
+-----------------------+
| 365576 |
+-----------------------+
1 row in set (0,00 sec)
```
### 4. What is your TiDB version? (Required)
```
tidb_version(): Release Version: v5.4.0-alpha-305-gcec4acbf5e
Edition: Community
Git Commit Hash: cec4acbf5ea952a8f92c8258fce3142528f9fb1e
Git Branch: master
UTC Build Time: 2021-12-02 19:58:57
GoVersion: go1.17
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
```
",True,"to_days(1001-00-00) returns 365576 instead of NULL - ## Bug Report
to_days() does return a value instead of NULL, like MySQL.
This is most likely true for any invalid dates.
Found while testing MySQL test file `partition_pruning.test`
### 1. Minimal reproduce step (Required)
```sql
select to_days('1001-00-00');
```
### 2. What did you expect to see? (Required)
```sql
mysql> select to_days('1001-00-00');
+-----------------------+
| to_days('1001-00-00') |
+-----------------------+
| NULL |
+-----------------------+
1 row in set, 1 warning (0,00 sec)
mysql> show warnings;
+---------+------+----------------------------------------+
| Level | Code | Message |
+---------+------+----------------------------------------+
| Warning | 1292 | Incorrect datetime value: '1001-00-00' |
+---------+------+----------------------------------------+
1 row in set (0,00 sec)
```
### 3. What did you see instead (Required)
```sql
tidb> select to_days('1001-00-00');
+-----------------------+
| to_days('1001-00-00') |
+-----------------------+
| 365576 |
+-----------------------+
1 row in set (0,00 sec)
```
### 4. What is your TiDB version? (Required)
```
tidb_version(): Release Version: v5.4.0-alpha-305-gcec4acbf5e
Edition: Community
Git Commit Hash: cec4acbf5ea952a8f92c8258fce3142528f9fb1e
Git Branch: master
UTC Build Time: 2021-12-02 19:58:57
GoVersion: go1.17
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
```
",1,to days returns instead of null bug report to days does return a value instead of null like mysql this is most likely true for any invalid dates found while testing mysql test file partition pruning test minimal reproduce step required sql select to days what did you expect to see required sql mysql select to days to days null row in set warning sec mysql show warnings level code message warning incorrect datetime value row in set sec what did you see instead required sql tidb select to days to days row in set sec what is your tidb version required tidb version release version alpha edition community git commit hash git branch master utc build time goversion race enabled false tikv min version check table before drop false ,1
12313,14566576368.0,IssuesEvent,2020-12-17 09:05:51,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,ddl: make `TableColumnCountLimit` configurable or be compatible with MySQL.,difficulty/easy sig/DDL type/compatibility type/feature-request,"## Feature Request
**Is your feature request related to a problem? Please describe:**
There is a limitation for the number of columns for a table in TiDB, for now, it is 512(hard-coded):
https://github.com/pingcap/tidb/blob/master/ddl/ddl.go#L83
Please notice that this is different from [MySQL](https://dev.mysql.com/doc/refman/8.0/en/column-count-limit.html#:~:text=MySQL%20has%20hard%20limit%20of,columns%20cannot%20exceed%20this%20size.):
```
MySQL has hard limit of 4096 columns per table, but the effective maximum may be less for a given table.
```
**Describe the feature you'd like:**
The current limitation of TiDB is basically from the previous 'transaction-size-limit'. If there were too many columns defined, the metadata of a TiDB table may be too large for a single transaction, that's why we set it and it is less than MySQL. However, after supporting the 'large transaction', theoretically the limitation of the size of a transaction has gone.
We may consider now:
- Increase the column count limitation to 4096(same as MySQL).
- Make it configurable, ranged from 512 - 4096 or even larger maybe.
However, it is still worth mention that '*the effective maximum may be less for a given table.*' in our document.
**Describe alternatives you've considered:**
For now, there's no alternative for it.
**Teachability, Documentation, Adoption, Migration Strategy:**
None
",True,"ddl: make `TableColumnCountLimit` configurable or be compatible with MySQL. - ## Feature Request
**Is your feature request related to a problem? Please describe:**
There is a limitation for the number of columns for a table in TiDB, for now, it is 512(hard-coded):
https://github.com/pingcap/tidb/blob/master/ddl/ddl.go#L83
Please notice that this is different from [MySQL](https://dev.mysql.com/doc/refman/8.0/en/column-count-limit.html#:~:text=MySQL%20has%20hard%20limit%20of,columns%20cannot%20exceed%20this%20size.):
```
MySQL has hard limit of 4096 columns per table, but the effective maximum may be less for a given table.
```
**Describe the feature you'd like:**
The current limitation of TiDB is basically from the previous 'transaction-size-limit'. If there were too many columns defined, the metadata of a TiDB table may be too large for a single transaction, that's why we set it and it is less than MySQL. However, after supporting the 'large transaction', theoretically the limitation of the size of a transaction has gone.
We may consider now:
- Increase the column count limitation to 4096(same as MySQL).
- Make it configurable, ranged from 512 - 4096 or even larger maybe.
However, it is still worth mention that '*the effective maximum may be less for a given table.*' in our document.
**Describe alternatives you've considered:**
For now, there's no alternative for it.
**Teachability, Documentation, Adoption, Migration Strategy:**
None
",1,ddl make tablecolumncountlimit configurable or be compatible with mysql feature request is your feature request related to a problem please describe there is a limitation for the number of columns for a table in tidb for now it is hard coded please notice that this is different from mysql has hard limit of columns per table but the effective maximum may be less for a given table describe the feature you d like the current limitation of tidb is basically from the previous transaction size limit if there were too many columns defined the metadata of a tidb table may be too large for a single transaction that s why we set it and it is less than mysql however after supporting the large transaction theoretically the limitation of the size of a transaction has gone we may consider now increase the column count limitation to same as mysql make it configurable ranged from or even larger maybe however it is still worth mention that the effective maximum may be less for a given table in our document describe alternatives you ve considered for now there s no alternative for it teachability documentation adoption migration strategy none ,1
16876,23232540105.0,IssuesEvent,2022-08-03 08:54:37,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,The default value of timestamp inconsistent with MySQL,compatibility-mysql8,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```
create table t(a timestamp default '2010-09-12 12:23:00');
select COLUMN_DEFAULT, COLUMN_TYPE from information_schema.columns where table_name='t' and column_name='a';
```
### 2. What did you expect to see? (Required)
```
mysql> select COLUMN_DEFAULT, COLUMN_TYPE from information_schema.columns where table_name='t' and column_name='a';
+---------------------+-------------+
| COLUMN_DEFAULT | COLUMN_TYPE |
+---------------------+-------------+
| 2010-09-12 12:23:00 | timestamp |
+---------------------+-------------+
1 row in set (0.00 sec)
```
### 3. What did you see instead (Required)
```
mysql> select COLUMN_DEFAULT, COLUMN_TYPE from information_schema.columns where table_name='t' and column_name='a';
+---------------------+-------------+
| COLUMN_DEFAULT | COLUMN_TYPE |
+---------------------+-------------+
| 2010-09-12 04:23:00 | timestamp |
+---------------------+-------------+
1 row in set (0.00 sec)
```
### 4. What is your TiDB version? (Required)
```
mysql> select tidb_version();
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v6.2.0-alpha-73-ga523d767f
Edition: Community
Git Commit Hash: a523d767f88e3fbcff1c3f138c8461dc0af5cd5e
Git Branch: master
UTC Build Time: 2022-06-07 09:24:17
GoVersion: go1.18
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
Store: unistore |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
",True,"The default value of timestamp inconsistent with MySQL - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```
create table t(a timestamp default '2010-09-12 12:23:00');
select COLUMN_DEFAULT, COLUMN_TYPE from information_schema.columns where table_name='t' and column_name='a';
```
### 2. What did you expect to see? (Required)
```
mysql> select COLUMN_DEFAULT, COLUMN_TYPE from information_schema.columns where table_name='t' and column_name='a';
+---------------------+-------------+
| COLUMN_DEFAULT | COLUMN_TYPE |
+---------------------+-------------+
| 2010-09-12 12:23:00 | timestamp |
+---------------------+-------------+
1 row in set (0.00 sec)
```
### 3. What did you see instead (Required)
```
mysql> select COLUMN_DEFAULT, COLUMN_TYPE from information_schema.columns where table_name='t' and column_name='a';
+---------------------+-------------+
| COLUMN_DEFAULT | COLUMN_TYPE |
+---------------------+-------------+
| 2010-09-12 04:23:00 | timestamp |
+---------------------+-------------+
1 row in set (0.00 sec)
```
### 4. What is your TiDB version? (Required)
```
mysql> select tidb_version();
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v6.2.0-alpha-73-ga523d767f
Edition: Community
Git Commit Hash: a523d767f88e3fbcff1c3f138c8461dc0af5cd5e
Git Branch: master
UTC Build Time: 2022-06-07 09:24:17
GoVersion: go1.18
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
Store: unistore |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
",1,the default value of timestamp inconsistent with mysql bug report please answer these questions before submitting your issue thanks minimal reproduce step required create table t a timestamp default select column default column type from information schema columns where table name t and column name a what did you expect to see required mysql select column default column type from information schema columns where table name t and column name a column default column type timestamp row in set sec what did you see instead required mysql select column default column type from information schema columns where table name t and column name a column default column type timestamp row in set sec what is your tidb version required mysql select tidb version tidb version release version alpha edition community git commit hash git branch master utc build time goversion race enabled false tikv min version check table before drop false store unistore row in set sec ,1
18564,25821598639.0,IssuesEvent,2022-12-12 09:58:53,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,force index behaviour not same as mysql,type/compatibility good first issue sig/planner compatibility-mysql8,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
# ----- step 1: create table
CREATE TABLE `projects_send` (
`entry` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
`projectid` int(8) NOT NULL COMMENT 'ID',
`status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '状态(0:not send;1:sent;2:back)',
`sendtime` datetime NOT NULL COMMENT 'senttime',
PRIMARY KEY (`entry`) USING BTREE,
KEY `idx_sendtime_status_projectid` (`sendtime`,`status`,`projectid`) USING BTREE,
KEY `idx_sendtime_status` (`sendtime`,`status`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
# ----- step 2: EXPLAIN on tidb & mysql
#1. tidb & mysql same
mysql>
EXPLAIN select * from projects_send force index(idx_sendtime) where sendtime > ""2020-01-01"";
Key 'idx_sendtime' doesnt exist in table 'projects_send'
#2. tidb & mysql same
mysql>
EXPLAIN select * from projects_send force index(idx_sendtime_status) where sendtime > ""2020-01-01"";
+----+-------------+---------------+-------+---------------------+---------------------+---------+------+------+--------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+---------------+-------+---------------------+---------------------+---------+------+------+--------------------------+
| 1 | SIMPLE | projects_send | index | idx_sendtime_status | idx_sendtime_status | 10 | NULL | 1 | Using where; Using index |
+----+-------------+---------------+-------+---------------------+---------------------+---------+------+------+--------------------------+
#3. tidb & mysql not same: tidb show index not exist
mysql>
EXPLAIN select * from projects_send force index(idx_sendtime_status_pro) where sendtime > ""2020-01-01"";
+----+-------------+---------------+-------+-------------------------------+-------------------------------+---------+------+------+--------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+---------------+-------+-------------------------------+-------------------------------+---------+------+------+--------------------------+
| 1 | SIMPLE | projects_send | index | idx_sendtime_status_projectid | idx_sendtime_status_projectid | 10 | NULL | 1 | Using where; Using index |
+----+-------------+---------------+-------+-------------------------------+-------------------------------+---------+------+------+--------------------------+
1 row in set (0.14 sec)
#on mysql the only one same prefix index idx_sendtime_status_pro can be used, but on tidb only the same name index can be use
```
2. What did you expect to see?
3. What did you see instead?
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
Release Version: v3.0.8
Git Commit Hash: 8f13cf1449bd8903ff465a4f12ed89ecbac858a4
Git Branch: HEAD
UTC Build Time: 2019-12-31 11:14:59
GoVersion: go version go1.13 linux/amd64
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
",True,"force index behaviour not same as mysql - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
# ----- step 1: create table
CREATE TABLE `projects_send` (
`entry` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
`projectid` int(8) NOT NULL COMMENT 'ID',
`status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '状态(0:not send;1:sent;2:back)',
`sendtime` datetime NOT NULL COMMENT 'senttime',
PRIMARY KEY (`entry`) USING BTREE,
KEY `idx_sendtime_status_projectid` (`sendtime`,`status`,`projectid`) USING BTREE,
KEY `idx_sendtime_status` (`sendtime`,`status`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
# ----- step 2: EXPLAIN on tidb & mysql
#1. tidb & mysql same
mysql>
EXPLAIN select * from projects_send force index(idx_sendtime) where sendtime > ""2020-01-01"";
Key 'idx_sendtime' doesnt exist in table 'projects_send'
#2. tidb & mysql same
mysql>
EXPLAIN select * from projects_send force index(idx_sendtime_status) where sendtime > ""2020-01-01"";
+----+-------------+---------------+-------+---------------------+---------------------+---------+------+------+--------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+---------------+-------+---------------------+---------------------+---------+------+------+--------------------------+
| 1 | SIMPLE | projects_send | index | idx_sendtime_status | idx_sendtime_status | 10 | NULL | 1 | Using where; Using index |
+----+-------------+---------------+-------+---------------------+---------------------+---------+------+------+--------------------------+
#3. tidb & mysql not same: tidb show index not exist
mysql>
EXPLAIN select * from projects_send force index(idx_sendtime_status_pro) where sendtime > ""2020-01-01"";
+----+-------------+---------------+-------+-------------------------------+-------------------------------+---------+------+------+--------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+---------------+-------+-------------------------------+-------------------------------+---------+------+------+--------------------------+
| 1 | SIMPLE | projects_send | index | idx_sendtime_status_projectid | idx_sendtime_status_projectid | 10 | NULL | 1 | Using where; Using index |
+----+-------------+---------------+-------+-------------------------------+-------------------------------+---------+------+------+--------------------------+
1 row in set (0.14 sec)
#on mysql the only one same prefix index idx_sendtime_status_pro can be used, but on tidb only the same name index can be use
```
2. What did you expect to see?
3. What did you see instead?
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
Release Version: v3.0.8
Git Commit Hash: 8f13cf1449bd8903ff465a4f12ed89ecbac858a4
Git Branch: HEAD
UTC Build Time: 2019-12-31 11:14:59
GoVersion: go version go1.13 linux/amd64
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
",1,force index behaviour not same as mysql bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error step create table create table projects send entry bigint unsigned not null auto increment comment id projectid int not null comment id status tinyint unsigned not null default comment 状态 not send sent back sendtime datetime not null comment senttime primary key entry using btree key idx sendtime status projectid sendtime status projectid using btree key idx sendtime status sendtime status using btree engine innodb auto increment default charset step explain on tidb mysql tidb mysql same mysql explain select from projects send force index idx sendtime where sendtime key idx sendtime doesnt exist in table projects send tidb mysql same mysql explain select from projects send force index idx sendtime status where sendtime id select type table type possible keys key key len ref rows extra simple projects send index idx sendtime status idx sendtime status null using where using index tidb mysql not same tidb show index not exist mysql explain select from projects send force index idx sendtime status pro where sendtime id select type table type possible keys key key len ref rows extra simple projects send index idx sendtime status projectid idx sendtime status projectid null using where using index row in set sec on mysql the only one same prefix index idx sendtime status pro can be used but on tidb only the same name index can be use what did you expect to see what did you see instead what version of tidb are you using tidb server v or run select tidb version on tidb release version git commit hash git branch head utc build time goversion go version linux race enabled false tikv min version check table before drop false ,1
5168,7747785887.0,IssuesEvent,2018-05-30 05:37:52,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,"""in"" clause should not return error if type overflow",compatibility help wanted,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
create table t1 (some_id smallint(5) unsigned,key (some_id) );
insert into t1 values (1),(2);
select some_id from t1 where some_id not in(2,-1);
```
2. What did you expect to see?
```
+---------+
| some_id |
+---------+
| 1 |
+---------+
1 row in set (0.00 sec)
```
3. What did you see instead?
ERROR 1690 (22003): constant -1 overflows smallint
4. What version of TiDB are you using (`tidb-server -V`)?
",True,"""in"" clause should not return error if type overflow - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
create table t1 (some_id smallint(5) unsigned,key (some_id) );
insert into t1 values (1),(2);
select some_id from t1 where some_id not in(2,-1);
```
2. What did you expect to see?
```
+---------+
| some_id |
+---------+
| 1 |
+---------+
1 row in set (0.00 sec)
```
3. What did you see instead?
ERROR 1690 (22003): constant -1 overflows smallint
4. What version of TiDB are you using (`tidb-server -V`)?
",1, in clause should not return error if type overflow please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error sql create table some id smallint unsigned key some id insert into values select some id from where some id not in what did you expect to see some id row in set sec what did you see instead error constant overflows smallint what version of tidb are you using tidb server v ,1
9721,11773930222.0,IssuesEvent,2020-03-16 08:28:15,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,Support implicit primary key,type/compatibility type/enhancement,"## Feature Request
**Is your feature request related to a problem? Please describe:**
In MySQL 8.0, a table with no explicit primary key may still have an effective implicit primary key if it has any UNIQUE indexes on `NOT NULL` columns. In this case, the first such index places the same constraint on table rows as an explicit primary key and that index cannot be made invisible. Consider the following table definition:
```sql
CREATE TABLE t2 (
i INT NOT NULL,
j INT NOT NULL,
UNIQUE j_idx (j)
) ENGINE = InnoDB;
```
The key `j_idx` will became a primary key, even if we do not assign `primary key` explicitly.
**Describe the feature you'd like:**
**Teachability, Documentation, Adoption, Migration Strategy:**
[MySQL document](https://dev.mysql.com/doc/refman/8.0/en/invisible-indexes.html)",True,"Support implicit primary key - ## Feature Request
**Is your feature request related to a problem? Please describe:**
In MySQL 8.0, a table with no explicit primary key may still have an effective implicit primary key if it has any UNIQUE indexes on `NOT NULL` columns. In this case, the first such index places the same constraint on table rows as an explicit primary key and that index cannot be made invisible. Consider the following table definition:
```sql
CREATE TABLE t2 (
i INT NOT NULL,
j INT NOT NULL,
UNIQUE j_idx (j)
) ENGINE = InnoDB;
```
The key `j_idx` will became a primary key, even if we do not assign `primary key` explicitly.
**Describe the feature you'd like:**
**Teachability, Documentation, Adoption, Migration Strategy:**
[MySQL document](https://dev.mysql.com/doc/refman/8.0/en/invisible-indexes.html)",1,support implicit primary key feature request is your feature request related to a problem please describe in mysql a table with no explicit primary key may still have an effective implicit primary key if it has any unique indexes on not null columns in this case the first such index places the same constraint on table rows as an explicit primary key and that index cannot be made invisible consider the following table definition sql create table i int not null j int not null unique j idx j engine innodb the key j idx will became a primary key even if we do not assign primary key explicitly describe the feature you d like teachability documentation adoption migration strategy ,1
7675,9931705449.0,IssuesEvent,2019-07-02 08:09:19,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,Incompatible issues about window function,type/bug type/compatibility,"We have some incompatible issues about window function, and need help from contributors, most of them are simple to fix.
- [ ] #10996
- [ ] #11001
- [ ] #11002
- [ ] #11007
- [ ] #11008
- [ ] #11009
- [ ] #11010
- [ ] #11011 ",True,"Incompatible issues about window function - We have some incompatible issues about window function, and need help from contributors, most of them are simple to fix.
- [ ] #10996
- [ ] #11001
- [ ] #11002
- [ ] #11007
- [ ] #11008
- [ ] #11009
- [ ] #11010
- [ ] #11011 ",1,incompatible issues about window function we have some incompatible issues about window function and need help from contributors most of them are simple to fix ,1
168542,13094552457.0,IssuesEvent,2020-08-03 12:37:41,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,index_change_test.go:testIndexChangeSuite.TestIndexChange failed,component/test,"index_change_test.go:testIndexChangeSuite.TestIndexChange
Latest failed builds:
https://internal.pingcap.net/idc-jenkins/job/tidb_ghpr_unit_test/28301/display/redirect
",1.0,"index_change_test.go:testIndexChangeSuite.TestIndexChange failed - index_change_test.go:testIndexChangeSuite.TestIndexChange
Latest failed builds:
https://internal.pingcap.net/idc-jenkins/job/tidb_ghpr_unit_test/28301/display/redirect
",0,index change test go testindexchangesuite testindexchange failed index change test go testindexchangesuite testindexchange latest failed builds ,0
3419,6392908898.0,IssuesEvent,2017-08-04 05:09:30,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,Function `encrypt` not supported,compatibility rc3.1,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
select length(encrypt('foo', 'ff')) <> 0;
```
2. What did you expect to see?
```
length(encrypt('foo', 'ff')) <> 0
1
```
3. What did you see instead?
```
ERROR 1305 (42000) at line 1: FUNCTION ENCRYPT does not exist
```
4. What version of TiDB are you using (`tidb-server -V`)?
",True,"Function `encrypt` not supported - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
select length(encrypt('foo', 'ff')) <> 0;
```
2. What did you expect to see?
```
length(encrypt('foo', 'ff')) <> 0
1
```
3. What did you see instead?
```
ERROR 1305 (42000) at line 1: FUNCTION ENCRYPT does not exist
```
4. What version of TiDB are you using (`tidb-server -V`)?
",1,function encrypt not supported please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error sql select length encrypt foo ff what did you expect to see length encrypt foo ff what did you see instead error at line function encrypt does not exist what version of tidb are you using tidb server v ,1
16384,22092463572.0,IssuesEvent,2022-06-01 07:20:29,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,release savepoint behavior is inconsistent with mysql,type/bug severity/minor compatibility-mysql8,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```sql
/* test */ select version();
/* test */ drop table if exists t;
/* test */ create table t (k int primary key, v varchar(20));
/* test */ begin;
/* test */ insert into t values (1, 'a');
/* test */ savepoint p1;
/* test */ insert into t values (2, 'b');
/* test */ savepoint p2;
/* test */ select * from t;
/* test */ release savepoint p1;
/* test */ select * from t;
/* test */ rollback to p2; -- tidb: OK; mysql: SAVEPOINT p2 does not exist;
/* test */ select * from t;
/* test */ rollback;
```
### 2. What did you expect to see? (Required)
### 3. What did you see instead (Required)
### 4. What is your TiDB version? (Required)
master: 2c3f717af66c6925f46776da867790ca150ecfcc
",True,"release savepoint behavior is inconsistent with mysql - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```sql
/* test */ select version();
/* test */ drop table if exists t;
/* test */ create table t (k int primary key, v varchar(20));
/* test */ begin;
/* test */ insert into t values (1, 'a');
/* test */ savepoint p1;
/* test */ insert into t values (2, 'b');
/* test */ savepoint p2;
/* test */ select * from t;
/* test */ release savepoint p1;
/* test */ select * from t;
/* test */ rollback to p2; -- tidb: OK; mysql: SAVEPOINT p2 does not exist;
/* test */ select * from t;
/* test */ rollback;
```
### 2. What did you expect to see? (Required)
### 3. What did you see instead (Required)
### 4. What is your TiDB version? (Required)
master: 2c3f717af66c6925f46776da867790ca150ecfcc
",1,release savepoint behavior is inconsistent with mysql bug report please answer these questions before submitting your issue thanks minimal reproduce step required sql test select version test drop table if exists t test create table t k int primary key v varchar test begin test insert into t values a test savepoint test insert into t values b test savepoint test select from t test release savepoint test select from t test rollback to tidb ok mysql savepoint does not exist test select from t test rollback what did you expect to see required what did you see instead required what is your tidb version required master ,1
5647,8126480512.0,IssuesEvent,2018-08-17 02:29:36,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,"When the field list of the select statement contains the Enum type, the client will report an error",component/expression for new contributors help wanted status/TODO type/compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
When I use Server Prepared Statements, that is set `useServerPrepStmts=true`, if the select statement's field list contains the `Enum` type, the client will report an error.
```
CREATE TABLE shirts (
name VARCHAR(40),
size ENUM('small', 'medium', 'large')
);
INSERT INTO shirts (name, size) VALUES ('dress shirt','large'), ('t-shirt','medium'),('polo shirt','small');
mysql> desc shirts;
+-------+--------------------------------+------+------+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+--------------------------------+------+------+---------+-------+
| name | varchar(40) | YES | | NULL | |
| size | enum('small','medium','large') | YES | | NULL | |
+-------+--------------------------------+------+------+---------+-------+
```
Java Code snippet:
```
String DB_URL = ""jdbc:mysql://xxx.xxx.xxxx.xxx:4000/test"";
Properties info = new Properties();
info.setProperty(""user"", ""root"");
info.setProperty(""password"", """");
info.setProperty(""useServerPrepStmts"", ""true"");
Connection conn = DriverManager.getConnection(DB_URL, info);
String sql = ""SELECT name, size FROM shirts WHERE name = ?"";
PreparedStatement preparedStatement = conn.prepareStatement(sql);
preparedStatement.setString(1, ""t-shirt"");
ResultSet resultSet = preparedStatement.executeQuery();
while (resultSet.next()) {
String name = resultSet.getString(""name"");
String size = resultSet.getString(""size"");
System.out.println(name + "", "" + size );
}
```
MySQL Connector/J version:
```
mysql
mysql-connector-java
6.0.6
```
2. What did you expect to see?
I expect the TiDB to return the correct query result.
3. What did you see instead?
The client reported the following error message:
```
Exception in thread ""main"" java.sql.SQLException: Unknown type '247' in column '1' of '2' in binary-encoded result set.
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:545)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:513)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:115)
at com.mysql.cj.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1299)
at com.mysql.cj.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:701)
at com.mysql.cj.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1923)
at com.apusic.test.CursorExample.main(CursorExample.java:27)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
----------------------------------------------------------------------------------------------------------------+
| Release Version: v2.1.0-alpha-75-g41f8ac195
Git Commit Hash: 41f8ac19523386d0eb6ca871397f49f834958169
Git Branch: master
UTC Build Time: 2018-06-26 07:08:04
GoVersion: go version go1.10.1 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e |
+------------------------------------------------------------------------------------",True,"When the field list of the select statement contains the Enum type, the client will report an error - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
When I use Server Prepared Statements, that is set `useServerPrepStmts=true`, if the select statement's field list contains the `Enum` type, the client will report an error.
```
CREATE TABLE shirts (
name VARCHAR(40),
size ENUM('small', 'medium', 'large')
);
INSERT INTO shirts (name, size) VALUES ('dress shirt','large'), ('t-shirt','medium'),('polo shirt','small');
mysql> desc shirts;
+-------+--------------------------------+------+------+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+--------------------------------+------+------+---------+-------+
| name | varchar(40) | YES | | NULL | |
| size | enum('small','medium','large') | YES | | NULL | |
+-------+--------------------------------+------+------+---------+-------+
```
Java Code snippet:
```
String DB_URL = ""jdbc:mysql://xxx.xxx.xxxx.xxx:4000/test"";
Properties info = new Properties();
info.setProperty(""user"", ""root"");
info.setProperty(""password"", """");
info.setProperty(""useServerPrepStmts"", ""true"");
Connection conn = DriverManager.getConnection(DB_URL, info);
String sql = ""SELECT name, size FROM shirts WHERE name = ?"";
PreparedStatement preparedStatement = conn.prepareStatement(sql);
preparedStatement.setString(1, ""t-shirt"");
ResultSet resultSet = preparedStatement.executeQuery();
while (resultSet.next()) {
String name = resultSet.getString(""name"");
String size = resultSet.getString(""size"");
System.out.println(name + "", "" + size );
}
```
MySQL Connector/J version:
```
mysql
mysql-connector-java
6.0.6
```
2. What did you expect to see?
I expect the TiDB to return the correct query result.
3. What did you see instead?
The client reported the following error message:
```
Exception in thread ""main"" java.sql.SQLException: Unknown type '247' in column '1' of '2' in binary-encoded result set.
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:545)
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:513)
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:115)
at com.mysql.cj.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1299)
at com.mysql.cj.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:701)
at com.mysql.cj.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1923)
at com.apusic.test.CursorExample.main(CursorExample.java:27)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
----------------------------------------------------------------------------------------------------------------+
| Release Version: v2.1.0-alpha-75-g41f8ac195
Git Commit Hash: 41f8ac19523386d0eb6ca871397f49f834958169
Git Branch: master
UTC Build Time: 2018-06-26 07:08:04
GoVersion: go version go1.10.1 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e |
+------------------------------------------------------------------------------------",1,when the field list of the select statement contains the enum type the client will report an error please answer these questions before submitting your issue thanks what did you do when i use server prepared statements that is set useserverprepstmts true if the select statement s field list contains the enum type the client will report an error create table shirts name varchar size enum small medium large insert into shirts name size values dress shirt large t shirt medium polo shirt small mysql desc shirts field type null key default extra name varchar yes null size enum small medium large yes null java code snippet: string db url jdbc mysql xxx xxx xxxx xxx test properties info new properties info setproperty user root info setproperty password info setproperty useserverprepstmts true connection conn drivermanager getconnection db url info string sql select name size from shirts where name preparedstatement preparedstatement conn preparestatement sql preparedstatement setstring t shirt resultset resultset preparedstatement executequery while resultset next string name resultset getstring name string size resultset getstring size system out println name size mysql connector j version: mysql mysql connector java what did you expect to see i expect the tidb to return the correct query result what did you see instead the client reported the following error message exception in thread main java sql sqlexception unknown type in column of in binary encoded result set at com mysql cj jdbc exceptions sqlerror createsqlexception sqlerror java at com mysql cj jdbc exceptions sqlerror createsqlexception sqlerror java at com mysql cj jdbc exceptions sqlexceptionsmapping translateexception sqlexceptionsmapping java at com mysql cj jdbc serverpreparedstatement serverexecute serverpreparedstatement java at com mysql cj jdbc serverpreparedstatement executeinternal serverpreparedstatement java at com mysql cj jdbc preparedstatement executequery preparedstatement java at com apusic test cursorexample main cursorexample java what version of tidb are you using tidb server v or run select tidb version on tidb release version alpha git commit hash git branch master utc build time goversion go version darwin race enabled false tikv min version alpha ,1
5500,7954134543.0,IssuesEvent,2018-07-12 06:10:20,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,panic when multiply very big decimal with a very small decimal,type/bug type/compatibility,"1. What did you do?
```
select -0.0000000000000000000000000000000000000000000000000017382578996420603 * -13890436710184412000000000000000000000000000000000000000000000000000000000000;
```
2. What did you expect to see?
```
+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| -0.0000000000000000000000000000000000000000000000000017382578996420603 * -13890436710184412000000000000000000000000000000000000000000000000000000000000 |
+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| 0.000000000000000000000000000000 |
+---------------------------------------------------------------------------------------------------------------------------------------------------------+
```
3. What did you see instead?
```
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
```
```
2018/07/04 17:41:18.140 conn.go:427: [error] lastCmd select -0.0000000000000000000000000000000000000000000000000017382578996420603 * -13890436710184412000000000000000000000000000000000000000000000000000000000000, runtime error: index out of range, goroutine 11914 [running]:
github.com/pingcap/tidb/server.(*clientConn).Run.func1(0xc42168eea0, 0xc420cebbf0)
/home/robi/Code/go/src/github.com/pingcap/tidb/server/conn.go:425 +0xc2
panic(0x16de180, 0x23b6ed0)
/home/robi/go1.10/src/runtime/panic.go:502 +0x24a
github.com/pingcap/tidb/types.DecimalMul(0xc4218c6bd0, 0xc4218c6c00, 0xc4218c6c30, 0x0, 0x0)
/home/robi/Code/go/src/github.com/pingcap/tidb/types/mydecimal.go:1788 +0xcc4
github.com/pingcap/tidb/expression.(*builtinArithmeticMultiplyDecimalSig).evalDecimal(0xc420665640, 0x0, 0x0, 0x0, 0xc4206fad00, 0x0, 0x0)
/home/robi/Code/go/src/github.com/pingcap/tidb/expression/builtin_arithmetic.go:525 +0x3a3
github.com/pingcap/tidb/expression.(*ScalarFunction).EvalDecimal(0xc421b9f8b0, 0x1a33280, 0xc421f7a9a0, 0x0, 0x0, 0x0, 0xc420264a00, 0x0, 0x0)
/home/robi/Code/go/src/github.com/pingcap/tidb/expression/scalar_function.go:211 +0x89
github.com/pingcap/tidb/expression.(*ScalarFunction).Eval(0xc421b9f8b0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/home/robi/Code/go/src/github.com/pingcap/tidb/expression/scalar_function.go:180 +0x553
github.com/pingcap/tidb/expression.foldConstant(0x1a331c0, 0xc421b9f8b0, 0x0, 0x0, 0x415300)
/home/robi/Code/go/src/github.com/pingcap/tidb/expression/constant_fold.go:102 +0x4a0
github.com/pingcap/tidb/expression.FoldConstant(0x1a331c0, 0xc421b9f8b0, 0x0, 0x0)
/home/robi/Code/go/src/github.com/pingcap/tidb/expression/constant_fold.go:33 +0x45
github.com/pingcap/tidb/expression.NewFunction(0x1a33280, 0xc421f7a9a0, 0x18a098d, 0x3, 0xc420d13260, 0xc422067340, 0x2, 0x2, 0x0, 0x0, ...)
/home/robi/Code/go/src/github.com/pingcap/tidb/expression/scalar_function.go:98 +0x606
github.com/pingcap/tidb/plan.(*expressionRewriter).binaryOpToExpression(0xc4206faaf0, 0xc4216048f0)
/home/robi/Code/go/src/github.com/pingcap/tidb/plan/expression_rewriter.go:844 +0x6cc
github.com/pingcap/tidb/plan.(*expressionRewriter).Leave(0xc4206faaf0, 0x1a073e0, 0xc4216048f0, 0x0, 0x0, 0x7f170842bf00)
/home/robi/Code/go/src/github.com/pingcap/tidb/plan/expression_rewriter.go:697 +0xf90
github.com/pingcap/tidb/ast.(*BinaryOperationExpr).Accept(0xc4216048f0, 0x1a03340, 0xc4206faaf0, 0x0, 0x0, 0xc4202a6700)
/home/robi/Code/go/src/github.com/pingcap/tidb/ast/expressions.go:224 +0x441
github.com/pingcap/tidb/plan.(*planBuilder).rewriteWithPreprocess(0xc421b95a40, 0x1a1cc60, 0xc4216048f0, 0x1a32800, 0xc4217c5900, 0x0, 0xc420818001, 0x0, 0x0, 0x0, ...)
/home/robi/Code/go/src/github.com/pingcap/tidb/plan/expression_rewriter.go:93 +0x33b
github.com/pingcap/tidb/plan.(*planBuilder).rewrite(0xc421b95a40, 0x1a1cc60, 0xc4216048f0, 0x1a32800, 0xc4217c5900, 0x0, 0x1, 0x0, 0x0, 0x0, ...)
/home/robi/Code/go/src/github.com/pingcap/tidb/plan/expression_rewriter.go:61 +0xd8
github.com/pingcap/tidb/plan.(*planBuilder).buildProjection(0xc421b95a40, 0x1a32800, 0xc4217c5900, 0xc4202a6770, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0)
/home/robi/Code/go/src/github.com/pingcap/tidb/plan/logical_plan_builder.go:572 +0x31f
github.com/pingcap/tidb/plan.(*planBuilder).buildSelect(0xc421b95a40, 0xc420dc8b40, 0x0, 0x0)
/home/robi/Code/go/src/github.com/pingcap/tidb/plan/logical_plan_builder.go:1656 +0xc76
github.com/pingcap/tidb/plan.(*planBuilder).build(0xc421b95a40, 0x1a084a0, 0xc420dc8b40, 0x0, 0x0)
/home/robi/Code/go/src/github.com/pingcap/tidb/plan/planbuilder.go:154 +0xa40
github.com/pingcap/tidb/plan.Optimize(0x1a33280, 0xc421f7a9a0, 0x1a084a0, 0xc420dc8b40, 0x1a1d7e0, 0xc4205f8ed0, 0x0, 0x0, 0x0, 0x0)
/home/robi/Code/go/src/github.com/pingcap/tidb/plan/optimizer.go:68 +0x18d
github.com/pingcap/tidb/executor.(*Compiler).Compile(0xc420ceb310, 0x7f1708554e78, 0xc4206f6510, 0x1a11a60, 0xc420dc8b40, 0x0, 0x0, 0x0)
/home/robi/Code/go/src/github.com/pingcap/tidb/executor/compiler.go:48 +0x417
github.com/pingcap/tidb/session.(*session).execute(0xc421f7a9a0, 0x7f1708554e78, 0xc4206f6510, 0xc4207b6001, 0x9e, 0x0, 0x0, 0x0, 0x0, 0x0)
/home/robi/Code/go/src/github.com/pingcap/tidb/session/session.go:870 +0x13d1
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
Release Version: v2.1.0-beta-11-g1f6e12cc5
Git Commit Hash: 1f6e12cc55e534bf514eef212f1091a91b8592c9
Git Branch: HEAD
UTC Build Time: 2018-07-04 06:31:26
GoVersion: go version go1.10.1 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
```
",True,"panic when multiply very big decimal with a very small decimal - 1. What did you do?
```
select -0.0000000000000000000000000000000000000000000000000017382578996420603 * -13890436710184412000000000000000000000000000000000000000000000000000000000000;
```
2. What did you expect to see?
```
+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| -0.0000000000000000000000000000000000000000000000000017382578996420603 * -13890436710184412000000000000000000000000000000000000000000000000000000000000 |
+---------------------------------------------------------------------------------------------------------------------------------------------------------+
| 0.000000000000000000000000000000 |
+---------------------------------------------------------------------------------------------------------------------------------------------------------+
```
3. What did you see instead?
```
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
```
```
2018/07/04 17:41:18.140 conn.go:427: [error] lastCmd select -0.0000000000000000000000000000000000000000000000000017382578996420603 * -13890436710184412000000000000000000000000000000000000000000000000000000000000, runtime error: index out of range, goroutine 11914 [running]:
github.com/pingcap/tidb/server.(*clientConn).Run.func1(0xc42168eea0, 0xc420cebbf0)
/home/robi/Code/go/src/github.com/pingcap/tidb/server/conn.go:425 +0xc2
panic(0x16de180, 0x23b6ed0)
/home/robi/go1.10/src/runtime/panic.go:502 +0x24a
github.com/pingcap/tidb/types.DecimalMul(0xc4218c6bd0, 0xc4218c6c00, 0xc4218c6c30, 0x0, 0x0)
/home/robi/Code/go/src/github.com/pingcap/tidb/types/mydecimal.go:1788 +0xcc4
github.com/pingcap/tidb/expression.(*builtinArithmeticMultiplyDecimalSig).evalDecimal(0xc420665640, 0x0, 0x0, 0x0, 0xc4206fad00, 0x0, 0x0)
/home/robi/Code/go/src/github.com/pingcap/tidb/expression/builtin_arithmetic.go:525 +0x3a3
github.com/pingcap/tidb/expression.(*ScalarFunction).EvalDecimal(0xc421b9f8b0, 0x1a33280, 0xc421f7a9a0, 0x0, 0x0, 0x0, 0xc420264a00, 0x0, 0x0)
/home/robi/Code/go/src/github.com/pingcap/tidb/expression/scalar_function.go:211 +0x89
github.com/pingcap/tidb/expression.(*ScalarFunction).Eval(0xc421b9f8b0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/home/robi/Code/go/src/github.com/pingcap/tidb/expression/scalar_function.go:180 +0x553
github.com/pingcap/tidb/expression.foldConstant(0x1a331c0, 0xc421b9f8b0, 0x0, 0x0, 0x415300)
/home/robi/Code/go/src/github.com/pingcap/tidb/expression/constant_fold.go:102 +0x4a0
github.com/pingcap/tidb/expression.FoldConstant(0x1a331c0, 0xc421b9f8b0, 0x0, 0x0)
/home/robi/Code/go/src/github.com/pingcap/tidb/expression/constant_fold.go:33 +0x45
github.com/pingcap/tidb/expression.NewFunction(0x1a33280, 0xc421f7a9a0, 0x18a098d, 0x3, 0xc420d13260, 0xc422067340, 0x2, 0x2, 0x0, 0x0, ...)
/home/robi/Code/go/src/github.com/pingcap/tidb/expression/scalar_function.go:98 +0x606
github.com/pingcap/tidb/plan.(*expressionRewriter).binaryOpToExpression(0xc4206faaf0, 0xc4216048f0)
/home/robi/Code/go/src/github.com/pingcap/tidb/plan/expression_rewriter.go:844 +0x6cc
github.com/pingcap/tidb/plan.(*expressionRewriter).Leave(0xc4206faaf0, 0x1a073e0, 0xc4216048f0, 0x0, 0x0, 0x7f170842bf00)
/home/robi/Code/go/src/github.com/pingcap/tidb/plan/expression_rewriter.go:697 +0xf90
github.com/pingcap/tidb/ast.(*BinaryOperationExpr).Accept(0xc4216048f0, 0x1a03340, 0xc4206faaf0, 0x0, 0x0, 0xc4202a6700)
/home/robi/Code/go/src/github.com/pingcap/tidb/ast/expressions.go:224 +0x441
github.com/pingcap/tidb/plan.(*planBuilder).rewriteWithPreprocess(0xc421b95a40, 0x1a1cc60, 0xc4216048f0, 0x1a32800, 0xc4217c5900, 0x0, 0xc420818001, 0x0, 0x0, 0x0, ...)
/home/robi/Code/go/src/github.com/pingcap/tidb/plan/expression_rewriter.go:93 +0x33b
github.com/pingcap/tidb/plan.(*planBuilder).rewrite(0xc421b95a40, 0x1a1cc60, 0xc4216048f0, 0x1a32800, 0xc4217c5900, 0x0, 0x1, 0x0, 0x0, 0x0, ...)
/home/robi/Code/go/src/github.com/pingcap/tidb/plan/expression_rewriter.go:61 +0xd8
github.com/pingcap/tidb/plan.(*planBuilder).buildProjection(0xc421b95a40, 0x1a32800, 0xc4217c5900, 0xc4202a6770, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0)
/home/robi/Code/go/src/github.com/pingcap/tidb/plan/logical_plan_builder.go:572 +0x31f
github.com/pingcap/tidb/plan.(*planBuilder).buildSelect(0xc421b95a40, 0xc420dc8b40, 0x0, 0x0)
/home/robi/Code/go/src/github.com/pingcap/tidb/plan/logical_plan_builder.go:1656 +0xc76
github.com/pingcap/tidb/plan.(*planBuilder).build(0xc421b95a40, 0x1a084a0, 0xc420dc8b40, 0x0, 0x0)
/home/robi/Code/go/src/github.com/pingcap/tidb/plan/planbuilder.go:154 +0xa40
github.com/pingcap/tidb/plan.Optimize(0x1a33280, 0xc421f7a9a0, 0x1a084a0, 0xc420dc8b40, 0x1a1d7e0, 0xc4205f8ed0, 0x0, 0x0, 0x0, 0x0)
/home/robi/Code/go/src/github.com/pingcap/tidb/plan/optimizer.go:68 +0x18d
github.com/pingcap/tidb/executor.(*Compiler).Compile(0xc420ceb310, 0x7f1708554e78, 0xc4206f6510, 0x1a11a60, 0xc420dc8b40, 0x0, 0x0, 0x0)
/home/robi/Code/go/src/github.com/pingcap/tidb/executor/compiler.go:48 +0x417
github.com/pingcap/tidb/session.(*session).execute(0xc421f7a9a0, 0x7f1708554e78, 0xc4206f6510, 0xc4207b6001, 0x9e, 0x0, 0x0, 0x0, 0x0, 0x0)
/home/robi/Code/go/src/github.com/pingcap/tidb/session/session.go:870 +0x13d1
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
Release Version: v2.1.0-beta-11-g1f6e12cc5
Git Commit Hash: 1f6e12cc55e534bf514eef212f1091a91b8592c9
Git Branch: HEAD
UTC Build Time: 2018-07-04 06:31:26
GoVersion: go version go1.10.1 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
```
",1,panic when multiply very big decimal with a very small decimal what did you do select what did you expect to see what did you see instead error mysql server has gone away no connection trying to reconnect conn go lastcmd select runtime error index out of range goroutine github com pingcap tidb server clientconn run home robi code go src github com pingcap tidb server conn go panic home robi src runtime panic go github com pingcap tidb types decimalmul home robi code go src github com pingcap tidb types mydecimal go github com pingcap tidb expression builtinarithmeticmultiplydecimalsig evaldecimal home robi code go src github com pingcap tidb expression builtin arithmetic go github com pingcap tidb expression scalarfunction evaldecimal home robi code go src github com pingcap tidb expression scalar function go github com pingcap tidb expression scalarfunction eval home robi code go src github com pingcap tidb expression scalar function go github com pingcap tidb expression foldconstant home robi code go src github com pingcap tidb expression constant fold go github com pingcap tidb expression foldconstant home robi code go src github com pingcap tidb expression constant fold go github com pingcap tidb expression newfunction home robi code go src github com pingcap tidb expression scalar function go github com pingcap tidb plan expressionrewriter binaryoptoexpression home robi code go src github com pingcap tidb plan expression rewriter go github com pingcap tidb plan expressionrewriter leave home robi code go src github com pingcap tidb plan expression rewriter go github com pingcap tidb ast binaryoperationexpr accept home robi code go src github com pingcap tidb ast expressions go github com pingcap tidb plan planbuilder rewritewithpreprocess home robi code go src github com pingcap tidb plan expression rewriter go github com pingcap tidb plan planbuilder rewrite home robi code go src github com pingcap tidb plan expression rewriter go github com pingcap tidb plan planbuilder buildprojection home robi code go src github com pingcap tidb plan logical plan builder go github com pingcap tidb plan planbuilder buildselect home robi code go src github com pingcap tidb plan logical plan builder go github com pingcap tidb plan planbuilder build home robi code go src github com pingcap tidb plan planbuilder go github com pingcap tidb plan optimize home robi code go src github com pingcap tidb plan optimizer go github com pingcap tidb executor compiler compile home robi code go src github com pingcap tidb executor compiler go github com pingcap tidb session session execute home robi code go src github com pingcap tidb session session go what version of tidb are you using tidb server v or run select tidb version on tidb release version beta git commit hash git branch head utc build time goversion go version linux race enabled false tikv min version alpha ,1
16360,22048867799.0,IssuesEvent,2022-05-30 06:38:28,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,please support savepoint,type/compatibility type/feature-request feature/accepted,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
START TRANSACTION;
SELECT 1 FROM dual;
SAVEPOINT save1;
SELECT 1 FROM dual;
ROLLBACK TO SAVEPOINT save1;
COMMIT;
```
2. What did you expect to see?
All statements succeed.
3. What did you see instead?
```sql
mysql> START TRANSACTION;
Query OK, 0 rows affected (0.00 sec)
mysql> SELECT 1 FROM dual;
+---+
| 1 |
+---+
| 1 |
+---+
1 row in set (0.00 sec)
mysql> SAVEPOINT save1;
ERROR 1064 (42000): 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 9 near ""SAVEPOINT save1""
mysql> SELECT 1 FROM dual;
+---+
| 1 |
+---+
| 1 |
+---+
1 row in set (0.00 sec)
mysql> ROLLBACK TO SAVEPOINT save1;
ERROR 1064 (42000): 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 11 near ""TO SAVEPOINT save1""
mysql> COMMIT;
Query OK, 0 rows affected (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
Release Version: v2.1.0-alpha-48-ge2c8c4e
Git Commit Hash: e2c8c4e9758b038b24fc05794a266a678570f7a6
Git Branch: master
UTC Build Time: 2018-06-13 12:05:19
GoVersion: go version go1.10.2 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-c4133d3ef0f099f8716a916c198390b26293ec00
",True,"please support savepoint - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
START TRANSACTION;
SELECT 1 FROM dual;
SAVEPOINT save1;
SELECT 1 FROM dual;
ROLLBACK TO SAVEPOINT save1;
COMMIT;
```
2. What did you expect to see?
All statements succeed.
3. What did you see instead?
```sql
mysql> START TRANSACTION;
Query OK, 0 rows affected (0.00 sec)
mysql> SELECT 1 FROM dual;
+---+
| 1 |
+---+
| 1 |
+---+
1 row in set (0.00 sec)
mysql> SAVEPOINT save1;
ERROR 1064 (42000): 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 9 near ""SAVEPOINT save1""
mysql> SELECT 1 FROM dual;
+---+
| 1 |
+---+
| 1 |
+---+
1 row in set (0.00 sec)
mysql> ROLLBACK TO SAVEPOINT save1;
ERROR 1064 (42000): 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 11 near ""TO SAVEPOINT save1""
mysql> COMMIT;
Query OK, 0 rows affected (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
Release Version: v2.1.0-alpha-48-ge2c8c4e
Git Commit Hash: e2c8c4e9758b038b24fc05794a266a678570f7a6
Git Branch: master
UTC Build Time: 2018-06-13 12:05:19
GoVersion: go version go1.10.2 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-c4133d3ef0f099f8716a916c198390b26293ec00
",1,please support savepoint please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error sql start transaction select from dual savepoint select from dual rollback to savepoint commit what did you expect to see all statements succeed what did you see instead sql mysql start transaction query ok rows affected sec mysql select from dual row in set sec mysql savepoint error you have an error in your sql syntax check the manual that corresponds to your tidb version for the right syntax to use line column near savepoint mysql select from dual row in set sec mysql rollback to savepoint error you have an error in your sql syntax check the manual that corresponds to your tidb version for the right syntax to use line column near to savepoint mysql commit query ok rows affected sec what version of tidb are you using tidb server v or run select tidb version on tidb release version alpha git commit hash git branch master utc build time goversion go version linux race enabled false tikv min version alpha ,1
6991,9284638287.0,IssuesEvent,2019-03-21 02:41:43,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,Need to check and fix more types in `shou (full) columns`,type/compatibility,"## General Question
As https://github.com/pingcap/tidb/pull/9810 discussed, we should check more types in `show columns` and ` show full columns`, and fix it!",True,"Need to check and fix more types in `shou (full) columns` - ## General Question
As https://github.com/pingcap/tidb/pull/9810 discussed, we should check more types in `show columns` and ` show full columns`, and fix it!",1,need to check and fix more types in shou full columns general question as discussed we should check more types in show columns and show full columns and fix it ,1
11624,13671944268.0,IssuesEvent,2020-09-29 07:48:08,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,_utf8 not supported,component/parser type/compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
select left(_utf8 0xD0B0D0B1D0B2,1)
```
2. What did you expect to see?
```
mysql> select left(_utf8 0xD0B0D0B1D0B2,1);
+------------------------------+
| left(_utf8 0xD0B0D0B1D0B2,1) |
+------------------------------+
| а |
+------------------------------+
1 row in set (0.01 sec)
```
3. What did you see instead?
```
mysql> select left(_utf8 0xD0B0D0B1D0B2,1);
ERROR 1105 (HY000): line 0 column 32 near "",1)"" (total length 35)
```
4. What version of TiDB are you using (`tidb-server -V`)?
",True,"_utf8 not supported - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
select left(_utf8 0xD0B0D0B1D0B2,1)
```
2. What did you expect to see?
```
mysql> select left(_utf8 0xD0B0D0B1D0B2,1);
+------------------------------+
| left(_utf8 0xD0B0D0B1D0B2,1) |
+------------------------------+
| а |
+------------------------------+
1 row in set (0.01 sec)
```
3. What did you see instead?
```
mysql> select left(_utf8 0xD0B0D0B1D0B2,1);
ERROR 1105 (HY000): line 0 column 32 near "",1)"" (total length 35)
```
4. What version of TiDB are you using (`tidb-server -V`)?
",1, not supported please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error sql select left what did you expect to see mysql select left left а row in set sec what did you see instead mysql select left error line column near total length what version of tidb are you using tidb server v ,1
20413,30191146881.0,IssuesEvent,2023-07-04 15:29:16,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,TiDB should support query argument with type `MYSQL_TIMESTAMP_DATETIME_TZ`,type/bug component/mysql-protocol severity/minor compatibility-mysql8,"## Enhancement
Now TiDB can only handle three different kinds of date arguments:
```go
case mysql.TypeDate, mysql.TypeTimestamp, mysql.TypeDatetime:
if len(paramValues) < (pos + 1) {
err = mysql.ErrMalformPacket
return
}
// See https://dev.mysql.com/doc/internals/en/binary-protocol-value.html
// for more details.
length := paramValues[pos]
pos++
switch length {
case 0:
tmp = types.ZeroDatetimeStr
case 4:
pos, tmp = binaryDate(pos, paramValues)
case 7:
pos, tmp = binaryDateTime(pos, paramValues)
case 11:
pos, tmp = binaryTimestamp(pos, paramValues)
default:
err = mysql.ErrMalformPacket
return
}
args[i] = types.NewDatum(tmp) // FIXME: After check works!!!!!!
continue
```
It's fine according to the MySQL [document](https://dev.mysql.com/doc/dev/mysql-server/latest/page_protocol_binary_resultset.html#sect_protocol_binary_resultset_row_value_date), but the mysql c connector can pass an argument with TZ information, whose length is 13.
See the `test_time_zone` in the mysql client test:
```
MYSQL_TIME mt{2011,
02,
03,
04,
05,
06,
123456,
false,
MYSQL_TIMESTAMP_DATETIME_TZ,
12 * SECS_PER_HOUR + 34 * SECS_PER_MIN};
```",True,"TiDB should support query argument with type `MYSQL_TIMESTAMP_DATETIME_TZ` - ## Enhancement
Now TiDB can only handle three different kinds of date arguments:
```go
case mysql.TypeDate, mysql.TypeTimestamp, mysql.TypeDatetime:
if len(paramValues) < (pos + 1) {
err = mysql.ErrMalformPacket
return
}
// See https://dev.mysql.com/doc/internals/en/binary-protocol-value.html
// for more details.
length := paramValues[pos]
pos++
switch length {
case 0:
tmp = types.ZeroDatetimeStr
case 4:
pos, tmp = binaryDate(pos, paramValues)
case 7:
pos, tmp = binaryDateTime(pos, paramValues)
case 11:
pos, tmp = binaryTimestamp(pos, paramValues)
default:
err = mysql.ErrMalformPacket
return
}
args[i] = types.NewDatum(tmp) // FIXME: After check works!!!!!!
continue
```
It's fine according to the MySQL [document](https://dev.mysql.com/doc/dev/mysql-server/latest/page_protocol_binary_resultset.html#sect_protocol_binary_resultset_row_value_date), but the mysql c connector can pass an argument with TZ information, whose length is 13.
See the `test_time_zone` in the mysql client test:
```
MYSQL_TIME mt{2011,
02,
03,
04,
05,
06,
123456,
false,
MYSQL_TIMESTAMP_DATETIME_TZ,
12 * SECS_PER_HOUR + 34 * SECS_PER_MIN};
```",1,tidb should support query argument with type mysql timestamp datetime tz enhancement now tidb can only handle three different kinds of date arguments go case mysql typedate mysql typetimestamp mysql typedatetime if len paramvalues pos err mysql errmalformpacket return see for more details length paramvalues pos switch length case tmp types zerodatetimestr case pos tmp binarydate pos paramvalues case pos tmp binarydatetime pos paramvalues case pos tmp binarytimestamp pos paramvalues default err mysql errmalformpacket return args types newdatum tmp fixme after check works continue it s fine according to the mysql but the mysql c connector can pass an argument with tz information whose length is see the test time zone in the mysql client test mysql time mt false mysql timestamp datetime tz secs per hour secs per min ,1
6415,8713685984.0,IssuesEvent,2018-12-07 03:55:51,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Character set name is case sensitive in TiDB,type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
I use mydumper from version 1. 0 dumper to version 2. 0. 8.for example, character sets are case-sensitive.
2. What did you expect to see?
I can loader to 2.0.8
3. What did you see instead?
dumper sql:
create table test
(id int)
ENGINE=InnoDB DEFAULT CHARSET=UTF8 COLLATE=UTF8_BIN;
Can't recognize UTF8, if I change to utf8, it can be created
Is there a parameter that can be controlled case-sensitive
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
1.0.8 to 2.0.8
",True,"Character set name is case sensitive in TiDB - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
I use mydumper from version 1. 0 dumper to version 2. 0. 8.for example, character sets are case-sensitive.
2. What did you expect to see?
I can loader to 2.0.8
3. What did you see instead?
dumper sql:
create table test
(id int)
ENGINE=InnoDB DEFAULT CHARSET=UTF8 COLLATE=UTF8_BIN;
Can't recognize UTF8, if I change to utf8, it can be created
Is there a parameter that can be controlled case-sensitive
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
1.0.8 to 2.0.8
",1,character set name is case sensitive in tidb bug report please answer these questions before submitting your issue thanks what did you do i use mydumper from version dumper to version for example character sets are case sensitive what did you expect to see i can loader to what did you see instead dumper sql create table test id int engine innodb default charset collate bin can t recognize if i change to it can be created is there a parameter that can be controlled case sensitive what version of tidb are you using tidb server v or run select tidb version on tidb to ,1
5514,7974891155.0,IssuesEvent,2018-07-17 07:36:29,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,decimals flag in timediff response is incorrect,component/expression type/compatibility,"1. What did you do?
use MySQL-client to connect TiDB with `--column-type-info` argument.
execute:
```
select timediff('2004-12-30 12:00:00.1', cast('2004-12-30 12:00:01' as datetime));
```
2. What did you expect to see?
```
mysql> select timediff('2004-12-30 12:00:00.1', cast('2004-12-30 12:00:01' as datetime));
Field 1: `timediff('2004-12-30 12:00:00.1', cast('2004-12-30 12:00:01' as datetime))`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: TIME
Collation: binary (63)
Length: 12
Max_length: 11
Decimals: 1
Flags: BINARY
+----------------------------------------------------------------------------+
| timediff('2004-12-30 12:00:00.1', cast('2004-12-30 12:00:01' as datetime)) |
+----------------------------------------------------------------------------+
| -00:00:00.9 |
+----------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
we hope `Decimals: 1`
3. What did you see instead?
```
mysql> select timediff('2004-12-30 12:00:00.1', cast('2004-12-30 12:00:01' as datetime));
Field 1: `timediff('2004-12-30 12:00:00.1', cast('2004-12-30 12:00:01' as datetime))`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: TIME
Collation: binary (63)
Length: 60
Max_length: 11
Decimals: 0
Flags: BINARY
+----------------------------------------------------------------------------+
| timediff('2004-12-30 12:00:00.1', cast('2004-12-30 12:00:01' as datetime)) |
+----------------------------------------------------------------------------+
| -00:00:00.9 |
+----------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
but got `Decimals: 0`
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
Release Version: v2.1.0-beta-1-gc8bae7fa7
Git Commit Hash: c8bae7fa779f70358efa696c06f2319391079c1d
Git Branch: dev-reduce-duration-memory
UTC Build Time: 2018-07-02 03:52:32
GoVersion: go version go1.10.1 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
```
",True,"decimals flag in timediff response is incorrect - 1. What did you do?
use MySQL-client to connect TiDB with `--column-type-info` argument.
execute:
```
select timediff('2004-12-30 12:00:00.1', cast('2004-12-30 12:00:01' as datetime));
```
2. What did you expect to see?
```
mysql> select timediff('2004-12-30 12:00:00.1', cast('2004-12-30 12:00:01' as datetime));
Field 1: `timediff('2004-12-30 12:00:00.1', cast('2004-12-30 12:00:01' as datetime))`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: TIME
Collation: binary (63)
Length: 12
Max_length: 11
Decimals: 1
Flags: BINARY
+----------------------------------------------------------------------------+
| timediff('2004-12-30 12:00:00.1', cast('2004-12-30 12:00:01' as datetime)) |
+----------------------------------------------------------------------------+
| -00:00:00.9 |
+----------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
we hope `Decimals: 1`
3. What did you see instead?
```
mysql> select timediff('2004-12-30 12:00:00.1', cast('2004-12-30 12:00:01' as datetime));
Field 1: `timediff('2004-12-30 12:00:00.1', cast('2004-12-30 12:00:01' as datetime))`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: TIME
Collation: binary (63)
Length: 60
Max_length: 11
Decimals: 0
Flags: BINARY
+----------------------------------------------------------------------------+
| timediff('2004-12-30 12:00:00.1', cast('2004-12-30 12:00:01' as datetime)) |
+----------------------------------------------------------------------------+
| -00:00:00.9 |
+----------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
but got `Decimals: 0`
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
Release Version: v2.1.0-beta-1-gc8bae7fa7
Git Commit Hash: c8bae7fa779f70358efa696c06f2319391079c1d
Git Branch: dev-reduce-duration-memory
UTC Build Time: 2018-07-02 03:52:32
GoVersion: go version go1.10.1 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
```
",1,decimals flag in timediff response is incorrect what did you do use mysql client to connect tidb with column type info argument execute select timediff cast as datetime what did you expect to see mysql select timediff cast as datetime field timediff cast as datetime catalog def database table org table type time collation binary length max length decimals flags binary timediff cast as datetime row in set sec we hope decimals what did you see instead mysql select timediff cast as datetime field timediff cast as datetime catalog def database table org table type time collation binary length max length decimals flags binary timediff cast as datetime row in set sec but got decimals what version of tidb are you using tidb server v or run select tidb version on tidb release version beta git commit hash git branch dev reduce duration memory utc build time goversion go version linux race enabled false tikv min version alpha ,1
6231,8633471784.0,IssuesEvent,2018-11-22 13:58:19,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,support show hash partition table.,help wanted type/compatibility,"## Bug Report
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
set @@session.tidb_enable_table_partition = 'on';
create table th (
a int,
b int
) partition by hash(a) partitions 4;
```
2. What did you expect to see?
mysql:
```sql
mysql root@127.0.0.1:test> show create table th;
+-------+----------------------------------------+
| Table | Create Table |
+-------+----------------------------------------+
| th | CREATE TABLE `th` ( |
| | `a` int(11) DEFAULT NULL, |
| | `b` int(11) DEFAULT NULL |
| | ) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
| | /*!50100 PARTITION BY HASH (a) |
| | PARTITIONS 4 */ |
+-------+----------------------------------------+
```
or
```sql
mysql root@127.0.0.1:test> show create table th;
+-------+----------------------------------------+
| Table | Create Table |
+-------+----------------------------------------+
| th | CREATE TABLE `th` ( |
| | `a` int(11) DEFAULT NULL, |
| | `b` int(11) DEFAULT NULL |
| | ) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
| | PARTITION BY HASH (a) |
| | PARTITIONS 4 |
+-------+----------------------------------------+
```
3. What did you see instead?
```sql
+-------+-------------------------------------------------------------+
| Table | Create Table |
+-------+-------------------------------------------------------------+
| th | CREATE TABLE `th` ( |
| | `a` int(11) DEFAULT NULL, |
| | `b` int(11) DEFAULT NULL |
| | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin |
| | PARTITION BY HASH ( `a` ) ( |
| | PARTITION VALUES LESS THAN (), |
| | PARTITION VALUES LESS THAN (), |
| | PARTITION VALUES LESS THAN (), |
| | PARTITION VALUES LESS THAN () |
| | ) |
+-------+-------------------------------------------------------------+
```
Related issue:
https://github.com/pingcap/tidb/issues/7907
",True,"support show hash partition table. - ## Bug Report
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
set @@session.tidb_enable_table_partition = 'on';
create table th (
a int,
b int
) partition by hash(a) partitions 4;
```
2. What did you expect to see?
mysql:
```sql
mysql root@127.0.0.1:test> show create table th;
+-------+----------------------------------------+
| Table | Create Table |
+-------+----------------------------------------+
| th | CREATE TABLE `th` ( |
| | `a` int(11) DEFAULT NULL, |
| | `b` int(11) DEFAULT NULL |
| | ) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
| | /*!50100 PARTITION BY HASH (a) |
| | PARTITIONS 4 */ |
+-------+----------------------------------------+
```
or
```sql
mysql root@127.0.0.1:test> show create table th;
+-------+----------------------------------------+
| Table | Create Table |
+-------+----------------------------------------+
| th | CREATE TABLE `th` ( |
| | `a` int(11) DEFAULT NULL, |
| | `b` int(11) DEFAULT NULL |
| | ) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
| | PARTITION BY HASH (a) |
| | PARTITIONS 4 |
+-------+----------------------------------------+
```
3. What did you see instead?
```sql
+-------+-------------------------------------------------------------+
| Table | Create Table |
+-------+-------------------------------------------------------------+
| th | CREATE TABLE `th` ( |
| | `a` int(11) DEFAULT NULL, |
| | `b` int(11) DEFAULT NULL |
| | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin |
| | PARTITION BY HASH ( `a` ) ( |
| | PARTITION VALUES LESS THAN (), |
| | PARTITION VALUES LESS THAN (), |
| | PARTITION VALUES LESS THAN (), |
| | PARTITION VALUES LESS THAN () |
| | ) |
+-------+-------------------------------------------------------------+
```
Related issue:
https://github.com/pingcap/tidb/issues/7907
",1,support show hash partition table bug report what did you do if possible provide a recipe for reproducing the error sql set session tidb enable table partition on create table th a int b int partition by hash a partitions what did you expect to see mysql sql mysql root test show create table th table create table th create table th a int default null b int default null engine innodb default charset partition by hash a partitions or sql mysql root test show create table th table create table th create table th a int default null b int default null engine innodb default charset partition by hash a partitions what did you see instead sql table create table th create table th a int default null b int default null engine innodb default charset collate bin partition by hash a partition values less than partition values less than partition values less than partition values less than related issue ,1
11103,13129825155.0,IssuesEvent,2020-08-06 14:28:13,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,"SELECT 'a'='a ' , 'a'='A' , 'a'='A ' not same to MySQL in TiDB",type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sh
mysql> select 'a'='a ' , 'a'='A' , 'a'='A ';
```
2. What did you expect to see?
```sh
mysql> select 'a'='a ' , 'a'='A' , 'a'='A ';
'a'='a ' 'a'='A' 'a'='A '
1 1 1
```
3. What did you see instead?
```sh
mysql> select 'a'='a ' , 'a'='A' , 'a'='A ';
'a'='a ' 'a'='A' 'a'='A '
0 0 0
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
tidb-server(e1ba30914)
more details: https://asktug.com/t/mysqlslap-tidb-varbinary-varchar-select-bug/1434",True,"SELECT 'a'='a ' , 'a'='A' , 'a'='A ' not same to MySQL in TiDB - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sh
mysql> select 'a'='a ' , 'a'='A' , 'a'='A ';
```
2. What did you expect to see?
```sh
mysql> select 'a'='a ' , 'a'='A' , 'a'='A ';
'a'='a ' 'a'='A' 'a'='A '
1 1 1
```
3. What did you see instead?
```sh
mysql> select 'a'='a ' , 'a'='A' , 'a'='A ';
'a'='a ' 'a'='A' 'a'='A '
0 0 0
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
tidb-server(e1ba30914)
more details: https://asktug.com/t/mysqlslap-tidb-varbinary-varchar-select-bug/1434",1,select a a a a a a not same to mysql in tidb bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error sh mysql select a a a a a a what did you expect to see sh mysql select a a a a a a a a a a a a what did you see instead sh mysql select a a a a a a a a a a a a what version of tidb are you using tidb server v or run select tidb version on tidb tidb server more details ,1
17568,24221168650.0,IssuesEvent,2022-09-26 11:00:23,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,RC isolation lock behavior not compatible,type/compatibility sig/transaction,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```sql
/* init */ drop table if exists t;
/* init */ create table t (id int primary key, v int, vv int, vvv int);
/* s1 */ SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
/* s2 */ SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
/* s1 */ begin;
/* s2 */ begin;
/* s1 */ insert into t values(1, 2, 3, 4);
/* s2 */ update t set id = 10, v = 20, vv = 30, vvv = 40 where id = 1;
/* s1 */ commit;
/* s2 */ commit;
/* s1 */ select * from t;
```
### 2. What did you expect to see? (Required)
The update statement is blocked by insert's lock and the result of table t is (10, 20, 30, 40).
### 3. What did you see instead (Required)
The update statement is not blocked and affected 0 rows, the result of table t is (1, 2, 3, 4).
### 4. What is your TiDB version? (Required)
```
Release Version: v4.0.0-beta.2-1419-g974c5fa78
Edition: Community
Git Commit Hash: 974c5fa78e69af35879da1494b771f498ebfb1b4
Git Branch: master
UTC Build Time: 2020-10-23 12:06:41
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: fals
```
",True,"RC isolation lock behavior not compatible - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```sql
/* init */ drop table if exists t;
/* init */ create table t (id int primary key, v int, vv int, vvv int);
/* s1 */ SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
/* s2 */ SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
/* s1 */ begin;
/* s2 */ begin;
/* s1 */ insert into t values(1, 2, 3, 4);
/* s2 */ update t set id = 10, v = 20, vv = 30, vvv = 40 where id = 1;
/* s1 */ commit;
/* s2 */ commit;
/* s1 */ select * from t;
```
### 2. What did you expect to see? (Required)
The update statement is blocked by insert's lock and the result of table t is (10, 20, 30, 40).
### 3. What did you see instead (Required)
The update statement is not blocked and affected 0 rows, the result of table t is (1, 2, 3, 4).
### 4. What is your TiDB version? (Required)
```
Release Version: v4.0.0-beta.2-1419-g974c5fa78
Edition: Community
Git Commit Hash: 974c5fa78e69af35879da1494b771f498ebfb1b4
Git Branch: master
UTC Build Time: 2020-10-23 12:06:41
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: fals
```
",1,rc isolation lock behavior not compatible bug report please answer these questions before submitting your issue thanks minimal reproduce step required sql init drop table if exists t init create table t id int primary key v int vv int vvv int set session transaction isolation level read committed set session transaction isolation level read committed begin begin insert into t values update t set id v vv vvv where id commit commit select from t what did you expect to see required the update statement is blocked by insert s lock and the result of table t is what did you see instead required the update statement is not blocked and affected rows the result of table t is what is your tidb version required release version beta edition community git commit hash git branch master utc build time goversion race enabled false tikv min version check table before drop fals ,1
11436,13429756770.0,IssuesEvent,2020-09-07 02:48:26,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,show create sequence always output initial value instead current value for start,severity/major sig/DDL type/bug type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```
mysql> create sequence s;
mysql> select nextval(s);
mysql> select nextval(s);
mysql> select lastval(s);
+------------+
| lastval(s) |
+------------+
| 2 |
+------------+
1 row in set (0.00 sec)
mysql> show create sequence s;
+----------+--------------------------------------------------------------------------------------------------------------------------+
| Sequence | Create Sequence |
+----------+--------------------------------------------------------------------------------------------------------------------------+
| s | CREATE SEQUENCE `s` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=InnoDB |
+----------+--------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
### 2. What did you expect to see? (Required)
show create table should show the `start with` with the value of `nextval(s)` (3)
### 3. What did you see instead (Required)
always the default value (1). This will cause wrong value when use mysqldump or other tools to dump and restore the db data.
### 4. What is your TiDB version? (Required)
```
Release Version: v4.0.0-beta.2-978-ga2e2ce6339
Edition: Community
Git Commit Hash: a2e2ce6339e41ef15f11ef70560506910ff3d3e2
Git Branch: master
UTC Build Time: 2020-08-20 02:28:26
GoVersion: go1.13.12
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
```
",True,"show create sequence always output initial value instead current value for start - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```
mysql> create sequence s;
mysql> select nextval(s);
mysql> select nextval(s);
mysql> select lastval(s);
+------------+
| lastval(s) |
+------------+
| 2 |
+------------+
1 row in set (0.00 sec)
mysql> show create sequence s;
+----------+--------------------------------------------------------------------------------------------------------------------------+
| Sequence | Create Sequence |
+----------+--------------------------------------------------------------------------------------------------------------------------+
| s | CREATE SEQUENCE `s` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=InnoDB |
+----------+--------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
### 2. What did you expect to see? (Required)
show create table should show the `start with` with the value of `nextval(s)` (3)
### 3. What did you see instead (Required)
always the default value (1). This will cause wrong value when use mysqldump or other tools to dump and restore the db data.
### 4. What is your TiDB version? (Required)
```
Release Version: v4.0.0-beta.2-978-ga2e2ce6339
Edition: Community
Git Commit Hash: a2e2ce6339e41ef15f11ef70560506910ff3d3e2
Git Branch: master
UTC Build Time: 2020-08-20 02:28:26
GoVersion: go1.13.12
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
```
",1,show create sequence always output initial value instead current value for start bug report please answer these questions before submitting your issue thanks minimal reproduce step required mysql create sequence s mysql select nextval s mysql select nextval s mysql select lastval s lastval s row in set sec mysql show create sequence s sequence create sequence s create sequence s start with minvalue maxvalue increment by cache nocycle engine innodb row in set sec what did you expect to see required show create table should show the start with with the value of nextval s what did you see instead required always the default value this will cause wrong value when use mysqldump or other tools to dump and restore the db data what is your tidb version required release version beta edition community git commit hash git branch master utc build time goversion race enabled false tikv min version check table before drop false ,1
6253,8641584098.0,IssuesEvent,2018-11-24 19:18:29,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Separator and order by not supported in group_concat,help wanted type/compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
create table t1 (grp int, a bigint unsigned, c char(10) not null, d char(10) not null);
insert into t1 values (1,1,""a"",""a"");
insert into t1 values (2,2,""b"",""a"");
insert into t1 values (2,3,""c"",""b"");
insert into t1 values (3,4,""E"",""a"");
insert into t1 values (3,5,""C"",""b"");
select grp,group_concat(c separator "","") from t1 group by grp;
select grp,group_concat(c order by c) from t1 group by grp;
```
2. What did you expect to see?
```
grp group_concat(c separator "","")
1 a
2 b,c
3 E,C
grp group_concat(c order by c)
1 a
2 b,c
3 C,E
```
3. What did you see instead?
```
ERROR 1105 (HY000) at line 7: line 0 column 35 near "" "","") from t1 group by grp"" (total length 61)
```
4. What version of TiDB are you using (`tidb-server -V`)?
",True,"Separator and order by not supported in group_concat - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
create table t1 (grp int, a bigint unsigned, c char(10) not null, d char(10) not null);
insert into t1 values (1,1,""a"",""a"");
insert into t1 values (2,2,""b"",""a"");
insert into t1 values (2,3,""c"",""b"");
insert into t1 values (3,4,""E"",""a"");
insert into t1 values (3,5,""C"",""b"");
select grp,group_concat(c separator "","") from t1 group by grp;
select grp,group_concat(c order by c) from t1 group by grp;
```
2. What did you expect to see?
```
grp group_concat(c separator "","")
1 a
2 b,c
3 E,C
grp group_concat(c order by c)
1 a
2 b,c
3 C,E
```
3. What did you see instead?
```
ERROR 1105 (HY000) at line 7: line 0 column 35 near "" "","") from t1 group by grp"" (total length 61)
```
4. What version of TiDB are you using (`tidb-server -V`)?
",1,separator and order by not supported in group concat please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error sql create table grp int a bigint unsigned c char not null d char not null insert into values a a insert into values b a insert into values c b insert into values e a insert into values c b select grp group concat c separator from group by grp select grp group concat c order by c from group by grp what did you expect to see grp group concat c separator a b c e c grp group concat c order by c a b c c e what did you see instead error at line line column near from group by grp total length what version of tidb are you using tidb server v ,1
8677,10605717161.0,IssuesEvent,2019-10-10 21:08:22,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,GUI client can't not show the rows of the table ,type/compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
The navicat client always shows rows and data length of 100, which cannot display these two values correctly. So are tools like heidisql.
2. What did you expect to see?
The GUI client displays the rows and data length values in the table correctly.
3. What did you see instead?
The GUI client displays the rows and data length values in the table correctly.
4. What version of TiDB are you using (`tidb-server -V`)?
Git Commit Hash: 6921161fde5c74c66d022f98ff9c793a0d37f148
UTC Build Time: 2017-08-01 03:35:43
navicat v12.0.x(MAC)
",True,"GUI client can't not show the rows of the table - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
The navicat client always shows rows and data length of 100, which cannot display these two values correctly. So are tools like heidisql.
2. What did you expect to see?
The GUI client displays the rows and data length values in the table correctly.
3. What did you see instead?
The GUI client displays the rows and data length values in the table correctly.
4. What version of TiDB are you using (`tidb-server -V`)?
Git Commit Hash: 6921161fde5c74c66d022f98ff9c793a0d37f148
UTC Build Time: 2017-08-01 03:35:43
navicat v12.0.x(MAC)
",1,gui client can t not show the rows of the table please answer these questions before submitting your issue thanks what did you do the navicat client always shows rows and data length of which cannot display these two values correctly so are tools like heidisql what did you expect to see the gui client displays the rows and data length values in the table correctly what did you see instead the gui client displays the rows and data length values in the table correctly what version of tidb are you using tidb server v git commit hash utc build time navicat x mac ,1
10980,13003664847.0,IssuesEvent,2020-07-24 07:19:23,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Wrong original column returned,type/bug type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
`select if(1, x, x) as a from t`.
2. What did you expect to see?
ColName is `a`, original column name is empty.
3. What did you see instead?
Both colName and orignal column name is `a`.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
",True,"Wrong original column returned - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
`select if(1, x, x) as a from t`.
2. What did you expect to see?
ColName is `a`, original column name is empty.
3. What did you see instead?
Both colName and orignal column name is `a`.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
",1,wrong original column returned bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error select if x x as a from t what did you expect to see colname is a original column name is empty what did you see instead both colname and orignal column name is a what version of tidb are you using tidb server v or run select tidb version on tidb ,1
13244,15608308865.0,IssuesEvent,2021-03-19 10:26:32,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,The result of bitwise OR is incorrect ,sig/execution type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```mysql
create table t1(col1 float);
insert into t1 values(3|111111114);
```
### 2. What did you expect to see? (Required)
```mysql
mysql> select * from t1;
+-----------+
| col1 |
+-----------+
| 111111000 |
+-----------+
1 row in set (0.06 sec)
```
### 3. What did you see instead (Required)
```mysql
MySQL [test]> select * from t1;
+-----------+
| col1 |
+-----------+
| 111111110 |
+-----------+
1 row in set (0.00 sec)
```
### 4. What is your TiDB version? (Required)
```mysql
Release Version: v4.0.11
Edition: Community
Git Commit Hash: 058e52ad7c1b477147dcb933b3f1b3b2be31e998
Git Branch: heads/refs/tags/v4.0.11
UTC Build Time: 2021-02-25 04:33:58
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
```
",True,"The result of bitwise OR is incorrect - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```mysql
create table t1(col1 float);
insert into t1 values(3|111111114);
```
### 2. What did you expect to see? (Required)
```mysql
mysql> select * from t1;
+-----------+
| col1 |
+-----------+
| 111111000 |
+-----------+
1 row in set (0.06 sec)
```
### 3. What did you see instead (Required)
```mysql
MySQL [test]> select * from t1;
+-----------+
| col1 |
+-----------+
| 111111110 |
+-----------+
1 row in set (0.00 sec)
```
### 4. What is your TiDB version? (Required)
```mysql
Release Version: v4.0.11
Edition: Community
Git Commit Hash: 058e52ad7c1b477147dcb933b3f1b3b2be31e998
Git Branch: heads/refs/tags/v4.0.11
UTC Build Time: 2021-02-25 04:33:58
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
```
",1,the result of bitwise or is incorrect bug report please answer these questions before submitting your issue thanks minimal reproduce step required mysql create table float insert into values what did you expect to see required mysql mysql select from row in set sec what did you see instead required mysql mysql select from row in set sec what is your tidb version required mysql release version edition community git commit hash git branch heads refs tags utc build time goversion race enabled false tikv min version check table before drop false ,1
11030,13065156815.0,IssuesEvent,2020-07-30 19:19:18,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,no support of type `long`,type/compatibility,"
In MySQL:
``` sql
mysql> create table t (a long not null);
Query OK, 0 rows affected (0.03 sec)
```
In TiDB:
``` sql
tidb> create table t (a long not null);
ERROR 1105 (HY000): line 0 column 22 near "" not null)"" (total length 32)
```
What version of TiDB are you using (`tidb-server -V`)?
```
Git Commit Hash: 91fa992f1da80f1065891bb80d81b7f20a883ef7
UTC Build Time: 2017-07-28 04:30:15
```",True,"no support of type `long` -
In MySQL:
``` sql
mysql> create table t (a long not null);
Query OK, 0 rows affected (0.03 sec)
```
In TiDB:
``` sql
tidb> create table t (a long not null);
ERROR 1105 (HY000): line 0 column 22 near "" not null)"" (total length 32)
```
What version of TiDB are you using (`tidb-server -V`)?
```
Git Commit Hash: 91fa992f1da80f1065891bb80d81b7f20a883ef7
UTC Build Time: 2017-07-28 04:30:15
```",1,no support of type long in mysql sql mysql create table t a long not null query ok rows affected sec in tidb sql tidb create table t a long not null error line column near not null total length what version of tidb are you using tidb server v git commit hash utc build time ,1
6434,8728917455.0,IssuesEvent,2018-12-10 18:45:20,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,user-defined variables contains special character compability.,type/compatibility,"MySQL:
```
mysql> SET @t!=1;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '!=1' at line 1
mysql> SET @""t!""=1;
Query OK, 0 rows affected (0.00 sec)
```
TiDB:
```
mysql> SET @t!=1;
ERROR 1105 (HY000): line 0 column 8 near ""1"" (total length 9)
mysql> SET @""t!""=1;
ERROR 1105 (HY000): line 0 column 5 near """"t!""=1"" (total length 11)
```
See https://dev.mysql.com/doc/refman/5.7/en/user-variables.html
",True,"user-defined variables contains special character compability. - MySQL:
```
mysql> SET @t!=1;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '!=1' at line 1
mysql> SET @""t!""=1;
Query OK, 0 rows affected (0.00 sec)
```
TiDB:
```
mysql> SET @t!=1;
ERROR 1105 (HY000): line 0 column 8 near ""1"" (total length 9)
mysql> SET @""t!""=1;
ERROR 1105 (HY000): line 0 column 5 near """"t!""=1"" (total length 11)
```
See https://dev.mysql.com/doc/refman/5.7/en/user-variables.html
",1,user defined variables contains special character compability mysql mysql set t error you have an error in your sql syntax check the manual that corresponds to your mysql server version for the right syntax to use near at line mysql set t query ok rows affected sec tidb mysql set t error line column near total length mysql set t error line column near t total length see ,1
3589,6498193024.0,IssuesEvent,2017-08-22 16:26:53,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Behavior of UTC_DATE() is different from mysql,compatibility help wanted,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
select UTC_DATE();
select UTC_DATE() + 2;
```
2. What did you expect to see?
```
mysql> select UTC_DATE();
+------------+
| UTC_DATE() |
+------------+
| 2017-08-22 |
+------------+
1 row in set (0.00 sec)
mysql> select UTC_DATE() + 2;
+----------------+
| UTC_DATE() + 2 |
+----------------+
| 20170824 |
+----------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
```
MySQL [(none)]> select UTC_DATE();
+------------+
| UTC_DATE() |
+------------+
| 2017-08-22 |
+------------+
1 row in set (0.00 sec)
MySQL [(none)]> select UTC_DATE() + 2;
+----------------+
| UTC_DATE() + 2 |
+----------------+
| 2019 |
+----------------+
1 row in set, 1 warning (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V`)?
Git Commit Hash: 365e4ab491b683a69c2004f30b1ae4f86256e2ad
Git Commit Branch: master
UTC Build Time: 2017-08-16 01:24:27
",True,"Behavior of UTC_DATE() is different from mysql - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
select UTC_DATE();
select UTC_DATE() + 2;
```
2. What did you expect to see?
```
mysql> select UTC_DATE();
+------------+
| UTC_DATE() |
+------------+
| 2017-08-22 |
+------------+
1 row in set (0.00 sec)
mysql> select UTC_DATE() + 2;
+----------------+
| UTC_DATE() + 2 |
+----------------+
| 20170824 |
+----------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
```
MySQL [(none)]> select UTC_DATE();
+------------+
| UTC_DATE() |
+------------+
| 2017-08-22 |
+------------+
1 row in set (0.00 sec)
MySQL [(none)]> select UTC_DATE() + 2;
+----------------+
| UTC_DATE() + 2 |
+----------------+
| 2019 |
+----------------+
1 row in set, 1 warning (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V`)?
Git Commit Hash: 365e4ab491b683a69c2004f30b1ae4f86256e2ad
Git Commit Branch: master
UTC Build Time: 2017-08-16 01:24:27
",1,behavior of utc date is different from mysql please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error select utc date select utc date what did you expect to see mysql select utc date utc date row in set sec mysql select utc date utc date row in set sec what did you see instead mysql select utc date utc date row in set sec mysql select utc date utc date row in set warning sec what version of tidb are you using tidb server v git commit hash git commit branch master utc build time ,1
11105,13130760190.0,IssuesEvent,2020-08-06 15:51:17,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,support string convert to number in best effort during compare.,status/help-wanted type/compatibility,"1. What did you do?
```
CREATE TABLE `test3` (`id` int(11) DEFAULT NULL);
CREATE TABLE `test4` (`k` varchar(3) DEFAULT NULL);
insert into test3 values (1);
insert into test4 values (""1-2"");
select * from test3 a inner join test4 b on a.id = b.k;
```
2. What did you expect to see?
```
mysql> select * from test3 a inner join test4 b on a.id = b.k;
+------+------+
| id | k |
+------+------+
| 1 | 1-2 |
+------+------+
1 row in set (0.00 sec)
```
3. What did you see instead?
```
ERROR 1105 (HY000): strconv.ParseFloat: parsing ""1-2"": invalid syntax
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
| Release Version: v2.0.0
Git Commit Hash: 637e130e6a9ba2e54e158131c0466233db39a60e
Git Branch: release-2.0
UTC Build Time: 2018-04-27 11:43:00
GoVersion: go version go1.10 linux/amd64
TiKV Min Version: 2.0.0-rc.4.1 |
```
",True,"support string convert to number in best effort during compare. - 1. What did you do?
```
CREATE TABLE `test3` (`id` int(11) DEFAULT NULL);
CREATE TABLE `test4` (`k` varchar(3) DEFAULT NULL);
insert into test3 values (1);
insert into test4 values (""1-2"");
select * from test3 a inner join test4 b on a.id = b.k;
```
2. What did you expect to see?
```
mysql> select * from test3 a inner join test4 b on a.id = b.k;
+------+------+
| id | k |
+------+------+
| 1 | 1-2 |
+------+------+
1 row in set (0.00 sec)
```
3. What did you see instead?
```
ERROR 1105 (HY000): strconv.ParseFloat: parsing ""1-2"": invalid syntax
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
| Release Version: v2.0.0
Git Commit Hash: 637e130e6a9ba2e54e158131c0466233db39a60e
Git Branch: release-2.0
UTC Build Time: 2018-04-27 11:43:00
GoVersion: go version go1.10 linux/amd64
TiKV Min Version: 2.0.0-rc.4.1 |
```
",1,support string convert to number in best effort during compare what did you do create table id int default null create table k varchar default null insert into values insert into values select from a inner join b on a id b k what did you expect to see mysql select from a inner join b on a id b k id k row in set sec what did you see instead error strconv parsefloat parsing invalid syntax what version of tidb are you using tidb server v or run select tidb version on tidb release version git commit hash git branch release utc build time goversion go version linux tikv min version rc ,1
15728,20366116739.0,IssuesEvent,2022-02-21 05:57:42,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Built-in function CHARSET not supported,help wanted type/compatibility component/expression,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```sql
SELECT CHARSET('a');
```
2. What did you expect to see?
```
+--------------+
| CHARSET('a') |
+--------------+
| utf8 |
+--------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
```
ERROR 1305 (42000): FUNCTION CHARSET does not exist
```
4. What version of TiDB are you using (`tidb-server -V`)?
",True,"Built-in function CHARSET not supported - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```sql
SELECT CHARSET('a');
```
2. What did you expect to see?
```
+--------------+
| CHARSET('a') |
+--------------+
| utf8 |
+--------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
```
ERROR 1305 (42000): FUNCTION CHARSET does not exist
```
4. What version of TiDB are you using (`tidb-server -V`)?
",1,built in function charset not supported please answer these questions before submitting your issue thanks what did you do sql select charset a what did you expect to see charset a row in set sec what did you see instead error function charset does not exist what version of tidb are you using tidb server v ,1
6463,8755267787.0,IssuesEvent,2018-12-14 14:23:57,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,wait_timeout used instead of interactive_timeout,help wanted type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
Currently `wait_timeout` is also applicable for interactive sessions (i.e. mysql cli tool). The MySQL compatible behavior is as follows:
2. What did you expect to see?
```
session1> set global wait_timeout = 5;
session1> set global interactive_timeout = 100;
..
session1> show global variables like 'wait_timeout';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout | 5 |
+---------------+-------+
1 row in set (0.00 sec)
session1> show global variables like 'interactive_timeout';
+---------------------+-------+
| Variable_name | Value |
+---------------------+-------+
| interactive_timeout | 100 |
+---------------------+-------+
1 row in set (0.01 sec)
```
Then control +c and start a new session:
```
session2> show variables like 'wait_timeout';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout | 100 |
+---------------+-------+
1 row in set (0.00 sec)
session2> show variables like 'interactive_timeout';
+---------------------+-------+
| Variable_name | Value |
+---------------------+-------+
| interactive_timeout | 100 |
+---------------------+-------+
1 row in set (0.01 sec)
```
Because the session sets the interactive bit, the `interactive_timeout` is actually copied over the `wait_timeout`. The global `wait_timeout` is still 5:
```
session2> show global variables like 'wait_timeout';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout | 5 |
+---------------+-------+
1 row in set (0.00 sec)
```
3. What did you see instead?
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
",True,"wait_timeout used instead of interactive_timeout - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
Currently `wait_timeout` is also applicable for interactive sessions (i.e. mysql cli tool). The MySQL compatible behavior is as follows:
2. What did you expect to see?
```
session1> set global wait_timeout = 5;
session1> set global interactive_timeout = 100;
..
session1> show global variables like 'wait_timeout';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout | 5 |
+---------------+-------+
1 row in set (0.00 sec)
session1> show global variables like 'interactive_timeout';
+---------------------+-------+
| Variable_name | Value |
+---------------------+-------+
| interactive_timeout | 100 |
+---------------------+-------+
1 row in set (0.01 sec)
```
Then control +c and start a new session:
```
session2> show variables like 'wait_timeout';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout | 100 |
+---------------+-------+
1 row in set (0.00 sec)
session2> show variables like 'interactive_timeout';
+---------------------+-------+
| Variable_name | Value |
+---------------------+-------+
| interactive_timeout | 100 |
+---------------------+-------+
1 row in set (0.01 sec)
```
Because the session sets the interactive bit, the `interactive_timeout` is actually copied over the `wait_timeout`. The global `wait_timeout` is still 5:
```
session2> show global variables like 'wait_timeout';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout | 5 |
+---------------+-------+
1 row in set (0.00 sec)
```
3. What did you see instead?
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
",1,wait timeout used instead of interactive timeout bug report please answer these questions before submitting your issue thanks what did you do currently wait timeout is also applicable for interactive sessions i e mysql cli tool the mysql compatible behavior is as follows what did you expect to see set global wait timeout set global interactive timeout show global variables like wait timeout variable name value wait timeout row in set sec show global variables like interactive timeout variable name value interactive timeout row in set sec then control c and start a new session show variables like wait timeout variable name value wait timeout row in set sec show variables like interactive timeout variable name value interactive timeout row in set sec because the session sets the interactive bit the interactive timeout is actually copied over the wait timeout the global wait timeout is still show global variables like wait timeout variable name value wait timeout row in set sec what did you see instead what version of tidb are you using tidb server v or run select tidb version on tidb ,1
7034,9307518771.0,IssuesEvent,2019-03-25 12:30:39,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,`SELECT 9223372036854775807 + 1;` is not compatible with MySQL,type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
`SELECT 9223372036854775807 + 1;`
2. What did you expect to see?
In Mysql 8.0.15
```
mysql> SELECT 9223372036854775807+1;
ERROR 1690 (22003): BIGINT value is out of range in '(9223372036854775807 + 1)'
```
See also https://dev.mysql.com/doc/refman/8.0/en/out-of-range-and-overflow.html
3. What did you see instead?
```
mysql> SELECT 9223372036854775807+1;
+-----------------------+
| 9223372036854775807+1 |
+-----------------------+
| 9223372036854775808 |
+-----------------------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
mysql> select tidb_version();
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v3.0.0-beta-231-g20463d6-dirty
Git Commit Hash: 20463d6da90fdf12c0d9d18c15dc33a78334882d
Git Branch: master
UTC Build Time: 2019-03-20 02:03:04
GoVersion: go version go1.12 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.01 sec)
```
",True,"`SELECT 9223372036854775807 + 1;` is not compatible with MySQL - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
`SELECT 9223372036854775807 + 1;`
2. What did you expect to see?
In Mysql 8.0.15
```
mysql> SELECT 9223372036854775807+1;
ERROR 1690 (22003): BIGINT value is out of range in '(9223372036854775807 + 1)'
```
See also https://dev.mysql.com/doc/refman/8.0/en/out-of-range-and-overflow.html
3. What did you see instead?
```
mysql> SELECT 9223372036854775807+1;
+-----------------------+
| 9223372036854775807+1 |
+-----------------------+
| 9223372036854775808 |
+-----------------------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
mysql> select tidb_version();
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v3.0.0-beta-231-g20463d6-dirty
Git Commit Hash: 20463d6da90fdf12c0d9d18c15dc33a78334882d
Git Branch: master
UTC Build Time: 2019-03-20 02:03:04
GoVersion: go version go1.12 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.01 sec)
```
",1, select is not compatible with mysql bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error select what did you expect to see in mysql mysql select error bigint value is out of range in see also what did you see instead mysql select row in set sec what version of tidb are you using tidb server v or run select tidb version on tidb mysql select tidb version tidb version release version beta dirty git commit hash git branch master utc build time goversion go version linux race enabled false tikv min version alpha check table before drop false row in set sec ,1
9306,11309044453.0,IssuesEvent,2020-01-19 10:25:47,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,alter table modify column compatibility,component/charset needs-cherry-pick-2.1 type/bug type/compatibility,"TiDB 2.1.14
```
mysql> create table tab1 (`a` varchar(30) CHARSET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '12345',`id` int);
Query OK, 0 rows affected (0.24 sec)
mysql> ALTER TABLE tab1 MODIFY COLUMN `a` varchar(32) CHARSET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '54321' after `id`;
ERROR 1105 (HY000): unsupported modify column %!s(ast.ColumnOptionType=12)
mysql> ALTER TABLE tab1 MODIFY COLUMN `a` varchar(32) DEFAULT NULL COMMENT '54321' after `id`;
Query OK, 0 rows affected (0.20 sec)
mysql> ALTER TABLE tab1 MODIFY COLUMN `a` varchar(32) COMMENT '54321' after `id`;
Query OK, 0 rows affected (0.13 sec)
```
MySQL 5.7.24
```
mysql> create table tab1 (`a` varchar(30) CHARSET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '12345',`id` int);
Query OK, 0 rows affected (0.04 sec)
mysql> ALTER TABLE tab1 MODIFY COLUMN `a` varchar(32) CHARSET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '54321' after `id`;
Query OK, 0 rows affected (0.04 sec)
Records: 0 Duplicates: 0 Warnings: 0
```",True,"alter table modify column compatibility - TiDB 2.1.14
```
mysql> create table tab1 (`a` varchar(30) CHARSET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '12345',`id` int);
Query OK, 0 rows affected (0.24 sec)
mysql> ALTER TABLE tab1 MODIFY COLUMN `a` varchar(32) CHARSET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '54321' after `id`;
ERROR 1105 (HY000): unsupported modify column %!s(ast.ColumnOptionType=12)
mysql> ALTER TABLE tab1 MODIFY COLUMN `a` varchar(32) DEFAULT NULL COMMENT '54321' after `id`;
Query OK, 0 rows affected (0.20 sec)
mysql> ALTER TABLE tab1 MODIFY COLUMN `a` varchar(32) COMMENT '54321' after `id`;
Query OK, 0 rows affected (0.13 sec)
```
MySQL 5.7.24
```
mysql> create table tab1 (`a` varchar(30) CHARSET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '12345',`id` int);
Query OK, 0 rows affected (0.04 sec)
mysql> ALTER TABLE tab1 MODIFY COLUMN `a` varchar(32) CHARSET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '54321' after `id`;
Query OK, 0 rows affected (0.04 sec)
Records: 0 Duplicates: 0 Warnings: 0
```",1,alter table modify column compatibility tidb mysql create table a varchar charset collate bin default null comment id int query ok rows affected sec mysql alter table modify column a varchar charset collate bin default null comment after id error unsupported modify column s ast columnoptiontype mysql alter table modify column a varchar default null comment after id query ok rows affected sec mysql alter table modify column a varchar comment after id query ok rows affected sec mysql mysql create table a varchar charset collate bin default null comment id int query ok rows affected sec mysql alter table modify column a varchar charset collate bin default null comment after id query ok rows affected sec records duplicates warnings ,1
12380,14640781475.0,IssuesEvent,2020-12-25 03:44:01,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Disabling STRICT_TRANS_TABLES should allow NULL insert into NOT NULL column with default value,severity/moderate sig/infra type/bug type/compatibility,"## Bug Report
1. What did you do?
```
create table t1 (id int NOT NULL DEFAULT 8);
SET sql_mode = '';
insert into t1 values (1), (NULL), (2);
```
2. What did you expect to see?
```
mysql> create table t1 (id int NOT NULL DEFAULT 8);
Query OK, 0 rows affected (0.06 sec)
mysql> SET sql_mode = '';
Query OK, 0 rows affected (0.00 sec)
mysql> insert into t1 values (1), (NULL), (2);
Query OK, 3 rows affected, 1 warning (0.03 sec)
Records: 3 Duplicates: 0 Warnings: 1
mysql> show warnings;
+---------+------+----------------------------+
| Level | Code | Message |
+---------+------+----------------------------+
| Warning | 1048 | Column 'id' cannot be null |
+---------+------+----------------------------+
1 row in set (0.00 sec)
mysql> select * from t1;
+----+
| id |
+----+
| 1 |
| 0 |
| 2 |
+----+
3 rows in set (0.00 sec)
```
3. What did you see instead?
```
mysql> create table t1 (id int NOT NULL DEFAULT 8);
Query OK, 0 rows affected (0.02 sec)
mysql> SET sql_mode = '';
Query OK, 0 rows affected (0.00 sec)
mysql> insert into t1 values (1), (NULL), (2);
ERROR 1048 (23000): Column 'id' cannot be null
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
master
",True,"Disabling STRICT_TRANS_TABLES should allow NULL insert into NOT NULL column with default value - ## Bug Report
1. What did you do?
```
create table t1 (id int NOT NULL DEFAULT 8);
SET sql_mode = '';
insert into t1 values (1), (NULL), (2);
```
2. What did you expect to see?
```
mysql> create table t1 (id int NOT NULL DEFAULT 8);
Query OK, 0 rows affected (0.06 sec)
mysql> SET sql_mode = '';
Query OK, 0 rows affected (0.00 sec)
mysql> insert into t1 values (1), (NULL), (2);
Query OK, 3 rows affected, 1 warning (0.03 sec)
Records: 3 Duplicates: 0 Warnings: 1
mysql> show warnings;
+---------+------+----------------------------+
| Level | Code | Message |
+---------+------+----------------------------+
| Warning | 1048 | Column 'id' cannot be null |
+---------+------+----------------------------+
1 row in set (0.00 sec)
mysql> select * from t1;
+----+
| id |
+----+
| 1 |
| 0 |
| 2 |
+----+
3 rows in set (0.00 sec)
```
3. What did you see instead?
```
mysql> create table t1 (id int NOT NULL DEFAULT 8);
Query OK, 0 rows affected (0.02 sec)
mysql> SET sql_mode = '';
Query OK, 0 rows affected (0.00 sec)
mysql> insert into t1 values (1), (NULL), (2);
ERROR 1048 (23000): Column 'id' cannot be null
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
master
",1,disabling strict trans tables should allow null insert into not null column with default value bug report what did you do create table id int not null default set sql mode insert into values null what did you expect to see mysql create table id int not null default query ok rows affected sec mysql set sql mode query ok rows affected sec mysql insert into values null query ok rows affected warning sec records duplicates warnings mysql show warnings level code message warning column id cannot be null row in set sec mysql select from id rows in set sec what did you see instead mysql create table id int not null default query ok rows affected sec mysql set sql mode query ok rows affected sec mysql insert into values null error column id cannot be null what version of tidb are you using tidb server v or run select tidb version on tidb master ,1
12345,14600943962.0,IssuesEvent,2020-12-21 07:49:50,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,util/types: max Decimal parameter is not considered,component/expression severity/moderate type/bug type/compatibility,"
see https://dev.mysql.com/doc/refman/5.7/en/precision-math-decimal-characteristics.html
the maximum ranges of values for the arguments is not considered:
MySQL:
mysql> select cast(11111 as decimal(66, 2));
ERROR 1426 (42000): Too big precision 66 specified for column '11111'. Maximum is 65.
TiDB:
mysql> select cast(11111 as decimal(66, 2));
+-------------------------------+
| cast(11111 as decimal(66, 2)) |
+-------------------------------+
| 11111.00 |
+-------------------------------+
1 row in set (0.00 sec)
",True,"util/types: max Decimal parameter is not considered -
see https://dev.mysql.com/doc/refman/5.7/en/precision-math-decimal-characteristics.html
the maximum ranges of values for the arguments is not considered:
MySQL:
mysql> select cast(11111 as decimal(66, 2));
ERROR 1426 (42000): Too big precision 66 specified for column '11111'. Maximum is 65.
TiDB:
mysql> select cast(11111 as decimal(66, 2));
+-------------------------------+
| cast(11111 as decimal(66, 2)) |
+-------------------------------+
| 11111.00 |
+-------------------------------+
1 row in set (0.00 sec)
",1,util types max decimal parameter is not considered see the maximum ranges of values for the arguments is not considered mysql mysql select cast as decimal error too big precision specified for column maximum is tidb mysql select cast as decimal cast as decimal row in set sec ,1
12017,14166163782.0,IssuesEvent,2020-11-12 08:30:09,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,for update not propagate correctly,severity/major sig/transaction type/bug type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
Start a TiDB for test case
```
docker run \
-itd --rm \
--name test_tidb \
-p 4000:4000 \
pingcap/tidb:v3.0.11
docker run \
-itd --rm \
--name test_mysql \
-p 3306:3306 \
circleci/mysql:5.7
```
run SQL cmd
```
# change TiDB to pessimistic mode, skip this for MySQL
set @@global.tidb_txn_mode = 'pessimistic';
create database test_case;
use test_case;
create table user_wallet (
id bigint auto_increment primary key,
user_id varchar(36) not null,
total bigint not null default 0,
version bigint not null default 1,
create_at timestamp not null default current_timestamp(),
update_at timestamp not null default current_timestamp() on update current_timestamp()
);
create unique index udx_uid on user_wallet(user_id);
create table user_wallet_log (
id bigint auto_increment primary key,
user_id varchar(36) not null,
total bigint not null,
create_at timestamp not null default current_timestamp(),
update_at timestamp not null default current_timestamp() on update current_timestamp()
);
create index idx_uid on user_wallet_log(user_id);
insert into user_wallet(user_id) value ('elvizlai');
```
mock_test.go
```
package mock
import (
""context""
""database/sql""
""fmt""
""sync""
""testing""
_ ""github.com/go-sql-driver/mysql"" // required by database/sql
)
var db = func() *sql.DB {
// db, err := sql.Open(""mysql"", ""root:@tcp(127.0.0.1:3306)/test_case?parseTime=true&loc=Local"") // mysql
db, err := sql.Open(""mysql"", ""root:@tcp(127.0.0.1:4000)/test_case?parseTime=true&loc=Local"") // tidb
if err != nil {
panic(err)
}
return db
}()
func grantRowLock(tx *sql.Tx, userId string) error {
var err error
_, err = tx.Exec(`SELECT 1 FROM user_wallet where user_id=? for update`, userId)
return err
}
func chargeSum(tx *sql.Tx, userId string, total int) error {
var err error
_, err = tx.Exec(`INSERT INTO user_wallet_log(user_id, total) values(?, ?)`, userId, total)
if err != nil {
return err
}
// not worked for tidb(not correctly)
sumSQL := `select sum(total) from user_wallet_log where user_id=?`
// both worked for mysql and tidb
// sumSQL := `select sum(total) from user_wallet_log where user_id=? for update`
s := 0
err = tx.QueryRow(sumSQL, userId).Scan(&s)
if err != nil {
return err
}
fmt.Println(""sum"", s)
_, err = tx.Exec(fmt.Sprintf(`UPDATE user_wallet SET total=(%s) where user_id=?`, sumSQL), userId, userId)
return err
}
var userId = ""elvizlai""
func TestChargeSum(t *testing.T) {
wg := sync.WaitGroup{}
for i := 0; i < 10; i++ {
wg.Add(1)
go func() {
tx, err := db.BeginTx(context.Background(), &sql.TxOptions{Isolation: sql.LevelRepeatableRead})
if err != nil {
panic(err)
}
err = grantRowLock(tx, userId)
if err != nil {
panic(err)
}
err = chargeSum(tx, userId, 1)
if err != nil {
panic(err)
}
err = tx.Commit()
if err != nil {
panic(err)
}
wg.Done()
}()
}
wg.Wait()
}
```
run test case TestChargeSum using `tidb` and `mysql` conn.
2. What did you expect to see?
total of user_wallet should be correct.
3. What did you see instead?
tidb sub query without `for update` output same sum result.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
v3.0.11
",True,"for update not propagate correctly - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
Start a TiDB for test case
```
docker run \
-itd --rm \
--name test_tidb \
-p 4000:4000 \
pingcap/tidb:v3.0.11
docker run \
-itd --rm \
--name test_mysql \
-p 3306:3306 \
circleci/mysql:5.7
```
run SQL cmd
```
# change TiDB to pessimistic mode, skip this for MySQL
set @@global.tidb_txn_mode = 'pessimistic';
create database test_case;
use test_case;
create table user_wallet (
id bigint auto_increment primary key,
user_id varchar(36) not null,
total bigint not null default 0,
version bigint not null default 1,
create_at timestamp not null default current_timestamp(),
update_at timestamp not null default current_timestamp() on update current_timestamp()
);
create unique index udx_uid on user_wallet(user_id);
create table user_wallet_log (
id bigint auto_increment primary key,
user_id varchar(36) not null,
total bigint not null,
create_at timestamp not null default current_timestamp(),
update_at timestamp not null default current_timestamp() on update current_timestamp()
);
create index idx_uid on user_wallet_log(user_id);
insert into user_wallet(user_id) value ('elvizlai');
```
mock_test.go
```
package mock
import (
""context""
""database/sql""
""fmt""
""sync""
""testing""
_ ""github.com/go-sql-driver/mysql"" // required by database/sql
)
var db = func() *sql.DB {
// db, err := sql.Open(""mysql"", ""root:@tcp(127.0.0.1:3306)/test_case?parseTime=true&loc=Local"") // mysql
db, err := sql.Open(""mysql"", ""root:@tcp(127.0.0.1:4000)/test_case?parseTime=true&loc=Local"") // tidb
if err != nil {
panic(err)
}
return db
}()
func grantRowLock(tx *sql.Tx, userId string) error {
var err error
_, err = tx.Exec(`SELECT 1 FROM user_wallet where user_id=? for update`, userId)
return err
}
func chargeSum(tx *sql.Tx, userId string, total int) error {
var err error
_, err = tx.Exec(`INSERT INTO user_wallet_log(user_id, total) values(?, ?)`, userId, total)
if err != nil {
return err
}
// not worked for tidb(not correctly)
sumSQL := `select sum(total) from user_wallet_log where user_id=?`
// both worked for mysql and tidb
// sumSQL := `select sum(total) from user_wallet_log where user_id=? for update`
s := 0
err = tx.QueryRow(sumSQL, userId).Scan(&s)
if err != nil {
return err
}
fmt.Println(""sum"", s)
_, err = tx.Exec(fmt.Sprintf(`UPDATE user_wallet SET total=(%s) where user_id=?`, sumSQL), userId, userId)
return err
}
var userId = ""elvizlai""
func TestChargeSum(t *testing.T) {
wg := sync.WaitGroup{}
for i := 0; i < 10; i++ {
wg.Add(1)
go func() {
tx, err := db.BeginTx(context.Background(), &sql.TxOptions{Isolation: sql.LevelRepeatableRead})
if err != nil {
panic(err)
}
err = grantRowLock(tx, userId)
if err != nil {
panic(err)
}
err = chargeSum(tx, userId, 1)
if err != nil {
panic(err)
}
err = tx.Commit()
if err != nil {
panic(err)
}
wg.Done()
}()
}
wg.Wait()
}
```
run test case TestChargeSum using `tidb` and `mysql` conn.
2. What did you expect to see?
total of user_wallet should be correct.
3. What did you see instead?
tidb sub query without `for update` output same sum result.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
v3.0.11
",1,for update not propagate correctly bug report please answer these questions before submitting your issue thanks what did you do start a tidb for test case docker run itd rm name test tidb p pingcap tidb docker run itd rm name test mysql p circleci mysql run sql cmd change tidb to pessimistic mode skip this for mysql set global tidb txn mode pessimistic create database test case use test case create table user wallet id bigint auto increment primary key user id varchar not null total bigint not null default version bigint not null default create at timestamp not null default current timestamp update at timestamp not null default current timestamp on update current timestamp create unique index udx uid on user wallet user id create table user wallet log id bigint auto increment primary key user id varchar not null total bigint not null create at timestamp not null default current timestamp update at timestamp not null default current timestamp on update current timestamp create index idx uid on user wallet log user id insert into user wallet user id value elvizlai mock test go package mock import context database sql fmt sync testing github com go sql driver mysql required by database sql var db func sql db db err sql open mysql root tcp test case parsetime true loc local mysql db err sql open mysql root tcp test case parsetime true loc local tidb if err nil panic err return db func grantrowlock tx sql tx userid string error var err error err tx exec select from user wallet where user id for update userid return err func chargesum tx sql tx userid string total int error var err error err tx exec insert into user wallet log user id total values userid total if err nil return err not worked for tidb not correctly sumsql select sum total from user wallet log where user id both worked for mysql and tidb sumsql select sum total from user wallet log where user id for update s err tx queryrow sumsql userid scan s if err nil return err fmt println sum s err tx exec fmt sprintf update user wallet set total s where user id sumsql userid userid return err var userid elvizlai func testchargesum t testing t wg sync waitgroup for i i i wg add go func tx err db begintx context background sql txoptions isolation sql levelrepeatableread if err nil panic err err grantrowlock tx userid if err nil panic err err chargesum tx userid if err nil panic err err tx commit if err nil panic err wg done wg wait run test case testchargesum using tidb and mysql conn what did you expect to see total of user wallet should be correct what did you see instead tidb sub query without for update output same sum result what version of tidb are you using tidb server v or run select tidb version on tidb ,1
243292,20376598046.0,IssuesEvent,2022-02-21 16:12:39,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Tracking issue for unstable tests,type/bug type/enhancement component/test,"## Timeout test
* [x] #27438
* [x] #27439
* [x] #27440
* [x] #27441
* [x] #27443
* [x] #27444
* [x] #27445
* [x] #27446
* [x] #27447
* [x] #27449
* [x] #27450
* [x] #27620
* [ ] #28017
* [ ] #28019
## Integration tests
* [x] #27124
## race
* [x] #27979
* [x] #25003
* [x] #25013
* [x] #25073
* [x] #25189
* [x] #25270
* [x] #25393
* [x] #25643
* [x] #25691
* [x] #25782
* [x] #25898
* [x] #26539
* [x] #26538
* [x] #26718
* [x] #27114
* [x] #27307
* [x] #27473
* [x] #27474
* [x] #27476
* [x] #27485
* [x] #27821
* [x] #27822
* [x] #27876
* [x] #28318
* [x] #28777
* [x] #29164
* [x] #29721
* [x] #29726
* [x] #29727
* [x] #29728
* [x] #29731
## leak
* [x] #25271
* [x] #25392
* [x] #26997
* [x] #26999
* [x] #27437
* [x] #27475
* [x] #28816
## hang
* [x] #27966
* [x] #25770
* [x] #25894
* [x] #25895
* [x] #26186
* [x] #26458
* [x] #27410
* [x] #27420
## logical error
* [x] #25584
* [x] #28299
## Timeout
* [x] #26717
## unknown
* [x] #25010
* [x] #25014
* [x] #25157
* [x] #25187
* [x] #25188
* [x] #25190
* [x] #25269
* [x] #25272
* [x] #25274
* [x] #25395
* [x] #25585
* [x] #25634
* [x] #25589
* [x] #25640
* [x] #25642
* [x] #25690
* [x] #25692
* [x] #25780
* [x] #25781
* [x] #25783
* [x] #25893
* [x] #25896
* [x] #25897
* [x] #26009
* [x] #26018
* [x] #26099
* [x] #26138
* [x] #26185
* [x] #25986
* [x] #15862
* [x] #26235
* [x] #18945
* [x] #26321
* [ ] #26409
* [ ] #26410
* [x] #24010
* [ ] #24679
* [x] #25458
* [x] #25783
* [x] #14931
* [x] #26684
* [x] #25187
* [x] #23977
* [x] #26796
* [x] #26934
* [x] #22212
* [x] #25122
* [x] #26947
* [x] #26986
* [x] #27115
* [x] #27116
* [x] #27448
* [x] #27651
* [x] #27711
* [x] #27820
* [x] #27888
* [x] #27889
* [x] #27892
* [x] #28020
* [x] #28049
* [x] #28054
* [x] #28348
* [x] #28349
* [x] #28350
* [x] #28351
* [x] #28553
* [x] #28676
* [ ] #28646
* [x] #29264
* [x] #29283
* [x] #29734
* [x] #29989
* [x] #31590",1.0,"Tracking issue for unstable tests - ## Timeout test
* [x] #27438
* [x] #27439
* [x] #27440
* [x] #27441
* [x] #27443
* [x] #27444
* [x] #27445
* [x] #27446
* [x] #27447
* [x] #27449
* [x] #27450
* [x] #27620
* [ ] #28017
* [ ] #28019
## Integration tests
* [x] #27124
## race
* [x] #27979
* [x] #25003
* [x] #25013
* [x] #25073
* [x] #25189
* [x] #25270
* [x] #25393
* [x] #25643
* [x] #25691
* [x] #25782
* [x] #25898
* [x] #26539
* [x] #26538
* [x] #26718
* [x] #27114
* [x] #27307
* [x] #27473
* [x] #27474
* [x] #27476
* [x] #27485
* [x] #27821
* [x] #27822
* [x] #27876
* [x] #28318
* [x] #28777
* [x] #29164
* [x] #29721
* [x] #29726
* [x] #29727
* [x] #29728
* [x] #29731
## leak
* [x] #25271
* [x] #25392
* [x] #26997
* [x] #26999
* [x] #27437
* [x] #27475
* [x] #28816
## hang
* [x] #27966
* [x] #25770
* [x] #25894
* [x] #25895
* [x] #26186
* [x] #26458
* [x] #27410
* [x] #27420
## logical error
* [x] #25584
* [x] #28299
## Timeout
* [x] #26717
## unknown
* [x] #25010
* [x] #25014
* [x] #25157
* [x] #25187
* [x] #25188
* [x] #25190
* [x] #25269
* [x] #25272
* [x] #25274
* [x] #25395
* [x] #25585
* [x] #25634
* [x] #25589
* [x] #25640
* [x] #25642
* [x] #25690
* [x] #25692
* [x] #25780
* [x] #25781
* [x] #25783
* [x] #25893
* [x] #25896
* [x] #25897
* [x] #26009
* [x] #26018
* [x] #26099
* [x] #26138
* [x] #26185
* [x] #25986
* [x] #15862
* [x] #26235
* [x] #18945
* [x] #26321
* [ ] #26409
* [ ] #26410
* [x] #24010
* [ ] #24679
* [x] #25458
* [x] #25783
* [x] #14931
* [x] #26684
* [x] #25187
* [x] #23977
* [x] #26796
* [x] #26934
* [x] #22212
* [x] #25122
* [x] #26947
* [x] #26986
* [x] #27115
* [x] #27116
* [x] #27448
* [x] #27651
* [x] #27711
* [x] #27820
* [x] #27888
* [x] #27889
* [x] #27892
* [x] #28020
* [x] #28049
* [x] #28054
* [x] #28348
* [x] #28349
* [x] #28350
* [x] #28351
* [x] #28553
* [x] #28676
* [ ] #28646
* [x] #29264
* [x] #29283
* [x] #29734
* [x] #29989
* [x] #31590",0,tracking issue for unstable tests timeout test integration tests race leak hang logical error timeout unknown ,0
12249,14478220831.0,IssuesEvent,2020-12-10 08:01:52,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,P1-[4.0 Bug Hunting]-[Incompatible with MySQL]-No warning for using `group by asc/desc` and wrong results returned,challenge-program severity/moderate sig/planner status/help-wanted type/bug type/compatibility,"## Description
Bug Hunter issue tidb-challenge-program/bug-hunting-issue#97
---
## Bug Report
### 1. What did you do?
````
mysql> create table t0 (id int );
Query OK, 0 rows affected (0.01 sec)
mysql> insert into t0 values (0), (1), (2);
Query OK, 3 rows affected (0.00 sec)
Records: 3 Duplicates: 0 Warnings: 0
mysql> select * from t0 group by id asc;
+------+
| id |
+------+
| 2 |
| 0 |
| 1 |
+------+
3 rows in set (0.00 sec)
````
### 2. What did you expect to see?
````
mysql> select * from t0 group by id asc;
+------+
| id |
+------+
| 0 |
| 1 |
| 2 |
+------+
3 rows in set, 1 warning (0.00 sec)
mysql> show warnings;
+---------+------+---------------------------------------------------------------------------------------------------------------------------------------+
| Level | Code | Message
|
+---------+------+---------------------------------------------------------------------------------------------------------------------------------------+
| Warning | 1287 | 'GROUP BY with ASC/DESC' is deprecated and will be removed in a future release. Please use GROUP BY ... ORDER BY ... ASC/DESC instead |
+---------+------+---------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
````
### 3. What did you see instead?
No warnings.
### 4. What version of TiDB are you using? (`tidb-server -V` or run `select tidb_version();` on TiDB)
Reproducible on master branch:
````
commit 8369ffd500f3fb235d8b584ac4298b2e59d8db55 (HEAD -> master, origin/master, origin/HEAD)
Author: Soup
Date: Tue May 26 15:38:29 2020 +0800
````
````
mysql> select tidb_version();
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: None
Edition: None
Git Commit Hash: None
Git Branch: None
UTC Build Time: None
GoVersion: go1.13.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
````
## SIG slack channel
[#sig-planner](https://slack.tidb.io/invite?team=tidb-community&channel=sig-planner&ref=high-performance)
## Score
- 300
## Mentor
* @lzmhhh123
",True,"P1-[4.0 Bug Hunting]-[Incompatible with MySQL]-No warning for using `group by asc/desc` and wrong results returned - ## Description
Bug Hunter issue tidb-challenge-program/bug-hunting-issue#97
---
## Bug Report
### 1. What did you do?
````
mysql> create table t0 (id int );
Query OK, 0 rows affected (0.01 sec)
mysql> insert into t0 values (0), (1), (2);
Query OK, 3 rows affected (0.00 sec)
Records: 3 Duplicates: 0 Warnings: 0
mysql> select * from t0 group by id asc;
+------+
| id |
+------+
| 2 |
| 0 |
| 1 |
+------+
3 rows in set (0.00 sec)
````
### 2. What did you expect to see?
````
mysql> select * from t0 group by id asc;
+------+
| id |
+------+
| 0 |
| 1 |
| 2 |
+------+
3 rows in set, 1 warning (0.00 sec)
mysql> show warnings;
+---------+------+---------------------------------------------------------------------------------------------------------------------------------------+
| Level | Code | Message
|
+---------+------+---------------------------------------------------------------------------------------------------------------------------------------+
| Warning | 1287 | 'GROUP BY with ASC/DESC' is deprecated and will be removed in a future release. Please use GROUP BY ... ORDER BY ... ASC/DESC instead |
+---------+------+---------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
````
### 3. What did you see instead?
No warnings.
### 4. What version of TiDB are you using? (`tidb-server -V` or run `select tidb_version();` on TiDB)
Reproducible on master branch:
````
commit 8369ffd500f3fb235d8b584ac4298b2e59d8db55 (HEAD -> master, origin/master, origin/HEAD)
Author: Soup
Date: Tue May 26 15:38:29 2020 +0800
````
````
mysql> select tidb_version();
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: None
Edition: None
Git Commit Hash: None
Git Branch: None
UTC Build Time: None
GoVersion: go1.13.4
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
````
## SIG slack channel
[#sig-planner](https://slack.tidb.io/invite?team=tidb-community&channel=sig-planner&ref=high-performance)
## Score
- 300
## Mentor
* @lzmhhh123
",1, no warning for using group by asc desc and wrong results returned description bug hunter issue tidb challenge program bug hunting issue bug report what did you do mysql create table id int query ok rows affected sec mysql insert into values query ok rows affected sec records duplicates warnings mysql select from group by id asc id rows in set sec what did you expect to see mysql select from group by id asc id rows in set warning sec mysql show warnings level code message warning group by with asc desc is deprecated and will be removed in a future release please use group by order by asc desc instead row in set sec what did you see instead no warnings what version of tidb are you using tidb server v or run select tidb version on tidb reproducible on master branch commit head master origin master origin head author soup date tue may mysql select tidb version tidb version release version none edition none git commit hash none git branch none utc build time none goversion race enabled false tikv min version check table before drop false row in set sec sig slack channel score mentor ,1
18496,25582848919.0,IssuesEvent,2022-12-01 06:40:03,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,BR: 6.2.0 system table mysql.user can't be restored to 6.4.0,type/bug compatibility-breaker severity/critical component/br affects-6.2 affects-6.3 affects-6.4,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
tidb changed mysql.user schema in 6.4.0
version95 add a column `User_attributes` to `mysql.user`
version98 add a column `Token_issuer` to `mysql.user`
when restore 6.2.0 mysql.user to 6.4.0 will report :
Error: column count mismatch, table: user, col in cluster: 38, col in backup: 37: [BR:Restore:ErrR
### 2. What did you expect to see? (Required)
restore success
### 3. What did you see instead (Required)
Error: column count mismatch, table: user, col in cluster: 38, col in backup: 37: [BR:Restore:ErrR
### 4. What is your TiDB version? (Required)
master
",True,"BR: 6.2.0 system table mysql.user can't be restored to 6.4.0 - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
tidb changed mysql.user schema in 6.4.0
version95 add a column `User_attributes` to `mysql.user`
version98 add a column `Token_issuer` to `mysql.user`
when restore 6.2.0 mysql.user to 6.4.0 will report :
Error: column count mismatch, table: user, col in cluster: 38, col in backup: 37: [BR:Restore:ErrR
### 2. What did you expect to see? (Required)
restore success
### 3. What did you see instead (Required)
Error: column count mismatch, table: user, col in cluster: 38, col in backup: 37: [BR:Restore:ErrR
### 4. What is your TiDB version? (Required)
master
",1,br system table mysql user can t be restored to bug report please answer these questions before submitting your issue thanks minimal reproduce step required tidb changed mysql user schema in add a column user attributes to mysql user add a column token issuer to mysql user when restore mysql user to will report error column count mismatch table user col in cluster col in backup br restore errr what did you expect to see required restore success what did you see instead required error column count mismatch table user col in cluster col in backup br restore errr what is your tidb version required master ,1
12266,14500542410.0,IssuesEvent,2020-12-11 18:11:22,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,generated columns do not wrap unsigned values to signed,severity/moderate sig/execution status/won't-fix type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```sql
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a BIGINT UNSIGNED NOT NULL, b BIGINT AS (a) NOT NULL);
SELECT cast(9223372036854775808 as signed); # works; no warnings or errors
INSERT INTO t1 (a) VALUES (9223372036854775808); # error in TiDB, works in MySQL
SELECT * FROM t1;
```
### 2. What did you expect to see? (Required)
```sql
mysql [localhost:8022] {msandbox} (test) > DROP TABLE IF EXISTS t1;
Query OK, 0 rows affected (0.01 sec)
mysql [localhost:8022] {msandbox} (test) > CREATE TABLE t1 (a BIGINT UNSIGNED NOT NULL, b BIGINT AS (a) NOT NULL);
Query OK, 0 rows affected (0.01 sec)
mysql [localhost:8022] {msandbox} (test) > SELECT cast(9223372036854775808 as signed); # works; no warnings or errors
+-------------------------------------+
| cast(9223372036854775808 as signed) |
+-------------------------------------+
| -9223372036854775808 |
+-------------------------------------+
1 row in set (0.00 sec)
mysql [localhost:8022] {msandbox} (test) > INSERT INTO t1 (a) VALUES (9223372036854775808); # error in TiDB, works in MySQL
Query OK, 1 row affected (0.00 sec)
mysql [localhost:8022] {msandbox} (test) > SELECT * FROM t1;
+---------------------+----------------------+
| a | b |
+---------------------+----------------------+
| 9223372036854775808 | -9223372036854775808 |
+---------------------+----------------------+
1 row in set (0.00 sec)
```
### 3. What did you see instead (Required)
```sql
mysql> DROP TABLE IF EXISTS t1;
Query OK, 0 rows affected (0.00 sec)
mysql> CREATE TABLE t1 (a BIGINT UNSIGNED NOT NULL, b BIGINT AS (a) NOT NULL);
Query OK, 0 rows affected (0.01 sec)
mysql> SELECT cast(9223372036854775808 as signed); # works; no warnings or errors
+-------------------------------------+
| cast(9223372036854775808 as signed) |
+-------------------------------------+
| -9223372036854775808 |
+-------------------------------------+
1 row in set (0.00 sec)
mysql> INSERT INTO t1 (a) VALUES (9223372036854775808); # error in TiDB, works in MySQL
ERROR 1690 (22003): constant 9223372036854775808 overflows bigint
mysql> SELECT * FROM t1;
Empty set (0.00 sec)
```
### 4. What is your TiDB version? (Required)
```sql
mysql> SELECT tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v4.0.0-beta.2-1770-g51fbf415c
Edition: Community
Git Commit Hash: 51fbf415c904ad77b2a4c29fbfb3ff513ed60f8c
Git Branch: master
UTC Build Time: 2020-12-09 14:19:36
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.00 sec)
```
",True,"generated columns do not wrap unsigned values to signed - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```sql
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a BIGINT UNSIGNED NOT NULL, b BIGINT AS (a) NOT NULL);
SELECT cast(9223372036854775808 as signed); # works; no warnings or errors
INSERT INTO t1 (a) VALUES (9223372036854775808); # error in TiDB, works in MySQL
SELECT * FROM t1;
```
### 2. What did you expect to see? (Required)
```sql
mysql [localhost:8022] {msandbox} (test) > DROP TABLE IF EXISTS t1;
Query OK, 0 rows affected (0.01 sec)
mysql [localhost:8022] {msandbox} (test) > CREATE TABLE t1 (a BIGINT UNSIGNED NOT NULL, b BIGINT AS (a) NOT NULL);
Query OK, 0 rows affected (0.01 sec)
mysql [localhost:8022] {msandbox} (test) > SELECT cast(9223372036854775808 as signed); # works; no warnings or errors
+-------------------------------------+
| cast(9223372036854775808 as signed) |
+-------------------------------------+
| -9223372036854775808 |
+-------------------------------------+
1 row in set (0.00 sec)
mysql [localhost:8022] {msandbox} (test) > INSERT INTO t1 (a) VALUES (9223372036854775808); # error in TiDB, works in MySQL
Query OK, 1 row affected (0.00 sec)
mysql [localhost:8022] {msandbox} (test) > SELECT * FROM t1;
+---------------------+----------------------+
| a | b |
+---------------------+----------------------+
| 9223372036854775808 | -9223372036854775808 |
+---------------------+----------------------+
1 row in set (0.00 sec)
```
### 3. What did you see instead (Required)
```sql
mysql> DROP TABLE IF EXISTS t1;
Query OK, 0 rows affected (0.00 sec)
mysql> CREATE TABLE t1 (a BIGINT UNSIGNED NOT NULL, b BIGINT AS (a) NOT NULL);
Query OK, 0 rows affected (0.01 sec)
mysql> SELECT cast(9223372036854775808 as signed); # works; no warnings or errors
+-------------------------------------+
| cast(9223372036854775808 as signed) |
+-------------------------------------+
| -9223372036854775808 |
+-------------------------------------+
1 row in set (0.00 sec)
mysql> INSERT INTO t1 (a) VALUES (9223372036854775808); # error in TiDB, works in MySQL
ERROR 1690 (22003): constant 9223372036854775808 overflows bigint
mysql> SELECT * FROM t1;
Empty set (0.00 sec)
```
### 4. What is your TiDB version? (Required)
```sql
mysql> SELECT tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v4.0.0-beta.2-1770-g51fbf415c
Edition: Community
Git Commit Hash: 51fbf415c904ad77b2a4c29fbfb3ff513ed60f8c
Git Branch: master
UTC Build Time: 2020-12-09 14:19:36
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.00 sec)
```
",1,generated columns do not wrap unsigned values to signed bug report please answer these questions before submitting your issue thanks minimal reproduce step required sql drop table if exists create table a bigint unsigned not null b bigint as a not null select cast as signed works no warnings or errors insert into a values error in tidb works in mysql select from what did you expect to see required sql mysql msandbox test drop table if exists query ok rows affected sec mysql msandbox test create table a bigint unsigned not null b bigint as a not null query ok rows affected sec mysql msandbox test select cast as signed works no warnings or errors cast as signed row in set sec mysql msandbox test insert into a values error in tidb works in mysql query ok row affected sec mysql msandbox test select from a b row in set sec what did you see instead required sql mysql drop table if exists query ok rows affected sec mysql create table a bigint unsigned not null b bigint as a not null query ok rows affected sec mysql select cast as signed works no warnings or errors cast as signed row in set sec mysql insert into a values error in tidb works in mysql error constant overflows bigint mysql select from empty set sec what is your tidb version required sql mysql select tidb version g row tidb version release version beta edition community git commit hash git branch master utc build time goversion race enabled false tikv min version check table before drop false row in set sec ,1
5800,8247240513.0,IssuesEvent,2018-09-11 15:02:16,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,"""div"" scientific notation values out of range",help wanted type/compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
select (1.175494351E-37 div 1.7976931348623157E+308);
```
2. What did you expect to see?
```
+-----------------------------------------------+
| (1.175494351E-37 div 1.7976931348623157E+308) |
+-----------------------------------------------+
| 0 |
+-----------------------------------------------+
```
3. What did you see instead?
```
ERROR 1690 (22003): %s value is out of range in '%s'
```
4. What version of TiDB are you using (`tidb-server -V`)?
",True,"""div"" scientific notation values out of range - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
select (1.175494351E-37 div 1.7976931348623157E+308);
```
2. What did you expect to see?
```
+-----------------------------------------------+
| (1.175494351E-37 div 1.7976931348623157E+308) |
+-----------------------------------------------+
| 0 |
+-----------------------------------------------+
```
3. What did you see instead?
```
ERROR 1690 (22003): %s value is out of range in '%s'
```
4. What version of TiDB are you using (`tidb-server -V`)?
",1, div scientific notation values out of range please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error sql select div what did you expect to see div what did you see instead error s value is out of range in s what version of tidb are you using tidb server v ,1
17598,24267984704.0,IssuesEvent,2022-09-28 08:03:18,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,TiDB behavior is inconsistent with MySQL in latin1 character set ,type/bug type/compatibility sig/sql-infra severity/moderate,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
While using pymysql module to insert data to TiDB with the charset latin1 connection. I cannot use utf8 client to get results directly. But MySQL doesn't have any problems.
```python3
import pymysql
import pymysql.cursors
# TiDB
connection=pymysql.connect(host='127.0.0.1',
user='root',
password='',
db='test',
port=4000,
charset='latin1')
# MySQL
connection1=pymysql.connect(host='127.0.0.1',
user='root',
password='',
db='test',
port=13306,
charset='latin1')
try:
with connection.cursor() as cursor:
sql=""insert into test.t2 (c1) values ('é')""
cursor.execute(sql)
connection.commit()
with connection1.cursor() as cursor1:
cursor1.execute(sql)
connection1.commit()
finally:
connection.close()
connection1.close()
```
```sql
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| t2 | CREATE TABLE `t2` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`c1` varchar(100) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
`c2` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci |
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
### 2. What did you expect to see? (Required)
The client with utf8 connection can query the correct result
### 3. What did you see instead (Required)
### 4. What is your TiDB version? (Required)
```sql
mysql> select tidb_version();
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v6.1.0
Edition: Community
Git Commit Hash: 1a89decdb192cbdce6a7b0020d71128bc964d30f
Git Branch: heads/refs/tags/v6.1.0
UTC Build Time: 2022-06-05 05:15:11
GoVersion: go1.18.2
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.06 sec)
```
",True,"TiDB behavior is inconsistent with MySQL in latin1 character set - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
While using pymysql module to insert data to TiDB with the charset latin1 connection. I cannot use utf8 client to get results directly. But MySQL doesn't have any problems.
```python3
import pymysql
import pymysql.cursors
# TiDB
connection=pymysql.connect(host='127.0.0.1',
user='root',
password='',
db='test',
port=4000,
charset='latin1')
# MySQL
connection1=pymysql.connect(host='127.0.0.1',
user='root',
password='',
db='test',
port=13306,
charset='latin1')
try:
with connection.cursor() as cursor:
sql=""insert into test.t2 (c1) values ('é')""
cursor.execute(sql)
connection.commit()
with connection1.cursor() as cursor1:
cursor1.execute(sql)
connection1.commit()
finally:
connection.close()
connection1.close()
```
```sql
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| t2 | CREATE TABLE `t2` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`c1` varchar(100) CHARACTER SET latin1 COLLATE latin1_bin DEFAULT NULL,
`c2` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci |
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
### 2. What did you expect to see? (Required)
The client with utf8 connection can query the correct result
### 3. What did you see instead (Required)
### 4. What is your TiDB version? (Required)
```sql
mysql> select tidb_version();
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v6.1.0
Edition: Community
Git Commit Hash: 1a89decdb192cbdce6a7b0020d71128bc964d30f
Git Branch: heads/refs/tags/v6.1.0
UTC Build Time: 2022-06-05 05:15:11
GoVersion: go1.18.2
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.06 sec)
```
",1,tidb behavior is inconsistent with mysql in character set bug report please answer these questions before submitting your issue thanks minimal reproduce step required while using pymysql module to insert data to tidb with the charset connection i cannot use client to get results directly but mysql doesn t have any problems import pymysql import pymysql cursors tidb connection pymysql connect host user root password db test port charset mysql pymysql connect host user root password db test port charset try with connection cursor as cursor sql insert into test values é cursor execute sql connection commit with cursor as execute sql commit finally connection close close sql table create table create table id bigint not null auto increment varchar character set collate bin default null varchar collate unicode ci default null primary key id engine innodb auto increment default charset collate unicode ci row in set sec what did you expect to see required the client with connection can query the correct result img width alt image src what did you see instead required img width alt image src what is your tidb version required sql mysql select tidb version tidb version release version edition community git commit hash git branch heads refs tags utc build time goversion race enabled false tikv min version check table before drop false row in set sec ,1
11069,13096410867.0,IssuesEvent,2020-08-03 15:38:21,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Set mysql compatible error codes in visitInfo,good-first-issue status/help-wanted type/compatibility,"## Feature Request
**Is your feature request related to a problem? Please describe:**
Following on from https://github.com/pingcap/tidb/pull/8855, `visitInfo` now allows a custom error to be attached. This issue can serve to track improving all the `appendVisitInfo` calls to attach a correct error code.
Some other privilege checks, such as https://github.com/pingcap/tidb/pull/8426/files can also be moved back into `visitInfo`.
**Describe the feature you'd like:**
Improve privilege checks in `visitInfo`. This can be broken down into smaller PRs as well.
* [x] SET GLOBAL https://github.com/pingcap/tidb/pull/9095
* [x] Analyze table https://github.com/pingcap/tidb/pull/9095
* [ ] ADMIN command (need to create custom TiDB error?)
* [x] SHOW CREATE TABLE https://github.com/pingcap/tidb/pull/9112
* [x] CREATE USER, DROP USER, ALTER USER https://github.com/pingcap/tidb/pull/9112
* [ ] GRANT statement
* [ ] Kill statement
* [ ] Insert statement
* [ ] Alter table / create database / create index / create table / create view / drop database / drop index / drop table / truncate table / rename table
* [ ] move: setpassword statement
**Describe alternatives you've considered:**
N/A
**Teachability, Documentation, Adoption, Migration Strategy:**
MySQL compatible behavior",True,"Set mysql compatible error codes in visitInfo - ## Feature Request
**Is your feature request related to a problem? Please describe:**
Following on from https://github.com/pingcap/tidb/pull/8855, `visitInfo` now allows a custom error to be attached. This issue can serve to track improving all the `appendVisitInfo` calls to attach a correct error code.
Some other privilege checks, such as https://github.com/pingcap/tidb/pull/8426/files can also be moved back into `visitInfo`.
**Describe the feature you'd like:**
Improve privilege checks in `visitInfo`. This can be broken down into smaller PRs as well.
* [x] SET GLOBAL https://github.com/pingcap/tidb/pull/9095
* [x] Analyze table https://github.com/pingcap/tidb/pull/9095
* [ ] ADMIN command (need to create custom TiDB error?)
* [x] SHOW CREATE TABLE https://github.com/pingcap/tidb/pull/9112
* [x] CREATE USER, DROP USER, ALTER USER https://github.com/pingcap/tidb/pull/9112
* [ ] GRANT statement
* [ ] Kill statement
* [ ] Insert statement
* [ ] Alter table / create database / create index / create table / create view / drop database / drop index / drop table / truncate table / rename table
* [ ] move: setpassword statement
**Describe alternatives you've considered:**
N/A
**Teachability, Documentation, Adoption, Migration Strategy:**
MySQL compatible behavior",1,set mysql compatible error codes in visitinfo feature request is your feature request related to a problem please describe following on from visitinfo now allows a custom error to be attached this issue can serve to track improving all the appendvisitinfo calls to attach a correct error code some other privilege checks such as can also be moved back into visitinfo describe the feature you d like improve privilege checks in visitinfo this can be broken down into smaller prs as well set global analyze table admin command need to create custom tidb error show create table create user drop user alter user grant statement kill statement insert statement alter table create database create index create table create view drop database drop index drop table truncate table rename table move setpassword statement describe alternatives you ve considered n a teachability documentation adoption migration strategy mysql compatible behavior,1
6580,8848084042.0,IssuesEvent,2019-01-08 05:13:07,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Drop column when column is not null ,component/DDL-need-LGT3 type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```sql
create table t1 (a int, b int not null);
alter table t1 drop column b; # in other session exec: insert into t1 set a=1;
```
When session 1 drop column b, and when column b in `model.StateWriteOnly`, I can't insert any data to table `t1`. Just like below.
```sql
mysql root@127.0.0.1:test> show create table t1;
+-------+-------------------------------------------------------------+
| Table | Create Table |
+-------+-------------------------------------------------------------+
| t1 | CREATE TABLE `t1` ( |
| | `a` int(11) DEFAULT NULL |
| | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin |
+-------+-------------------------------------------------------------+
1 row in set
Time: 0.004s
mysql root@127.0.0.1:test> insert into t1 set a=6;
(1364, u""Field 'b' doesn't have a default value"")
```
2. What did you expect to see?
Insert success.
3. What did you see instead?
return error.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```sql
mysql root@127.0.0.1:test> select tidb_version();
+--------------------------------------------------------------------------+
| tidb_version() |
+--------------------------------------------------------------------------+
| Release Version: v2.1.0-rc.3-294-g6e2d6c7aa-dirty |
| Git Commit Hash: 6e2d6c7aa7eba3ac4f3a5201f1a36bf534fa6298 |
| Git Branch: master |
| UTC Build Time: 2018-12-11 11:25:36 |
| GoVersion: go version go1.11.2 darwin/amd64 |
| Race Enabled: false |
| TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e |
| Check Table Before Drop: false |
+--------------------------------------------------------------------------+
```
",True,"Drop column when column is not null - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```sql
create table t1 (a int, b int not null);
alter table t1 drop column b; # in other session exec: insert into t1 set a=1;
```
When session 1 drop column b, and when column b in `model.StateWriteOnly`, I can't insert any data to table `t1`. Just like below.
```sql
mysql root@127.0.0.1:test> show create table t1;
+-------+-------------------------------------------------------------+
| Table | Create Table |
+-------+-------------------------------------------------------------+
| t1 | CREATE TABLE `t1` ( |
| | `a` int(11) DEFAULT NULL |
| | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin |
+-------+-------------------------------------------------------------+
1 row in set
Time: 0.004s
mysql root@127.0.0.1:test> insert into t1 set a=6;
(1364, u""Field 'b' doesn't have a default value"")
```
2. What did you expect to see?
Insert success.
3. What did you see instead?
return error.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```sql
mysql root@127.0.0.1:test> select tidb_version();
+--------------------------------------------------------------------------+
| tidb_version() |
+--------------------------------------------------------------------------+
| Release Version: v2.1.0-rc.3-294-g6e2d6c7aa-dirty |
| Git Commit Hash: 6e2d6c7aa7eba3ac4f3a5201f1a36bf534fa6298 |
| Git Branch: master |
| UTC Build Time: 2018-12-11 11:25:36 |
| GoVersion: go version go1.11.2 darwin/amd64 |
| Race Enabled: false |
| TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e |
| Check Table Before Drop: false |
+--------------------------------------------------------------------------+
```
",1,drop column when column is not null bug report please answer these questions before submitting your issue thanks what did you do sql create table a int b int not null alter table drop column b in other session exec insert into set a when session drop column b and when column b in model statewriteonly i can t insert any data to table just like below sql mysql root test show create table table create table create table a int default null engine innodb default charset collate bin row in set time mysql root test insert into set a u field b doesn t have a default value what did you expect to see insert success what did you see instead return error what version of tidb are you using tidb server v or run select tidb version on tidb sql mysql root test select tidb version tidb version release version rc dirty git commit hash git branch master utc build time goversion go version darwin race enabled false tikv min version alpha check table before drop false ,1
17762,24516203183.0,IssuesEvent,2022-10-11 05:23:53,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,reopened,Incompatible with MySQL 8.0 about create table with default expression,type/compatibility good first issue,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
➜ ~ tidiff 'create table ttest ( a int(10) default (rand()))'
MySQL(127.0.0.1:3306)> create table ttest ( a int(10) default (rand()))
Query OK (0.007 sec)
TiDB(127.0.0.1:4000)> create table ttest ( a int(10) default (rand()))
Error 1105: line 1 column 40 near ""rand()))"" (total length 48)
➜ ~ tidiff 'desc ttest'
MySQL(127.0.0.1:3306)> desc ttest
+------------------------------------------------------------+
| Field | Type | Null | Key | Default | Extra |
+------------------------------------------------------------+
| a | int(10) | YES | | rand() | DEFAULT_GENERATED |
+------------------------------------------------------------+
1 row in set (0.003 sec)
TiDB(127.0.0.1:4000)> desc ttest
Error 1146: Table 'test.ttest' doesn't exist
```
2. What did you expect to see?
Create table successfully.
3. What did you see instead?
Error message show above.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
TiDB(127.0.0.1:4000)> select tidb_version()
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v2.1.8-24-g7b36cdfb6-dirty
Git Commit Hash: 7b36cdfb6e8a4c279fc360ed79cf1c499b553688
Git Branch: failpoint-2.1
UTC Build Time: 2019-04-30 08:26:17
GoVersion: go version go1.12 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.002 sec)
```
",True,"Incompatible with MySQL 8.0 about create table with default expression - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
➜ ~ tidiff 'create table ttest ( a int(10) default (rand()))'
MySQL(127.0.0.1:3306)> create table ttest ( a int(10) default (rand()))
Query OK (0.007 sec)
TiDB(127.0.0.1:4000)> create table ttest ( a int(10) default (rand()))
Error 1105: line 1 column 40 near ""rand()))"" (total length 48)
➜ ~ tidiff 'desc ttest'
MySQL(127.0.0.1:3306)> desc ttest
+------------------------------------------------------------+
| Field | Type | Null | Key | Default | Extra |
+------------------------------------------------------------+
| a | int(10) | YES | | rand() | DEFAULT_GENERATED |
+------------------------------------------------------------+
1 row in set (0.003 sec)
TiDB(127.0.0.1:4000)> desc ttest
Error 1146: Table 'test.ttest' doesn't exist
```
2. What did you expect to see?
Create table successfully.
3. What did you see instead?
Error message show above.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
TiDB(127.0.0.1:4000)> select tidb_version()
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v2.1.8-24-g7b36cdfb6-dirty
Git Commit Hash: 7b36cdfb6e8a4c279fc360ed79cf1c499b553688
Git Branch: failpoint-2.1
UTC Build Time: 2019-04-30 08:26:17
GoVersion: go version go1.12 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.002 sec)
```
",1,incompatible with mysql about create table with default expression bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error ➜ tidiff create table ttest a int default rand mysql create table ttest a int default rand query ok sec tidb create table ttest a int default rand error line column near rand total length ➜ tidiff desc ttest mysql desc ttest field type null key default extra a int yes rand default generated row in set sec tidb desc ttest error table test ttest doesn t exist what did you expect to see create table successfully what did you see instead error message show above what version of tidb are you using tidb server v or run select tidb version on tidb tidb select tidb version tidb version release version dirty git commit hash git branch failpoint utc build time goversion go version darwin race enabled false tikv min version alpha check table before drop false row in set sec ,1
4044,6889458636.0,IssuesEvent,2017-11-22 10:26:37,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Check the index validity when executing `use index ...`,compatibility help wanted,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
create table tt(a int);
select count(*) from tt use index (idx);
```
2. What did you expect to see?
```
mysql> select count(*) from tt use index (idx);
ERROR 1176 (42000): Key 'idx' doesn't exist in table 'tt'
```
3. What did you see instead?
```
tidb> select count(*) from tt use index (idx);
+----------+
| count(*) |
+----------+
| 0 |
+----------+
1 row in set (0.00 sec)
```
",True,"Check the index validity when executing `use index ...` - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
create table tt(a int);
select count(*) from tt use index (idx);
```
2. What did you expect to see?
```
mysql> select count(*) from tt use index (idx);
ERROR 1176 (42000): Key 'idx' doesn't exist in table 'tt'
```
3. What did you see instead?
```
tidb> select count(*) from tt use index (idx);
+----------+
| count(*) |
+----------+
| 0 |
+----------+
1 row in set (0.00 sec)
```
",1,check the index validity when executing use index please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error create table tt a int select count from tt use index idx what did you expect to see mysql select count from tt use index idx error key idx doesn t exist in table tt what did you see instead tidb select count from tt use index idx count row in set sec ,1
16271,21897365190.0,IssuesEvent,2022-05-20 09:55:40,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,Don't display `flen` in `show create table` for type `int`,compatibility-mysql8,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```
create table t(a int);
show create table t;
```
### 2. What did you expect to see? (Required)
```
mysql> show create table t;
+-------+--------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+--------------------------------------------------------------------------------------------------------------+
| t | CREATE TABLE `t` (
`a` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
+-------+--------------------------------------------------------------------------------------------------------------+
```
### 3. What did you see instead (Required)
```
mysql> show create table t;
+-------+--------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+--------------------------------------------------------------------------------------------------------------+
| t | CREATE TABLE `t` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
+-------+--------------------------------------------------------------------------------------------------------------+
```
### 4. What is your TiDB version? (Required)
",True,"Don't display `flen` in `show create table` for type `int` - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```
create table t(a int);
show create table t;
```
### 2. What did you expect to see? (Required)
```
mysql> show create table t;
+-------+--------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+--------------------------------------------------------------------------------------------------------------+
| t | CREATE TABLE `t` (
`a` int DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
+-------+--------------------------------------------------------------------------------------------------------------+
```
### 3. What did you see instead (Required)
```
mysql> show create table t;
+-------+--------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+--------------------------------------------------------------------------------------------------------------+
| t | CREATE TABLE `t` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
+-------+--------------------------------------------------------------------------------------------------------------+
```
### 4. What is your TiDB version? (Required)
",1,don t display flen in show create table for type int bug report please answer these questions before submitting your issue thanks minimal reproduce step required create table t a int show create table t what did you expect to see required mysql show create table t table create table t create table t a int default null engine innodb default charset collate ai ci what did you see instead required mysql show create table t table create table t create table t a int default null engine innodb default charset collate ai ci what is your tidb version required ,1
4824,7445370429.0,IssuesEvent,2018-03-28 04:05:34,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,check invalid charset when create database.,DDL compatibility help wanted todo,"MySQL:
```
mysql> create database test1 character set uft8;
ERROR 1115 (42000): Unknown character set: 'uft8'
```
TiDB:
```
mysql> create database test1 character set uft8;
Query OK, 0 rows affected (0.08 sec)
mysql> show create database test1;
+----------+-----------------------------------------------------------------+
| Database | Create Database |
+----------+-----------------------------------------------------------------+
| test1 | CREATE DATABASE `test1` /* !40100 DEFAULT CHARACTER SET uft8 */ |
+----------+-----------------------------------------------------------------+
1 row in set (0.00 sec)
```",True,"check invalid charset when create database. - MySQL:
```
mysql> create database test1 character set uft8;
ERROR 1115 (42000): Unknown character set: 'uft8'
```
TiDB:
```
mysql> create database test1 character set uft8;
Query OK, 0 rows affected (0.08 sec)
mysql> show create database test1;
+----------+-----------------------------------------------------------------+
| Database | Create Database |
+----------+-----------------------------------------------------------------+
| test1 | CREATE DATABASE `test1` /* !40100 DEFAULT CHARACTER SET uft8 */ |
+----------+-----------------------------------------------------------------+
1 row in set (0.00 sec)
```",1,check invalid charset when create database mysql mysql create database character set error unknown character set tidb mysql create database character set query ok rows affected sec mysql show create database database create database create database default character set row in set sec ,1
12085,14247181455.0,IssuesEvent,2020-11-19 11:04:55,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Comparison result is incorrect between year column and int constant,challenge-program component/executor picked severity/critical sig/execution type/bug type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
``` mysql
create table t2 (a year(4));
insert into t2 values(69);
select * from t2 where a <= 69;
```
### 2. What did you expect to see? (Required)
In mysql 8.0
``` mysql
mysql> select * from t2 where a <= 69;
+------+
| a |
+------+
| 2069 |
+------+
1 row in set (0.00 sec)
```
### 3. What did you see instead (Required)
``` mysql
mysql> select * from t2 where a <= 69;
Empty set (0.00 sec)
mysql> explain select * from t2 where a <= 69;
+-------------------------+---------+-----------+---------------+--------------------------------+
| id | estRows | task | access object | operator info |
+-------------------------+---------+-----------+---------------+--------------------------------+
| TableReader_7 | 1.00 | root | | data:Selection_6 |
| └─Selection_6 | 1.00 | cop[tikv] | | le(test.t2.a, 69) |
| └─TableFullScan_5 | 3.00 | cop[tikv] | table:t2 | keep order:false, stats:pseudo |
+-------------------------+---------+-----------+---------------+--------------------------------+
3 rows in set (0.00 sec)
```
`69` should be adjusted to `2069`.
### 4. What is your TiDB version? (Required)
``` mysql
mysql> select tidb_version();
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: None
Edition: Community
Git Commit Hash: None
Git Branch: None
UTC Build Time: None
GoVersion: go1.15
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
## Score
- 600
## Mentor
* @lzmhhh123 ",True,"Comparison result is incorrect between year column and int constant - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
``` mysql
create table t2 (a year(4));
insert into t2 values(69);
select * from t2 where a <= 69;
```
### 2. What did you expect to see? (Required)
In mysql 8.0
``` mysql
mysql> select * from t2 where a <= 69;
+------+
| a |
+------+
| 2069 |
+------+
1 row in set (0.00 sec)
```
### 3. What did you see instead (Required)
``` mysql
mysql> select * from t2 where a <= 69;
Empty set (0.00 sec)
mysql> explain select * from t2 where a <= 69;
+-------------------------+---------+-----------+---------------+--------------------------------+
| id | estRows | task | access object | operator info |
+-------------------------+---------+-----------+---------------+--------------------------------+
| TableReader_7 | 1.00 | root | | data:Selection_6 |
| └─Selection_6 | 1.00 | cop[tikv] | | le(test.t2.a, 69) |
| └─TableFullScan_5 | 3.00 | cop[tikv] | table:t2 | keep order:false, stats:pseudo |
+-------------------------+---------+-----------+---------------+--------------------------------+
3 rows in set (0.00 sec)
```
`69` should be adjusted to `2069`.
### 4. What is your TiDB version? (Required)
``` mysql
mysql> select tidb_version();
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: None
Edition: Community
Git Commit Hash: None
Git Branch: None
UTC Build Time: None
GoVersion: go1.15
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
## Score
- 600
## Mentor
* @lzmhhh123 ",1,comparison result is incorrect between year column and int constant bug report please answer these questions before submitting your issue thanks minimal reproduce step required mysql create table a year insert into values select from where a what did you expect to see required in mysql mysql mysql select from where a a row in set sec what did you see instead required mysql mysql select from where a empty set sec mysql explain select from where a id estrows task access object operator info tablereader root data selection └─selection cop le test a └─tablefullscan cop table keep order false stats pseudo rows in set sec should be adjusted to what is your tidb version required mysql mysql select tidb version tidb version release version none edition community git commit hash none git branch none utc build time none goversion race enabled false tikv min version check table before drop false row in set sec score mentor ,1
9909,11912671370.0,IssuesEvent,2020-03-31 10:39:31,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,support `EXPLAIN [options] FOR CONNECTION connection_id`,help-wanted type/compatibility type/new-feature,"support obtaining the execution plan for an explainable statement executing in a named connection by using this statement:
```sql
EXPLAIN [options] FOR CONNECTION connection_id;
```
> Because of changes to data (and supporting statistics) it may produce a different result from running EXPLAIN on the equivalent query text. This difference in behavior can be useful in diagnosing more transient performance problems. For example, **if you are running a statement in one session that is taking a long time to complete, using EXPLAIN FOR CONNECTION in another session may yield useful information about the cause of the delay.**
reference: [8.8.4 Obtaining Execution Plan Information for a Named Connection](https://dev.mysql.com/doc/refman/5.7/en/explain-for-connection.html)",True,"support `EXPLAIN [options] FOR CONNECTION connection_id` - support obtaining the execution plan for an explainable statement executing in a named connection by using this statement:
```sql
EXPLAIN [options] FOR CONNECTION connection_id;
```
> Because of changes to data (and supporting statistics) it may produce a different result from running EXPLAIN on the equivalent query text. This difference in behavior can be useful in diagnosing more transient performance problems. For example, **if you are running a statement in one session that is taking a long time to complete, using EXPLAIN FOR CONNECTION in another session may yield useful information about the cause of the delay.**
reference: [8.8.4 Obtaining Execution Plan Information for a Named Connection](https://dev.mysql.com/doc/refman/5.7/en/explain-for-connection.html)",1,support explain for connection connection id support obtaining the execution plan for an explainable statement executing in a named connection by using this statement sql explain for connection connection id because of changes to data and supporting statistics it may produce a different result from running explain on the equivalent query text this difference in behavior can be useful in diagnosing more transient performance problems for example if you are running a statement in one session that is taking a long time to complete using explain for connection in another session may yield useful information about the cause of the delay reference ,1
7433,9673989573.0,IssuesEvent,2019-05-22 08:53:22,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,DROP USER IF EXISTS behavior difference,type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
This is a similar problem to https://github.com/pingcap/tidb/issues/7867 :
```
DROP USER IF EXISTS idontexist;
```
2. What did you expect to see?
MySQL:
```
mysql80> DROP USER IF EXISTS idontexist;
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql80> SHOW WARNINGS;
+-------+------+---------------------------------------------------+
| Level | Code | Message |
+-------+------+---------------------------------------------------+
| Note | 3162 | Authorization ID 'idontexist'@'%' does not exist. |
+-------+------+---------------------------------------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
```
mysql> DROP USER IF EXISTS idontexist;
Query OK, 0 rows affected (0.01 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v3.0.0-beta.1-109-g7666f688b
Git Commit Hash: 7666f688b3d91ea84fa6b0a20c2e784fff3c8945
Git Branch: master
UTC Build Time: 2019-04-17 05:09:28
GoVersion: go version go1.12.1 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
1 row in set (0.00 sec)
```",True,"DROP USER IF EXISTS behavior difference - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
This is a similar problem to https://github.com/pingcap/tidb/issues/7867 :
```
DROP USER IF EXISTS idontexist;
```
2. What did you expect to see?
MySQL:
```
mysql80> DROP USER IF EXISTS idontexist;
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql80> SHOW WARNINGS;
+-------+------+---------------------------------------------------+
| Level | Code | Message |
+-------+------+---------------------------------------------------+
| Note | 3162 | Authorization ID 'idontexist'@'%' does not exist. |
+-------+------+---------------------------------------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
```
mysql> DROP USER IF EXISTS idontexist;
Query OK, 0 rows affected (0.01 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v3.0.0-beta.1-109-g7666f688b
Git Commit Hash: 7666f688b3d91ea84fa6b0a20c2e784fff3c8945
Git Branch: master
UTC Build Time: 2019-04-17 05:09:28
GoVersion: go version go1.12.1 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
1 row in set (0.00 sec)
```",1,drop user if exists behavior difference bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error this is a similar problem to drop user if exists idontexist what did you expect to see mysql drop user if exists idontexist query ok rows affected warning sec show warnings level code message note authorization id idontexist does not exist row in set sec what did you see instead mysql drop user if exists idontexist query ok rows affected sec what version of tidb are you using tidb server v or run select tidb version on tidb mysql select tidb version g row tidb version release version beta git commit hash git branch master utc build time goversion go version linux race enabled false tikv min version alpha check table before drop false row in set sec ,1
5055,7647262207.0,IssuesEvent,2018-05-09 02:52:31,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,inconsistent behavior with MySQL when insert into time col,compatibility for-new-contributors help wanted,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
``` sql
create table t(a time(6));
insert into t value(20070219173709.055870);
insert into t value('20070219173709.055870');
select * from t;
```
2. What did you expect to see?
``` sql
mysql(127.0.0.1)> select * from t;
+-----------------+
| a |
+-----------------+
| 17:37:09.055870 |
| 17:37:09.055870 |
+-----------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
``` sql
tidb(127.0.0.1)> insert into t value(20070219173709.055870);
ERROR 1105 (HY000): cannot convert datum from bigint to type time.
tidb(127.0.0.1)> select * from t;
+-----------------+
| a |
+-----------------+
| 17:37:09.000000 |
+-----------------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
``` sql
tidb(127.0.0.1)> select tidb_version();
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v2.0.0-rc.3-12-gb6b708aa4
Git Commit Hash: b6b708aa4369f89147a3f9a31a9daff38c489999
Git Branch: master
UTC Build Time: 2018-04-03 08:14:49
GoVersion: go version go1.9.5 linux/amd64
TiKV Min Version: 1.1.0-dev.2 |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
```
",True,"inconsistent behavior with MySQL when insert into time col - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
``` sql
create table t(a time(6));
insert into t value(20070219173709.055870);
insert into t value('20070219173709.055870');
select * from t;
```
2. What did you expect to see?
``` sql
mysql(127.0.0.1)> select * from t;
+-----------------+
| a |
+-----------------+
| 17:37:09.055870 |
| 17:37:09.055870 |
+-----------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
``` sql
tidb(127.0.0.1)> insert into t value(20070219173709.055870);
ERROR 1105 (HY000): cannot convert datum from bigint to type time.
tidb(127.0.0.1)> select * from t;
+-----------------+
| a |
+-----------------+
| 17:37:09.000000 |
+-----------------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
``` sql
tidb(127.0.0.1)> select tidb_version();
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v2.0.0-rc.3-12-gb6b708aa4
Git Commit Hash: b6b708aa4369f89147a3f9a31a9daff38c489999
Git Branch: master
UTC Build Time: 2018-04-03 08:14:49
GoVersion: go version go1.9.5 linux/amd64
TiKV Min Version: 1.1.0-dev.2 |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
```
",1,inconsistent behavior with mysql when insert into time col please answer these questions before submitting your issue thanks what did you do sql create table t a time insert into t value insert into t value select from t what did you expect to see sql mysql select from t a row in set sec what did you see instead sql tidb insert into t value error cannot convert datum from bigint to type time tidb select from t a row in set sec what version of tidb are you using tidb server v or run select tidb version on tidb sql tidb select tidb version tidb version release version rc git commit hash git branch master utc build time goversion go version linux tikv min version dev ,1
5707,8176003887.0,IssuesEvent,2018-08-28 05:36:37,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,insert timestamp failure with 0000-00-00 00:00:00.000000 in prepare statement,type/bug type/compatibility,"1. What did you do?
```
CREATE TABLE timestamp_insert ( id INT NOT NULL PRIMARY KEY, tstamp TIMESTAMP NOT NULL )
```
then prepare and exec a insert 0000-00-00 00:00:00.000000 into `tstamp`
```
stmt= const_cast(""INSERT INTO timestamp_insert ( id, tstamp ) VALUES ( ?, ? )"");
if(mysql_stmt_prepare(mysql_stmt, stmt, strlen(stmt)))
{
my_chk_stmt(&mysql, mysql_stmt, __LINE__);
}
memset(mysql_bind_param, 0, sizeof(mysql_bind_param));
mysql_bind_param[0].buffer_type= MYSQL_TYPE_LONG;
mysql_bind_param[0].buffer= (char*)&id;
mysql_bind_param[0].is_null= 0;
mysql_bind_param[0].length= 0;
mysql_bind_param[1].buffer_type= MYSQL_TYPE_TIMESTAMP;
mysql_bind_param[1].buffer= &tstamp;
mysql_bind_param[1].is_null= 0;
mysql_bind_param[1].length= 0;
if(mysql_stmt_bind_param(mysql_stmt, mysql_bind_param))
{
my_chk_stmt(&mysql, mysql_stmt, __LINE__);
}
id= 2;
tstamp.year= 0;
tstamp.month= 0;
tstamp.day= 0;
tstamp.hour= 0;
tstamp.minute= 0;
tstamp.second= 0;
tstamp.second_part= 0;
if(mysql_stmt_execute(mysql_stmt))
{
my_chk_stmt(&mysql, mysql_stmt, __LINE__);
}
```
2. What did you expect to see?
```
success
```
3. What did you see instead?
```
1292 : invalid time format: '0'
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
2.1.0.rc1
```
",True,"insert timestamp failure with 0000-00-00 00:00:00.000000 in prepare statement - 1. What did you do?
```
CREATE TABLE timestamp_insert ( id INT NOT NULL PRIMARY KEY, tstamp TIMESTAMP NOT NULL )
```
then prepare and exec a insert 0000-00-00 00:00:00.000000 into `tstamp`
```
stmt= const_cast(""INSERT INTO timestamp_insert ( id, tstamp ) VALUES ( ?, ? )"");
if(mysql_stmt_prepare(mysql_stmt, stmt, strlen(stmt)))
{
my_chk_stmt(&mysql, mysql_stmt, __LINE__);
}
memset(mysql_bind_param, 0, sizeof(mysql_bind_param));
mysql_bind_param[0].buffer_type= MYSQL_TYPE_LONG;
mysql_bind_param[0].buffer= (char*)&id;
mysql_bind_param[0].is_null= 0;
mysql_bind_param[0].length= 0;
mysql_bind_param[1].buffer_type= MYSQL_TYPE_TIMESTAMP;
mysql_bind_param[1].buffer= &tstamp;
mysql_bind_param[1].is_null= 0;
mysql_bind_param[1].length= 0;
if(mysql_stmt_bind_param(mysql_stmt, mysql_bind_param))
{
my_chk_stmt(&mysql, mysql_stmt, __LINE__);
}
id= 2;
tstamp.year= 0;
tstamp.month= 0;
tstamp.day= 0;
tstamp.hour= 0;
tstamp.minute= 0;
tstamp.second= 0;
tstamp.second_part= 0;
if(mysql_stmt_execute(mysql_stmt))
{
my_chk_stmt(&mysql, mysql_stmt, __LINE__);
}
```
2. What did you expect to see?
```
success
```
3. What did you see instead?
```
1292 : invalid time format: '0'
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
2.1.0.rc1
```
",1,insert timestamp failure with in prepare statement what did you do create table timestamp insert id int not null primary key tstamp timestamp not null then prepare and exec a insert into tstamp stmt const cast insert into timestamp insert id tstamp values if mysql stmt prepare mysql stmt stmt strlen stmt my chk stmt mysql mysql stmt line memset mysql bind param sizeof mysql bind param mysql bind param buffer type mysql type long mysql bind param buffer char id mysql bind param is null mysql bind param length mysql bind param buffer type mysql type timestamp mysql bind param buffer tstamp mysql bind param is null mysql bind param length if mysql stmt bind param mysql stmt mysql bind param my chk stmt mysql mysql stmt line id tstamp year tstamp month tstamp day tstamp hour tstamp minute tstamp second tstamp second part if mysql stmt execute mysql stmt my chk stmt mysql mysql stmt line what did you expect to see success what did you see instead invalid time format what version of tidb are you using tidb server v or run select tidb version on tidb ,1
15854,20777989585.0,IssuesEvent,2022-03-16 12:21:54,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Clients with `mysql_native_password` cannot connect to TiDB,type/bug sig/sql-infra severity/critical compatibility-mysql8,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```go
dbaddr := fmt.Sprintf(""%s:%s@tcp(%s:%d)/%s?charset=utf8"", ""root"", """", ""127.0.0.1"", 4000, ""test"")
mdb, err := sql.Open(""mysql"", dbaddr)
if err != nil {
println(""open error:"", err.Error())
return
}
err = mdb.Ping()
if err != nil {
println(""ping error:"", err.Error())
return
}
mdb.Close()
```
with
```
require github.com/go-sql-driver/mysql v1.3.0
```
Note: mysql v1.6.0 is OK.
### 2. What did you expect to see? (Required)
No error
### 3. What did you see instead (Required)
ping error: this user requires mysql native password authentication.
### 4. What is your TiDB version? (Required)
master
This is caused by https://github.com/pingcap/tidb/pull/32338/files#diff-412615e1c1d4c6ae11a7885a11c879778bf401e0967c9c13c4b9dfd1f13ed29aR900
```go
if resp.Capability&mysql.ClientPluginAuth > 0 { // Previously, there is another condition before it: resp.AuthPlugin != mysql.AuthNativePassword
resp.AuthPlugin = mysql.AuthNativePassword
authData, err := cc.authSwitchRequest(ctx, mysql.AuthNativePassword)
if err != nil {
return nil, err
}
return authData, nil
}
```",True,"Clients with `mysql_native_password` cannot connect to TiDB - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```go
dbaddr := fmt.Sprintf(""%s:%s@tcp(%s:%d)/%s?charset=utf8"", ""root"", """", ""127.0.0.1"", 4000, ""test"")
mdb, err := sql.Open(""mysql"", dbaddr)
if err != nil {
println(""open error:"", err.Error())
return
}
err = mdb.Ping()
if err != nil {
println(""ping error:"", err.Error())
return
}
mdb.Close()
```
with
```
require github.com/go-sql-driver/mysql v1.3.0
```
Note: mysql v1.6.0 is OK.
### 2. What did you expect to see? (Required)
No error
### 3. What did you see instead (Required)
ping error: this user requires mysql native password authentication.
### 4. What is your TiDB version? (Required)
master
This is caused by https://github.com/pingcap/tidb/pull/32338/files#diff-412615e1c1d4c6ae11a7885a11c879778bf401e0967c9c13c4b9dfd1f13ed29aR900
```go
if resp.Capability&mysql.ClientPluginAuth > 0 { // Previously, there is another condition before it: resp.AuthPlugin != mysql.AuthNativePassword
resp.AuthPlugin = mysql.AuthNativePassword
authData, err := cc.authSwitchRequest(ctx, mysql.AuthNativePassword)
if err != nil {
return nil, err
}
return authData, nil
}
```",1,clients with mysql native password cannot connect to tidb bug report please answer these questions before submitting your issue thanks minimal reproduce step required go dbaddr fmt sprintf s s tcp s d s charset root test mdb err sql open mysql dbaddr if err nil println open error err error return err mdb ping if err nil println ping error err error return mdb close with require github com go sql driver mysql note mysql is ok what did you expect to see required no error what did you see instead required ping error this user requires mysql native password authentication what is your tidb version required master this is caused by go if resp capability mysql clientpluginauth previously there is another condition before it resp authplugin mysql authnativepassword resp authplugin mysql authnativepassword authdata err cc authswitchrequest ctx mysql authnativepassword if err nil return nil err return authdata nil ,1
6169,8571704484.0,IssuesEvent,2018-11-12 05:45:39,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Support NO_AUTO_CREATE_USER sql_mode,component/privilege for new contributors status/TODO type/compatibility,"## Feature Request
**Is your feature request related to a problem? Please describe:**
Currently the sql-mode `NO_AUTO_CREATE_USER` is parsed but ignored. This mode is important, since the MySQL permission model is otherwise vulnerable to spelling errors causing unathenticated users to have admin privileges. Consider the following hypothetical case:
```
-- A new user joins an organization, and is given read only access
CREATE USER 'morgantocker' IDENTIFIED BY 'sekret';
GRANT SELECT ON *.* TO 'morgantocker';
-- Time elapses.
-- The user is then given admin privileges by the organization:
GRANT ALL ON *.* TO 'morgantucker';
-- But there was a common spelling error, 'morgantucker' instead of 'morgantocker' !
-- This leads to a really bad situation, a new user is created with `ALL` and no password!
```
**Describe the feature you'd like:**
The sql_mode `NO_AUTO_CREATE_USER`, to be enabled by default (next GA) as it is in MySQL.
**Describe alternatives you've considered:**
N/A
**Teachability, Documentation, Adoption, Migration Strategy:**
N/A",True,"Support NO_AUTO_CREATE_USER sql_mode - ## Feature Request
**Is your feature request related to a problem? Please describe:**
Currently the sql-mode `NO_AUTO_CREATE_USER` is parsed but ignored. This mode is important, since the MySQL permission model is otherwise vulnerable to spelling errors causing unathenticated users to have admin privileges. Consider the following hypothetical case:
```
-- A new user joins an organization, and is given read only access
CREATE USER 'morgantocker' IDENTIFIED BY 'sekret';
GRANT SELECT ON *.* TO 'morgantocker';
-- Time elapses.
-- The user is then given admin privileges by the organization:
GRANT ALL ON *.* TO 'morgantucker';
-- But there was a common spelling error, 'morgantucker' instead of 'morgantocker' !
-- This leads to a really bad situation, a new user is created with `ALL` and no password!
```
**Describe the feature you'd like:**
The sql_mode `NO_AUTO_CREATE_USER`, to be enabled by default (next GA) as it is in MySQL.
**Describe alternatives you've considered:**
N/A
**Teachability, Documentation, Adoption, Migration Strategy:**
N/A",1,support no auto create user sql mode feature request is your feature request related to a problem please describe currently the sql mode no auto create user is parsed but ignored this mode is important since the mysql permission model is otherwise vulnerable to spelling errors causing unathenticated users to have admin privileges consider the following hypothetical case a new user joins an organization and is given read only access create user morgantocker identified by sekret grant select on to morgantocker time elapses the user is then given admin privileges by the organization grant all on to morgantucker but there was a common spelling error morgantucker instead of morgantocker this leads to a really bad situation a new user is created with all and no password describe the feature you d like the sql mode no auto create user to be enabled by default next ga as it is in mysql describe alternatives you ve considered n a teachability documentation adoption migration strategy n a,1
6390,8694481545.0,IssuesEvent,2018-12-04 12:47:13,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,"not support SET character_set_client=binary, but support character_set_client=utf8",type/compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
php SDK, every connection send 'not support SET character_set_client=binary' to server,
2. What did you expect to see?
work success.
3. What did you see instead?
2017/12/06 19:22:16.688 server.go:119: [info] [36] new connection 10.143.166.102:59039
2017/12/06 19:22:16.694 session.go:748: [warning] [36] parse error:
line 1 column 31 near """" (total length 31)
SET character_set_client=binary
2017/12/06 19:22:16.694 conn.go:430: [warning] [36] dispatch error:
4. What version of TiDB are you using (`tidb-server -V`)?
v1.1.0-alpha-221-gc46f289
",True,"not support SET character_set_client=binary, but support character_set_client=utf8 - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
php SDK, every connection send 'not support SET character_set_client=binary' to server,
2. What did you expect to see?
work success.
3. What did you see instead?
2017/12/06 19:22:16.688 server.go:119: [info] [36] new connection 10.143.166.102:59039
2017/12/06 19:22:16.694 session.go:748: [warning] [36] parse error:
line 1 column 31 near """" (total length 31)
SET character_set_client=binary
2017/12/06 19:22:16.694 conn.go:430: [warning] [36] dispatch error:
4. What version of TiDB are you using (`tidb-server -V`)?
v1.1.0-alpha-221-gc46f289
",1,not support set character set client binary but support character set client please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error php sdk every connection send not support set character set client binary to server what did you expect to see work success what did you see instead server go new connection session go parse error line column near total length set character set client binary conn go dispatch error what version of tidb are you using tidb server v alpha ,1
7090,9375182626.0,IssuesEvent,2019-04-04 02:49:02,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Table name and column name can not be scientific notation,type/bug type/compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
create table 1ea10 (1a20 int,1e int);
```
2. What did you expect to see?
Query OK, 0 rows affected (0.02 sec)
3. What did you see instead?
ERROR 1105 (HY000): line 0 column 15 near ""a10 (1a20 int,1e int)""float literal: strconv.ParseFloat: parsing ""1e"": invalid syntax (total length 36)
4. What version of TiDB are you using (`tidb-server -V`)?
",True,"Table name and column name can not be scientific notation - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
create table 1ea10 (1a20 int,1e int);
```
2. What did you expect to see?
Query OK, 0 rows affected (0.02 sec)
3. What did you see instead?
ERROR 1105 (HY000): line 0 column 15 near ""a10 (1a20 int,1e int)""float literal: strconv.ParseFloat: parsing ""1e"": invalid syntax (total length 36)
4. What version of TiDB are you using (`tidb-server -V`)?
",1,table name and column name can not be scientific notation please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error sql create table int int what did you expect to see query ok rows affected sec what did you see instead error line column near int int float literal strconv parsefloat parsing invalid syntax total length what version of tidb are you using tidb server v ,1
13731,16453363520.0,IssuesEvent,2021-05-21 09:07:19,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,update failed when value out of range,type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```sql
create table t(a int unsigned, b int);
insert into t values(2901245362, 610919452);
update t set b = a; -- fail in tidb, ok in mysql
update t set b = 2901245362; -- fail in tidb and mysql
```
looks like it is a MySQL's bug.
",True,"update failed when value out of range - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```sql
create table t(a int unsigned, b int);
insert into t values(2901245362, 610919452);
update t set b = a; -- fail in tidb, ok in mysql
update t set b = 2901245362; -- fail in tidb and mysql
```
looks like it is a MySQL's bug.
",1,update failed when value out of range bug report please answer these questions before submitting your issue thanks minimal reproduce step required sql create table t a int unsigned b int insert into t values update t set b a fail in tidb ok in mysql update t set b fail in tidb and mysql looks like it is a mysql s bug ,1
6435,8729199140.0,IssuesEvent,2018-12-10 19:33:51,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,error code and message of builtin time functions is not compatible with mysql,help wanted type/compatibility,"## 1. What did you do?
```sql
SELECT TO_DAYS('0000-00-00');
show warnings;
```
## 2. What did you expect to see?
```sql
MySQL > SELECT TO_DAYS('0000-00-00');
+-----------------------+
| TO_DAYS('0000-00-00') |
+-----------------------+
| NULL |
+-----------------------+
1 row in set, 1 warning (0.00 sec)
MySQL > show warnings;
+---------+------+----------------------------------------+
| Level | Code | Message |
+---------+------+----------------------------------------+
| Warning | 1292 | Incorrect datetime value: '0000-00-00' |
+---------+------+----------------------------------------+
1 row in set (0.00 sec)
```
## 3. What did you see instead?
```sql
TiDB > SELECT TO_DAYS('0000-00-00');
+-----------------------+
| TO_DAYS('0000-00-00') |
+-----------------------+
| NULL |
+-----------------------+
1 row in set, 1 warning (0.00 sec)
TiDB > show warnings;
+---------+------+---------------------+
| Level | Code | Message |
+---------+------+---------------------+
| Warning | 1105 | invalid time format |
+---------+------+---------------------+
1 row in set (0.00 sec)
```
## 4. What version of TiDB are you using (`tidb-server -V`)?
```sh
$./bin/tidb-server -V
Release Version: 0.8.0
Git Commit Hash: 447a8dce24ae9118b07017e77afdae0135be8790
Git Commit Branch: timefunc_week
UTC Build Time: 2017-08-21 01:20:23
```",True,"error code and message of builtin time functions is not compatible with mysql - ## 1. What did you do?
```sql
SELECT TO_DAYS('0000-00-00');
show warnings;
```
## 2. What did you expect to see?
```sql
MySQL > SELECT TO_DAYS('0000-00-00');
+-----------------------+
| TO_DAYS('0000-00-00') |
+-----------------------+
| NULL |
+-----------------------+
1 row in set, 1 warning (0.00 sec)
MySQL > show warnings;
+---------+------+----------------------------------------+
| Level | Code | Message |
+---------+------+----------------------------------------+
| Warning | 1292 | Incorrect datetime value: '0000-00-00' |
+---------+------+----------------------------------------+
1 row in set (0.00 sec)
```
## 3. What did you see instead?
```sql
TiDB > SELECT TO_DAYS('0000-00-00');
+-----------------------+
| TO_DAYS('0000-00-00') |
+-----------------------+
| NULL |
+-----------------------+
1 row in set, 1 warning (0.00 sec)
TiDB > show warnings;
+---------+------+---------------------+
| Level | Code | Message |
+---------+------+---------------------+
| Warning | 1105 | invalid time format |
+---------+------+---------------------+
1 row in set (0.00 sec)
```
## 4. What version of TiDB are you using (`tidb-server -V`)?
```sh
$./bin/tidb-server -V
Release Version: 0.8.0
Git Commit Hash: 447a8dce24ae9118b07017e77afdae0135be8790
Git Commit Branch: timefunc_week
UTC Build Time: 2017-08-21 01:20:23
```",1,error code and message of builtin time functions is not compatible with mysql what did you do sql select to days show warnings what did you expect to see sql mysql select to days to days null row in set warning sec mysql show warnings level code message warning incorrect datetime value row in set sec what did you see instead sql tidb select to days to days null row in set warning sec tidb show warnings level code message warning invalid time format row in set sec what version of tidb are you using tidb server v sh bin tidb server v release version git commit hash git commit branch timefunc week utc build time ,1
3673,6545287682.0,IssuesEvent,2017-09-04 03:22:49,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,support `INSERT IGNORE` and `UPDATE IGNORE`,compatibility help wanted,"## 1. What did you do?
Strict mode controls how TiDB and MySQL handles invalid or missing values in data-change statements such as `INSERT` or `UPDATE`.
If strict mode is not in effect, TiDB and MySQL inserts adjusted values for invalid or missing values and produces warnings. In strict mode, users can produce this behavior by using `INSERT IGNORE` or `UPDATE IGNORE`
TiDB doesn't support `INSERT IGNORE` or `UPDATE IGNORE` currently.
## 2. What did you expect to see?
```sql
drop table if exists t;
create table t(a bigint);
```
```sql
MySQL > insert ignore into t select ""1a"";
Query OK, 1 row affected, 1 warning (0.01 sec)
Records: 1 Duplicates: 0 Warnings: 1
```
## 3. What did you see instead?
```sql
TiDB > insert ignore into t select ""1a"";
ERROR 1265 (01000): Data Truncated
```
## 4. What version of TiDB are you using?
```sh
$./bin/tidb-server -V
Release Version: 0.8.0
Git Commit Hash: 97e9dfe92ce8acb6fa42834097a504379c711567
Git Commit Branch: master
UTC Build Time: 2017-08-21 08:53:16
```
",True,"support `INSERT IGNORE` and `UPDATE IGNORE` - ## 1. What did you do?
Strict mode controls how TiDB and MySQL handles invalid or missing values in data-change statements such as `INSERT` or `UPDATE`.
If strict mode is not in effect, TiDB and MySQL inserts adjusted values for invalid or missing values and produces warnings. In strict mode, users can produce this behavior by using `INSERT IGNORE` or `UPDATE IGNORE`
TiDB doesn't support `INSERT IGNORE` or `UPDATE IGNORE` currently.
## 2. What did you expect to see?
```sql
drop table if exists t;
create table t(a bigint);
```
```sql
MySQL > insert ignore into t select ""1a"";
Query OK, 1 row affected, 1 warning (0.01 sec)
Records: 1 Duplicates: 0 Warnings: 1
```
## 3. What did you see instead?
```sql
TiDB > insert ignore into t select ""1a"";
ERROR 1265 (01000): Data Truncated
```
## 4. What version of TiDB are you using?
```sh
$./bin/tidb-server -V
Release Version: 0.8.0
Git Commit Hash: 97e9dfe92ce8acb6fa42834097a504379c711567
Git Commit Branch: master
UTC Build Time: 2017-08-21 08:53:16
```
",1,support insert ignore and update ignore what did you do strict mode controls how tidb and mysql handles invalid or missing values in data change statements such as insert or update if strict mode is not in effect tidb and mysql inserts adjusted values for invalid or missing values and produces warnings in strict mode users can produce this behavior by using insert ignore or update ignore tidb doesn t support insert ignore or update ignore currently what did you expect to see sql drop table if exists t create table t a bigint sql mysql insert ignore into t select query ok row affected warning sec records duplicates warnings what did you see instead sql tidb insert ignore into t select error data truncated what version of tidb are you using sh bin tidb server v release version git commit hash git commit branch master utc build time ,1
3401,6368052279.0,IssuesEvent,2017-08-01 08:15:26,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Insert data need to filter spaces,bug compatibility rc3.1,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```
create table t (a char(10) not null, b char (10) binary not null);
insert into t values(""hello "", ""hello "");
select b, length(b) from t;
```
2. What did you expect to see?
```
+-------+-----------+
| b | length(b) |
+-------+-----------+
| hello | 5 |
+-------+-----------+
1 row in set (0.00 sec)
```
3. What did you see instead?
```
+----------+-----------+
| b | length(b) |
+----------+-----------+
| hello | 8 |
+----------+-----------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V`)?
",True,"Insert data need to filter spaces - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```
create table t (a char(10) not null, b char (10) binary not null);
insert into t values(""hello "", ""hello "");
select b, length(b) from t;
```
2. What did you expect to see?
```
+-------+-----------+
| b | length(b) |
+-------+-----------+
| hello | 5 |
+-------+-----------+
1 row in set (0.00 sec)
```
3. What did you see instead?
```
+----------+-----------+
| b | length(b) |
+----------+-----------+
| hello | 8 |
+----------+-----------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V`)?
",1,insert data need to filter spaces please answer these questions before submitting your issue thanks what did you do create table t a char not null b char binary not null insert into t values hello hello select b length b from t what did you expect to see b length b hello row in set sec what did you see instead b length b hello row in set sec what version of tidb are you using tidb server v ,1
7074,9359291082.0,IssuesEvent,2019-04-02 06:21:25,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,reopened,"compatibility: “show full columns” prints wrong Collation for date, datatime, timestamp columns",type/compatibility,"```
create table t1 (a date,b datetime,c timestamp);
show full columns from t1;
```
TiDB shows a different collation value (""binary"") than mysql(null), this is not a big deal in most cases. It's reported that a CDC software called ""Attunity"" check the ""collation"" output of ""show full columns"" of the tables that managed by itself.
the tool can't pass the db usability check ,pls take a look.
MySQL 5.7.20
> +-------+-----------+-----------+------+-----+---------+-------+---------------------------------+---------+
> | Field | Type | Collation | Null | Key | Default | Extra | Privileges | Comment |
> +-------+-----------+-----------+------+-----+---------+-------+---------------------------------+---------+
> | a | date | NULL | YES | | NULL | | select,insert,update,references | |
> | b | datetime | NULL | YES | | NULL | | select,insert,update,references | |
> | c | timestamp | NULL | YES | | NULL | | select,insert,update,references | |
> +-------+-----------+-----------+------+-----+---------+-------+---------------------------------+---------+
> 3 rows in set (0.00 sec)
TiDB 2.1.6:
> +-------+-----------+-----------+------+------+---------+-------+---------------------------------+---------+
> | Field | Type | Collation | Null | Key | Default | Extra | Privileges | Comment |
> +-------+-----------+-----------+------+------+---------+-------+---------------------------------+---------+
> | a | date | binary | YES | | NULL | | select,insert,update,references | |
> | b | datetime | binary | YES | | NULL | | select,insert,update,references | |
> | c | timestamp | binary | YES | | NULL | | select,insert,update,references | |
> +-------+-----------+-----------+------+------+---------+-------+---------------------------------+---------+
> 3 rows in set (0.01 sec)
> Release Version: v2.1.6
> Git Commit Hash: 66e639e8e127f71662f37287eb984dd84d169cba
> Git Branch: HEAD
> UTC Build Time: 2019-03-15 09:09:07
> GoVersion: go version go1.11.2 linux/amd64
> Race Enabled: false
> TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
> Check Table Before Drop: false",True,"compatibility: “show full columns” prints wrong Collation for date, datatime, timestamp columns - ```
create table t1 (a date,b datetime,c timestamp);
show full columns from t1;
```
TiDB shows a different collation value (""binary"") than mysql(null), this is not a big deal in most cases. It's reported that a CDC software called ""Attunity"" check the ""collation"" output of ""show full columns"" of the tables that managed by itself.
the tool can't pass the db usability check ,pls take a look.
MySQL 5.7.20
> +-------+-----------+-----------+------+-----+---------+-------+---------------------------------+---------+
> | Field | Type | Collation | Null | Key | Default | Extra | Privileges | Comment |
> +-------+-----------+-----------+------+-----+---------+-------+---------------------------------+---------+
> | a | date | NULL | YES | | NULL | | select,insert,update,references | |
> | b | datetime | NULL | YES | | NULL | | select,insert,update,references | |
> | c | timestamp | NULL | YES | | NULL | | select,insert,update,references | |
> +-------+-----------+-----------+------+-----+---------+-------+---------------------------------+---------+
> 3 rows in set (0.00 sec)
TiDB 2.1.6:
> +-------+-----------+-----------+------+------+---------+-------+---------------------------------+---------+
> | Field | Type | Collation | Null | Key | Default | Extra | Privileges | Comment |
> +-------+-----------+-----------+------+------+---------+-------+---------------------------------+---------+
> | a | date | binary | YES | | NULL | | select,insert,update,references | |
> | b | datetime | binary | YES | | NULL | | select,insert,update,references | |
> | c | timestamp | binary | YES | | NULL | | select,insert,update,references | |
> +-------+-----------+-----------+------+------+---------+-------+---------------------------------+---------+
> 3 rows in set (0.01 sec)
> Release Version: v2.1.6
> Git Commit Hash: 66e639e8e127f71662f37287eb984dd84d169cba
> Git Branch: HEAD
> UTC Build Time: 2019-03-15 09:09:07
> GoVersion: go version go1.11.2 linux/amd64
> Race Enabled: false
> TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
> Check Table Before Drop: false",1,compatibility “show full columns” prints wrong collation for date datatime timestamp columns create table a date b datetime c timestamp show full columns from tidb shows a different collation value binary than mysql null this is not a big deal in most cases it s reported that a cdc software called attunity check the collation output of show full columns of the tables that managed by itself the tool can t pass the db usability check pls take a look mysql field type collation null key default extra privileges comment a date null yes null select insert update references b datetime null yes null select insert update references c timestamp null yes null select insert update references rows in set sec tidb field type collation null key default extra privileges comment a date binary yes null select insert update references b datetime binary yes null select insert update references c timestamp binary yes null select insert update references rows in set sec release version git commit hash git branch head utc build time goversion go version linux race enabled false tikv min version alpha check table before drop false,1
3775,6647147343.0,IssuesEvent,2017-09-28 02:01:56,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed," `show variables` statement don't support ""Combination SQL Modes""",compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
1). `show variables` statement don't support ""Combination SQL Modes"".
2). `show variables` statement don't remove duplicates.
my PR is on the way.
2. What did you expect to see?
```
mysql> set sql_mode='ANSI';
Query OK, 0 rows affected (0.00 sec)
mysql> show variables like 'SQL_MODE';
+---------------+-------------------------------------------------------------+
| Variable_name | Value |
+---------------+-------------------------------------------------------------+
| sql_mode | REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI |
+---------------+-------------------------------------------------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
```
tidb>set sql_mode='ANSI';
Query OK, 0 rows affected (3 min 54.46 sec)
tidb>show variables like 'SQL_MODE';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| sql_mode | ANSI |
+---------------+-------+
```
4. What version of TiDB are you using (`tidb-server -V`)?
```
Release Version: 0.9.0
Git Commit Hash: 376a7ddbddd0de91153ee36f6b6a434f22578363
Git Commit Branch: master
UTC Build Time: 2017-09-21 09:53:01
```",True," `show variables` statement don't support ""Combination SQL Modes"" - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
1). `show variables` statement don't support ""Combination SQL Modes"".
2). `show variables` statement don't remove duplicates.
my PR is on the way.
2. What did you expect to see?
```
mysql> set sql_mode='ANSI';
Query OK, 0 rows affected (0.00 sec)
mysql> show variables like 'SQL_MODE';
+---------------+-------------------------------------------------------------+
| Variable_name | Value |
+---------------+-------------------------------------------------------------+
| sql_mode | REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI |
+---------------+-------------------------------------------------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
```
tidb>set sql_mode='ANSI';
Query OK, 0 rows affected (3 min 54.46 sec)
tidb>show variables like 'SQL_MODE';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| sql_mode | ANSI |
+---------------+-------+
```
4. What version of TiDB are you using (`tidb-server -V`)?
```
Release Version: 0.9.0
Git Commit Hash: 376a7ddbddd0de91153ee36f6b6a434f22578363
Git Commit Branch: master
UTC Build Time: 2017-09-21 09:53:01
```",1, show variables statement don t support combination sql modes please answer these questions before submitting your issue thanks what did you do show variables statement don t support combination sql modes show variables statement don t remove duplicates my pr is on the way what did you expect to see mysql set sql mode ansi query ok rows affected sec mysql show variables like sql mode variable name value sql mode real as float pipes as concat ansi quotes ignore space ansi row in set sec what did you see instead tidb set sql mode ansi query ok rows affected min sec tidb show variables like sql mode variable name value sql mode ansi what version of tidb are you using tidb server v release version git commit hash git commit branch master utc build time ,1
14279,17156776288.0,IssuesEvent,2021-07-14 07:59:34,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,The result of `timestamp` is not compatible with MySQL,sig/execution type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```
drop table if exists t;
create table t(col decimal(45,8) default 13.654 not null);
insert into t set col = 0.4352;
set @@sql_mode=""ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"";
select timestamp(123.123);
select timestamp(0.123);
select timestamp(col) from t;
set @@sql_mode=""ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"";
select timestamp(123.123);
select timestamp(0.123);
select timestamp(col) from t;
```
### 2. What did you expect to see? (Required)
```
mysql> set @@sql_mode=""ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"";
Query OK, 0 rows affected (0.01 sec)
mysql> select timestamp(123.123);
+-------------------------+
| timestamp(123.123) |
+-------------------------+
| 2000-01-23 00:00:00.000 |
+-------------------------+
1 row in set (0.00 sec)
mysql> select timestamp(0.123);
+------------------+
| timestamp(0.123) |
+------------------+
| NULL |
+------------------+
1 row in set, 1 warning (0.00 sec)
mysql> select timestamp(col) from t;
+----------------+
| timestamp(col) |
+----------------+
| NULL |
+----------------+
1 row in set, 1 warning (0.01 sec)
mysql> set @@sql_mode=""ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"";
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> select timestamp(123.123);
+-------------------------+
| timestamp(123.123) |
+-------------------------+
| 2000-01-23 00:00:00.000 |
+-------------------------+
1 row in set (0.01 sec)
mysql> select timestamp(0.123);
+-------------------------+
| timestamp(0.123) |
+-------------------------+
| 0000-00-00 00:00:00.123 |
+-------------------------+
1 row in set (0.00 sec)
mysql> select timestamp(col) from t;
+----------------------------+
| timestamp(col) |
+----------------------------+
| 0000-00-00 00:00:00.435200 |
+----------------------------+
1 row in set (0.00 sec)
```
### 3. What did you see instead (Required)
```
tidb> set @@sql_mode=""ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"";
Query OK, 0 rows affected (0.00 sec)
tidb> select timestamp(123.123);
+-------------------------+
| timestamp(123.123) |
+-------------------------+
| 2000-01-23 00:00:00.000 |
+-------------------------+
1 row in set (0.00 sec)
tidb> select timestamp(0.123);
+-------------------------+
| timestamp(0.123) |
+-------------------------+
| 0000-00-00 00:00:00.000 |
+-------------------------+
1 row in set (0.00 sec)
tidb> select timestamp(col) from t;
+----------------------------+
| timestamp(col) |
+----------------------------+
| 0000-00-00 00:00:00.000000 |
+----------------------------+
1 row in set (0.00 sec)
tidb> set @@sql_mode=""ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"";
Query OK, 0 rows affected (0.00 sec)
tidb> select timestamp(123.123);
+-------------------------+
| timestamp(123.123) |
+-------------------------+
| 2000-01-23 00:00:00.000 |
+-------------------------+
1 row in set (0.01 sec)
tidb> select timestamp(0.123);
+-------------------------+
| timestamp(0.123) |
+-------------------------+
| 0000-00-00 00:00:00.000 |
+-------------------------+
1 row in set (0.00 sec)
tidb> select timestamp(col) from t;
+----------------------------+
| timestamp(col) |
+----------------------------+
| 0000-00-00 00:00:00.000000 |
+----------------------------+
1 row in set (0.00 sec)
```
### 4. What is your TiDB version? (Required)
0158f71cda6ccbbd382c6e8759904234baca259c
",True,"The result of `timestamp` is not compatible with MySQL - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```
drop table if exists t;
create table t(col decimal(45,8) default 13.654 not null);
insert into t set col = 0.4352;
set @@sql_mode=""ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"";
select timestamp(123.123);
select timestamp(0.123);
select timestamp(col) from t;
set @@sql_mode=""ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"";
select timestamp(123.123);
select timestamp(0.123);
select timestamp(col) from t;
```
### 2. What did you expect to see? (Required)
```
mysql> set @@sql_mode=""ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"";
Query OK, 0 rows affected (0.01 sec)
mysql> select timestamp(123.123);
+-------------------------+
| timestamp(123.123) |
+-------------------------+
| 2000-01-23 00:00:00.000 |
+-------------------------+
1 row in set (0.00 sec)
mysql> select timestamp(0.123);
+------------------+
| timestamp(0.123) |
+------------------+
| NULL |
+------------------+
1 row in set, 1 warning (0.00 sec)
mysql> select timestamp(col) from t;
+----------------+
| timestamp(col) |
+----------------+
| NULL |
+----------------+
1 row in set, 1 warning (0.01 sec)
mysql> set @@sql_mode=""ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"";
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> select timestamp(123.123);
+-------------------------+
| timestamp(123.123) |
+-------------------------+
| 2000-01-23 00:00:00.000 |
+-------------------------+
1 row in set (0.01 sec)
mysql> select timestamp(0.123);
+-------------------------+
| timestamp(0.123) |
+-------------------------+
| 0000-00-00 00:00:00.123 |
+-------------------------+
1 row in set (0.00 sec)
mysql> select timestamp(col) from t;
+----------------------------+
| timestamp(col) |
+----------------------------+
| 0000-00-00 00:00:00.435200 |
+----------------------------+
1 row in set (0.00 sec)
```
### 3. What did you see instead (Required)
```
tidb> set @@sql_mode=""ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"";
Query OK, 0 rows affected (0.00 sec)
tidb> select timestamp(123.123);
+-------------------------+
| timestamp(123.123) |
+-------------------------+
| 2000-01-23 00:00:00.000 |
+-------------------------+
1 row in set (0.00 sec)
tidb> select timestamp(0.123);
+-------------------------+
| timestamp(0.123) |
+-------------------------+
| 0000-00-00 00:00:00.000 |
+-------------------------+
1 row in set (0.00 sec)
tidb> select timestamp(col) from t;
+----------------------------+
| timestamp(col) |
+----------------------------+
| 0000-00-00 00:00:00.000000 |
+----------------------------+
1 row in set (0.00 sec)
tidb> set @@sql_mode=""ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"";
Query OK, 0 rows affected (0.00 sec)
tidb> select timestamp(123.123);
+-------------------------+
| timestamp(123.123) |
+-------------------------+
| 2000-01-23 00:00:00.000 |
+-------------------------+
1 row in set (0.01 sec)
tidb> select timestamp(0.123);
+-------------------------+
| timestamp(0.123) |
+-------------------------+
| 0000-00-00 00:00:00.000 |
+-------------------------+
1 row in set (0.00 sec)
tidb> select timestamp(col) from t;
+----------------------------+
| timestamp(col) |
+----------------------------+
| 0000-00-00 00:00:00.000000 |
+----------------------------+
1 row in set (0.00 sec)
```
### 4. What is your TiDB version? (Required)
0158f71cda6ccbbd382c6e8759904234baca259c
",1,the result of timestamp is not compatible with mysql bug report please answer these questions before submitting your issue thanks minimal reproduce step required drop table if exists t create table t col decimal default not null insert into t set col set sql mode only full group by strict trans tables no zero in date no zero date error for division by zero no engine substitution select timestamp select timestamp select timestamp col from t set sql mode only full group by strict trans tables error for division by zero no engine substitution select timestamp select timestamp select timestamp col from t what did you expect to see required mysql set sql mode only full group by strict trans tables no zero in date no zero date error for division by zero no engine substitution query ok rows affected sec mysql select timestamp timestamp row in set sec mysql select timestamp timestamp null row in set warning sec mysql select timestamp col from t timestamp col null row in set warning sec mysql set sql mode only full group by strict trans tables error for division by zero no engine substitution query ok rows affected warning sec mysql select timestamp timestamp row in set sec mysql select timestamp timestamp row in set sec mysql select timestamp col from t timestamp col row in set sec what did you see instead required tidb set sql mode only full group by strict trans tables no zero in date no zero date error for division by zero no engine substitution query ok rows affected sec tidb select timestamp timestamp row in set sec tidb select timestamp timestamp row in set sec tidb select timestamp col from t timestamp col row in set sec tidb set sql mode only full group by strict trans tables error for division by zero no engine substitution query ok rows affected sec tidb select timestamp timestamp row in set sec tidb select timestamp timestamp row in set sec tidb select timestamp col from t timestamp col row in set sec what is your tidb version required ,1
4323,7045264199.0,IssuesEvent,2018-01-01 17:08:42,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,invalid time cast bug.,compatibility help wanted,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
`select cast('239010' as time);`
2. What did you expect to see?
```
mysql> select cast('239010' as time);
+------------------------+
| cast('239010' as time) |
+------------------------+
| NULL |
+------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> show warnings;
+---------+------+------------------------------------------+
| Level | Code | Message |
+---------+------+------------------------------------------+
| Warning | 1292 | Truncated incorrect time value: '239010' |
+---------+------+------------------------------------------+
1 row in set (0.04 sec)
```
3. What did you see instead?
```
mysql> select cast('239010' as time);
+------------------------+
| cast('239010' as time) |
+------------------------+
| 24:30:10 |
+------------------------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V`)?
```
Release Version: 0.8.0
Git Commit Hash: ae512b3e3e66eb2464be71d42cc61cbd2302b302
Git Branch: master
UTC Build Time: 2017-08-20 09:27:45
```",True,"invalid time cast bug. - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
`select cast('239010' as time);`
2. What did you expect to see?
```
mysql> select cast('239010' as time);
+------------------------+
| cast('239010' as time) |
+------------------------+
| NULL |
+------------------------+
1 row in set, 1 warning (0.00 sec)
mysql> show warnings;
+---------+------+------------------------------------------+
| Level | Code | Message |
+---------+------+------------------------------------------+
| Warning | 1292 | Truncated incorrect time value: '239010' |
+---------+------+------------------------------------------+
1 row in set (0.04 sec)
```
3. What did you see instead?
```
mysql> select cast('239010' as time);
+------------------------+
| cast('239010' as time) |
+------------------------+
| 24:30:10 |
+------------------------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V`)?
```
Release Version: 0.8.0
Git Commit Hash: ae512b3e3e66eb2464be71d42cc61cbd2302b302
Git Branch: master
UTC Build Time: 2017-08-20 09:27:45
```",1,invalid time cast bug please answer these questions before submitting your issue thanks what did you do select cast as time what did you expect to see mysql select cast as time cast as time null row in set warning sec mysql show warnings level code message warning truncated incorrect time value row in set sec what did you see instead mysql select cast as time cast as time row in set sec what version of tidb are you using tidb server v release version git commit hash git branch master utc build time ,1
11610,13652838854.0,IssuesEvent,2020-09-27 09:37:38,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Different error message from MySQL when `group by` a window function or agg function with a `as`,severity/moderate sig/planner type/bug type/compatibility,"## Bug Report
### 1. What did you do?
In a select stmt, `group by` a number, and this number refers to a window function or aggregation function with a `as`.
### 2. What did you expect to see?
In 8.0.19 MySQL Community:
```
MySQL [test]> select row_number() over () as x from t group by 1;
ERROR 1056 (42000): Can't group on 'x'
MySQL [test]> select sum(a) as x from t group by 1;
ERROR 1056 (42000): Can't group on 'x'
```
### 3. What did you see instead?
In TiDB:
```
MySQL [test]> select row_number() over () as x from t group by 1;
ERROR 1056 (42000): Can't group on ''
MySQL [test]> select sum(a) as x from t group by 1;
ERROR 1056 (42000): Can't group on ''
```
### 4. What version of TiDB are you using? (`tidb-server -V` or run `select tidb_version();` on TiDB)
Release Version: v4.0.0-beta-710-gac8785a97",True,"Different error message from MySQL when `group by` a window function or agg function with a `as` - ## Bug Report
### 1. What did you do?
In a select stmt, `group by` a number, and this number refers to a window function or aggregation function with a `as`.
### 2. What did you expect to see?
In 8.0.19 MySQL Community:
```
MySQL [test]> select row_number() over () as x from t group by 1;
ERROR 1056 (42000): Can't group on 'x'
MySQL [test]> select sum(a) as x from t group by 1;
ERROR 1056 (42000): Can't group on 'x'
```
### 3. What did you see instead?
In TiDB:
```
MySQL [test]> select row_number() over () as x from t group by 1;
ERROR 1056 (42000): Can't group on ''
MySQL [test]> select sum(a) as x from t group by 1;
ERROR 1056 (42000): Can't group on ''
```
### 4. What version of TiDB are you using? (`tidb-server -V` or run `select tidb_version();` on TiDB)
Release Version: v4.0.0-beta-710-gac8785a97",1,different error message from mysql when group by a window function or agg function with a as bug report what did you do in a select stmt group by a number and this number refers to a window function or aggregation function with a as what did you expect to see in mysql community mysql select row number over as x from t group by error can t group on x mysql select sum a as x from t group by error can t group on x what did you see instead in tidb mysql select row number over as x from t group by error can t group on mysql select sum a as x from t group by error can t group on what version of tidb are you using tidb server v or run select tidb version on tidb release version beta ,1
3500,6485730661.0,IssuesEvent,2017-08-19 13:18:43,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,type inference of `@@GLOBAL.sql_mode` and `@@SESSION.sql_mode` is incorrect,compatibility easy,"## 1. What did you do?
result type's `Collation` and `Type` of `@@GLOBAL.sql_mode` and `@@SESSION.sql_mode` is incorrect
## 2. What did you expect to see?
```sql
MySQL > SELECT @@GLOBAL.sql_mode;
Field 1: `@@GLOBAL.sql_mode`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: VAR_STRING
Collation: utf8_general_ci (33)
Length: 411
Max_length: 137
Decimals: 31
Flags:
+-------------------------------------------------------------------------------------------------------------------------------------------+
| @@GLOBAL.sql_mode |
+-------------------------------------------------------------------------------------------------------------------------------------------+
| ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
+-------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
```sql
MySQL > SELECT @@SESSION.sql_mode;
Field 1: `@@SESSION.sql_mode`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: VAR_STRING
Collation: utf8_general_ci (33)
Length: 411
Max_length: 137
Decimals: 31
Flags:
+-------------------------------------------------------------------------------------------------------------------------------------------+
| @@SESSION.sql_mode |
+-------------------------------------------------------------------------------------------------------------------------------------------+
| ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
+-------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
## 3. What did you see instead?
```sql
TiDB > SELECT @@GLOBAL.sql_mode;
Field 1: `@@GLOBAL.sql_mode`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: STRING
Collation: ? (0)
Length: 0
Max_length: 42
Decimals: 31
Flags:
+--------------------------------------------+
| @@GLOBAL.sql_mode |
+--------------------------------------------+
| STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION |
+--------------------------------------------+
1 row in set (0.00 sec)
```
```sql
TiDB > SELECT @@SESSION.sql_mode;
Field 1: `@@SESSION.sql_mode`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: STRING
Collation: ? (0)
Length: 0
Max_length: 42
Decimals: 31
Flags:
+--------------------------------------------+
| @@SESSION.sql_mode |
+--------------------------------------------+
| STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION |
+--------------------------------------------+
1 row in set (0.00 sec)
```
## 4. What version of TiDB are you using (`tidb-server -V`)?
",True,"type inference of `@@GLOBAL.sql_mode` and `@@SESSION.sql_mode` is incorrect - ## 1. What did you do?
result type's `Collation` and `Type` of `@@GLOBAL.sql_mode` and `@@SESSION.sql_mode` is incorrect
## 2. What did you expect to see?
```sql
MySQL > SELECT @@GLOBAL.sql_mode;
Field 1: `@@GLOBAL.sql_mode`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: VAR_STRING
Collation: utf8_general_ci (33)
Length: 411
Max_length: 137
Decimals: 31
Flags:
+-------------------------------------------------------------------------------------------------------------------------------------------+
| @@GLOBAL.sql_mode |
+-------------------------------------------------------------------------------------------------------------------------------------------+
| ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
+-------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
```sql
MySQL > SELECT @@SESSION.sql_mode;
Field 1: `@@SESSION.sql_mode`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: VAR_STRING
Collation: utf8_general_ci (33)
Length: 411
Max_length: 137
Decimals: 31
Flags:
+-------------------------------------------------------------------------------------------------------------------------------------------+
| @@SESSION.sql_mode |
+-------------------------------------------------------------------------------------------------------------------------------------------+
| ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
+-------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
## 3. What did you see instead?
```sql
TiDB > SELECT @@GLOBAL.sql_mode;
Field 1: `@@GLOBAL.sql_mode`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: STRING
Collation: ? (0)
Length: 0
Max_length: 42
Decimals: 31
Flags:
+--------------------------------------------+
| @@GLOBAL.sql_mode |
+--------------------------------------------+
| STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION |
+--------------------------------------------+
1 row in set (0.00 sec)
```
```sql
TiDB > SELECT @@SESSION.sql_mode;
Field 1: `@@SESSION.sql_mode`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: STRING
Collation: ? (0)
Length: 0
Max_length: 42
Decimals: 31
Flags:
+--------------------------------------------+
| @@SESSION.sql_mode |
+--------------------------------------------+
| STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION |
+--------------------------------------------+
1 row in set (0.00 sec)
```
## 4. What version of TiDB are you using (`tidb-server -V`)?
",1,type inference of global sql mode and session sql mode is incorrect what did you do result type s collation and type of global sql mode and session sql mode is incorrect what did you expect to see sql mysql select global sql mode field global sql mode catalog def database table org table type var string collation general ci length max length decimals flags global sql mode only full group by strict trans tables no zero in date no zero date error for division by zero no auto create user no engine substitution row in set sec sql mysql select session sql mode field session sql mode catalog def database table org table type var string collation general ci length max length decimals flags session sql mode only full group by strict trans tables no zero in date no zero date error for division by zero no auto create user no engine substitution row in set sec what did you see instead sql tidb select global sql mode field global sql mode catalog def database table org table type string collation length max length decimals flags global sql mode strict trans tables no engine substitution row in set sec sql tidb select session sql mode field session sql mode catalog def database table org table type string collation length max length decimals flags session sql mode strict trans tables no engine substitution row in set sec what version of tidb are you using tidb server v ,1
11777,13891945328.0,IssuesEvent,2020-10-19 11:27:42,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,reopened,"Function des_encrypt, des_decrypt not supported",status/help-wanted type/compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
select des_encrypt('hello');
select des_decrypt(NULL);
```
2. What did you expect to see?
```
des_encrypt('hello')
??2nV??}
des_decrypt(NULL)
NULL
```
3. What did you see instead?
```
ERROR 1305 (42000) at line 1: FUNCTION DES_ENCRYPT does not exist
ERROR 1305 (42000): FUNCTION DES_DECRYPT does not exist
```
4. What version of TiDB are you using (`tidb-server -V`)?
",True,"Function des_encrypt, des_decrypt not supported - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
select des_encrypt('hello');
select des_decrypt(NULL);
```
2. What did you expect to see?
```
des_encrypt('hello')
??2nV??}
des_decrypt(NULL)
NULL
```
3. What did you see instead?
```
ERROR 1305 (42000) at line 1: FUNCTION DES_ENCRYPT does not exist
ERROR 1305 (42000): FUNCTION DES_DECRYPT does not exist
```
4. What version of TiDB are you using (`tidb-server -V`)?
",1,function des encrypt des decrypt not supported please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error sql select des encrypt hello select des decrypt null what did you expect to see des encrypt hello des decrypt null null what did you see instead error at line function des encrypt does not exist error function des decrypt does not exist what version of tidb are you using tidb server v ,1
20393,30184434668.0,IssuesEvent,2023-07-04 11:04:25,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,Navicat user management compatibility,type/bug type/compatibility,"## Bug Report
Try to manage users in TiDB with Navicat
### 1. Minimal reproduce step (Required)
With Navicat 16.2.2 click the ""User"" button.
### 2. What did you expect to see? (Required)
User management
### 3. What did you see instead (Required)
![image](https://github.com/pingcap/tidb/assets/1272980/65ab1ecb-611b-4d64-9afa-9e30089a06e5)
### 4. What is your TiDB version? (Required)
```
Release Version: v7.2.0
Edition: Community
Git Commit Hash: 9fd5f4a8e4f273a60fbe7d3848f85a1be8f0600b
Git Branch: heads/refs/tags/v7.2.0
UTC Build Time: 2023-06-27 15:04:42
GoVersion: go1.20.5
Race Enabled: false
Check Table Before Drop: false
Store: tikv
```
",True,"Navicat user management compatibility - ## Bug Report
Try to manage users in TiDB with Navicat
### 1. Minimal reproduce step (Required)
With Navicat 16.2.2 click the ""User"" button.
### 2. What did you expect to see? (Required)
User management
### 3. What did you see instead (Required)
![image](https://github.com/pingcap/tidb/assets/1272980/65ab1ecb-611b-4d64-9afa-9e30089a06e5)
### 4. What is your TiDB version? (Required)
```
Release Version: v7.2.0
Edition: Community
Git Commit Hash: 9fd5f4a8e4f273a60fbe7d3848f85a1be8f0600b
Git Branch: heads/refs/tags/v7.2.0
UTC Build Time: 2023-06-27 15:04:42
GoVersion: go1.20.5
Race Enabled: false
Check Table Before Drop: false
Store: tikv
```
",1,navicat user management compatibility bug report try to manage users in tidb with navicat minimal reproduce step required with navicat click the user button what did you expect to see required user management what did you see instead required what is your tidb version required release version edition community git commit hash git branch heads refs tags utc build time goversion race enabled false check table before drop false store tikv ,1
6229,8630721276.0,IssuesEvent,2018-11-22 03:36:00,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,information_shema.files miss some column,help wanted type/bug type/compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What version of Go are you using (`go version`)?
1.5.3
2. What operating system and processor architecture are you using (`go env`)?
Linux
3. What did you do?
desc information_schema.files
4. What did you expect to see?
mysql> desc files;
+----------------------+---------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------------------+---------------------+------+-----+---------+-------+
| FILE_ID | bigint(4) | NO | | 0 | |
| FILE_NAME | varchar(64) | YES | | NULL | |
| FILE_TYPE | varchar(20) | NO | | | |
| TABLESPACE_NAME | varchar(64) | YES | | NULL | |
| TABLE_CATALOG | varchar(64) | NO | | | |
| TABLE_SCHEMA | varchar(64) | YES | | NULL | |
| TABLE_NAME | varchar(64) | YES | | NULL | |
| LOGFILE_GROUP_NAME | varchar(64) | YES | | NULL | |
| LOGFILE_GROUP_NUMBER | bigint(4) | YES | | NULL | |
| ENGINE | varchar(64) | NO | | | |
| FULLTEXT_KEYS | varchar(64) | YES | | NULL | |
| DELETED_ROWS | bigint(4) | YES | | NULL | |
| UPDATE_COUNT | bigint(4) | YES | | NULL | |
| FREE_EXTENTS | bigint(4) | YES | | NULL | |
| TOTAL_EXTENTS | bigint(4) | YES | | NULL | |
| EXTENT_SIZE | bigint(4) | NO | | 0 | |
| INITIAL_SIZE | bigint(21) unsigned | YES | | NULL | |
| MAXIMUM_SIZE | bigint(21) unsigned | YES | | NULL | |
| AUTOEXTEND_SIZE | bigint(21) unsigned | YES | | NULL | |
| CREATION_TIME | datetime | YES | | NULL | |
| LAST_UPDATE_TIME | datetime | YES | | NULL | |
| LAST_ACCESS_TIME | datetime | YES | | NULL | |
| RECOVER_TIME | bigint(4) | YES | | NULL | |
| TRANSACTION_COUNTER | bigint(4) | YES | | NULL | |
| VERSION | bigint(21) unsigned | YES | | NULL | |
| ROW_FORMAT | varchar(10) | YES | | NULL | |
| TABLE_ROWS | bigint(21) unsigned | YES | | NULL | |
| AVG_ROW_LENGTH | bigint(21) unsigned | YES | | NULL | |
| DATA_LENGTH | bigint(21) unsigned | YES | | NULL | |
| MAX_DATA_LENGTH | bigint(21) unsigned | YES | | NULL | |
| INDEX_LENGTH | bigint(21) unsigned | YES | | NULL | |
| DATA_FREE | bigint(21) unsigned | YES | | NULL | |
| CREATE_TIME | datetime | YES | | NULL | |
| UPDATE_TIME | datetime | YES | | NULL | |
| CHECK_TIME | datetime | YES | | NULL | |
| CHECKSUM | bigint(21) unsigned | YES | | NULL | |
| STATUS | varchar(20) | NO | | | |
| EXTRA | varchar(255) | YES | | NULL | |
+----------------------+---------------------+------+-----+---------+-------+
38 rows in set (0.00 sec)
5. What did you see instead?
mysql> desc files;
+----------------------+-----------------------+------+------+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------------------+-----------------------+------+------+---------+-------+
| FILE_ID | bigint(4,0) UNSIGNED | YES | | NULL | |
| FILE_NAME | varchar(64,0) | YES | | NULL | |
| TABLESPACE_NAME | varchar(20,0) | YES | | NULL | |
| TABLE_CATALOG | varchar(64,0) | YES | | NULL | |
| TABLE_SCHEMA | varchar(64,0) | YES | | NULL | |
| TABLE_NAME | varchar(64,0) | YES | | NULL | |
| LOGFILE_GROUP_NAME | varchar(64,0) | YES | | NULL | |
| LOGFILE_GROUP_NUMBER | bigint(32,0) UNSIGNED | YES | | NULL | |
| ENGINE | varchar(64,0) | YES | | NULL | |
| FULLTEXT_KEYS | varchar(64,0) | YES | | NULL | |
| DELETED_ROWS | bigint(4,0) UNSIGNED | YES | | NULL | |
| UPDATE_COUNT | bigint(4,0) UNSIGNED | YES | | NULL | |
| FREE_EXTENTS | bigint(4,0) UNSIGNED | YES | | NULL | |
| TOTAL_EXTENTS | bigint(4,0) UNSIGNED | YES | | NULL | |
| EXTENT_SIZE | bigint(4,0) UNSIGNED | YES | | NULL | |
| INITIAL_SIZE | bigint(21,0) UNSIGNED | YES | | NULL | |
| MAXIMUM_SIZE | bigint(21,0) UNSIGNED | YES | | NULL | |
| AUTOEXTEND_SIZE | bigint(21,0) UNSIGNED | YES | | NULL | |
| CREATION_TIME | datetime UNSIGNED | YES | | NULL | |
| LAST_UPDATE_TIME | datetime UNSIGNED | YES | | NULL | |
| LAST_ACCESS_TIME | datetime UNSIGNED | YES | | NULL | |
| RECOVER_TIME | bigint(4,0) UNSIGNED | YES | | NULL | |
| TRANSACTION_COUNTER | bigint(4,0) UNSIGNED | YES | | NULL | |
| VERSION | bigint(21,0) UNSIGNED | YES | | NULL | |
| ROW_FORMAT | varchar(21,0) | YES | | NULL | |
| TABLE_ROWS | bigint(21,0) UNSIGNED | YES | | NULL | |
| AVG_ROW_LENGTH | bigint(21,0) UNSIGNED | YES | | NULL | |
| DATA_FREE | bigint(21,0) UNSIGNED | YES | | NULL | |
| CREATE_TIME | datetime UNSIGNED | YES | | NULL | |
| UPDATE_TIME | datetime UNSIGNED | YES | | NULL | |
| CHECK_TIME | datetime UNSIGNED | YES | | NULL | |
| CHECKSUM | bigint(21,0) UNSIGNED | YES | | NULL | |
| STATUS | varchar(20,0) | YES | | NULL | |
| EXTRA | varchar(255,0) | YES | | NULL | |
+----------------------+-----------------------+------+------+---------+-------+
34 rows in set (0.01 sec)
",True,"information_shema.files miss some column - Please answer these questions before submitting your issue. Thanks!
1. What version of Go are you using (`go version`)?
1.5.3
2. What operating system and processor architecture are you using (`go env`)?
Linux
3. What did you do?
desc information_schema.files
4. What did you expect to see?
mysql> desc files;
+----------------------+---------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------------------+---------------------+------+-----+---------+-------+
| FILE_ID | bigint(4) | NO | | 0 | |
| FILE_NAME | varchar(64) | YES | | NULL | |
| FILE_TYPE | varchar(20) | NO | | | |
| TABLESPACE_NAME | varchar(64) | YES | | NULL | |
| TABLE_CATALOG | varchar(64) | NO | | | |
| TABLE_SCHEMA | varchar(64) | YES | | NULL | |
| TABLE_NAME | varchar(64) | YES | | NULL | |
| LOGFILE_GROUP_NAME | varchar(64) | YES | | NULL | |
| LOGFILE_GROUP_NUMBER | bigint(4) | YES | | NULL | |
| ENGINE | varchar(64) | NO | | | |
| FULLTEXT_KEYS | varchar(64) | YES | | NULL | |
| DELETED_ROWS | bigint(4) | YES | | NULL | |
| UPDATE_COUNT | bigint(4) | YES | | NULL | |
| FREE_EXTENTS | bigint(4) | YES | | NULL | |
| TOTAL_EXTENTS | bigint(4) | YES | | NULL | |
| EXTENT_SIZE | bigint(4) | NO | | 0 | |
| INITIAL_SIZE | bigint(21) unsigned | YES | | NULL | |
| MAXIMUM_SIZE | bigint(21) unsigned | YES | | NULL | |
| AUTOEXTEND_SIZE | bigint(21) unsigned | YES | | NULL | |
| CREATION_TIME | datetime | YES | | NULL | |
| LAST_UPDATE_TIME | datetime | YES | | NULL | |
| LAST_ACCESS_TIME | datetime | YES | | NULL | |
| RECOVER_TIME | bigint(4) | YES | | NULL | |
| TRANSACTION_COUNTER | bigint(4) | YES | | NULL | |
| VERSION | bigint(21) unsigned | YES | | NULL | |
| ROW_FORMAT | varchar(10) | YES | | NULL | |
| TABLE_ROWS | bigint(21) unsigned | YES | | NULL | |
| AVG_ROW_LENGTH | bigint(21) unsigned | YES | | NULL | |
| DATA_LENGTH | bigint(21) unsigned | YES | | NULL | |
| MAX_DATA_LENGTH | bigint(21) unsigned | YES | | NULL | |
| INDEX_LENGTH | bigint(21) unsigned | YES | | NULL | |
| DATA_FREE | bigint(21) unsigned | YES | | NULL | |
| CREATE_TIME | datetime | YES | | NULL | |
| UPDATE_TIME | datetime | YES | | NULL | |
| CHECK_TIME | datetime | YES | | NULL | |
| CHECKSUM | bigint(21) unsigned | YES | | NULL | |
| STATUS | varchar(20) | NO | | | |
| EXTRA | varchar(255) | YES | | NULL | |
+----------------------+---------------------+------+-----+---------+-------+
38 rows in set (0.00 sec)
5. What did you see instead?
mysql> desc files;
+----------------------+-----------------------+------+------+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------------------+-----------------------+------+------+---------+-------+
| FILE_ID | bigint(4,0) UNSIGNED | YES | | NULL | |
| FILE_NAME | varchar(64,0) | YES | | NULL | |
| TABLESPACE_NAME | varchar(20,0) | YES | | NULL | |
| TABLE_CATALOG | varchar(64,0) | YES | | NULL | |
| TABLE_SCHEMA | varchar(64,0) | YES | | NULL | |
| TABLE_NAME | varchar(64,0) | YES | | NULL | |
| LOGFILE_GROUP_NAME | varchar(64,0) | YES | | NULL | |
| LOGFILE_GROUP_NUMBER | bigint(32,0) UNSIGNED | YES | | NULL | |
| ENGINE | varchar(64,0) | YES | | NULL | |
| FULLTEXT_KEYS | varchar(64,0) | YES | | NULL | |
| DELETED_ROWS | bigint(4,0) UNSIGNED | YES | | NULL | |
| UPDATE_COUNT | bigint(4,0) UNSIGNED | YES | | NULL | |
| FREE_EXTENTS | bigint(4,0) UNSIGNED | YES | | NULL | |
| TOTAL_EXTENTS | bigint(4,0) UNSIGNED | YES | | NULL | |
| EXTENT_SIZE | bigint(4,0) UNSIGNED | YES | | NULL | |
| INITIAL_SIZE | bigint(21,0) UNSIGNED | YES | | NULL | |
| MAXIMUM_SIZE | bigint(21,0) UNSIGNED | YES | | NULL | |
| AUTOEXTEND_SIZE | bigint(21,0) UNSIGNED | YES | | NULL | |
| CREATION_TIME | datetime UNSIGNED | YES | | NULL | |
| LAST_UPDATE_TIME | datetime UNSIGNED | YES | | NULL | |
| LAST_ACCESS_TIME | datetime UNSIGNED | YES | | NULL | |
| RECOVER_TIME | bigint(4,0) UNSIGNED | YES | | NULL | |
| TRANSACTION_COUNTER | bigint(4,0) UNSIGNED | YES | | NULL | |
| VERSION | bigint(21,0) UNSIGNED | YES | | NULL | |
| ROW_FORMAT | varchar(21,0) | YES | | NULL | |
| TABLE_ROWS | bigint(21,0) UNSIGNED | YES | | NULL | |
| AVG_ROW_LENGTH | bigint(21,0) UNSIGNED | YES | | NULL | |
| DATA_FREE | bigint(21,0) UNSIGNED | YES | | NULL | |
| CREATE_TIME | datetime UNSIGNED | YES | | NULL | |
| UPDATE_TIME | datetime UNSIGNED | YES | | NULL | |
| CHECK_TIME | datetime UNSIGNED | YES | | NULL | |
| CHECKSUM | bigint(21,0) UNSIGNED | YES | | NULL | |
| STATUS | varchar(20,0) | YES | | NULL | |
| EXTRA | varchar(255,0) | YES | | NULL | |
+----------------------+-----------------------+------+------+---------+-------+
34 rows in set (0.01 sec)
",1,information shema files miss some column please answer these questions before submitting your issue thanks what version of go are you using go version what operating system and processor architecture are you using go env linux what did you do desc information schema files what did you expect to see mysql desc files field type null key default extra file id bigint no file name varchar yes null file type varchar no tablespace name varchar yes null table catalog varchar no table schema varchar yes null table name varchar yes null logfile group name varchar yes null logfile group number bigint yes null engine varchar no fulltext keys varchar yes null deleted rows bigint yes null update count bigint yes null free extents bigint yes null total extents bigint yes null extent size bigint no initial size bigint unsigned yes null maximum size bigint unsigned yes null autoextend size bigint unsigned yes null creation time datetime yes null last update time datetime yes null last access time datetime yes null recover time bigint yes null transaction counter bigint yes null version bigint unsigned yes null row format varchar yes null table rows bigint unsigned yes null avg row length bigint unsigned yes null data length bigint unsigned yes null max data length bigint unsigned yes null index length bigint unsigned yes null data free bigint unsigned yes null create time datetime yes null update time datetime yes null check time datetime yes null checksum bigint unsigned yes null status varchar no extra varchar yes null rows in set sec what did you see instead mysql desc files field type null key default extra file id bigint unsigned yes null file name varchar yes null tablespace name varchar yes null table catalog varchar yes null table schema varchar yes null table name varchar yes null logfile group name varchar yes null logfile group number bigint unsigned yes null engine varchar yes null fulltext keys varchar yes null deleted rows bigint unsigned yes null update count bigint unsigned yes null free extents bigint unsigned yes null total extents bigint unsigned yes null extent size bigint unsigned yes null initial size bigint unsigned yes null maximum size bigint unsigned yes null autoextend size bigint unsigned yes null creation time datetime unsigned yes null last update time datetime unsigned yes null last access time datetime unsigned yes null recover time bigint unsigned yes null transaction counter bigint unsigned yes null version bigint unsigned yes null row format varchar yes null table rows bigint unsigned yes null avg row length bigint unsigned yes null data free bigint unsigned yes null create time datetime unsigned yes null update time datetime unsigned yes null check time datetime unsigned yes null checksum bigint unsigned yes null status varchar yes null extra varchar yes null rows in set sec ,1
4096,6916831329.0,IssuesEvent,2017-11-29 05:09:01,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Show warning for `kill pid` statement,compatibility,Sine we use `kill tidb pid` instead of `kill pid`. We should return a warning for `kill pid` to notify user that their command is not executed as expected.,True,Show warning for `kill pid` statement - Sine we use `kill tidb pid` instead of `kill pid`. We should return a warning for `kill pid` to notify user that their command is not executed as expected.,1,show warning for kill pid statement sine we use kill tidb pid instead of kill pid we should return a warning for kill pid to notify user that their command is not executed as expected ,1
13519,16013671256.0,IssuesEvent,2021-04-20 13:43:49,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Support temporary table,feature/accepted type/compatibility type/feature-request,"1. What did you do?
`create temporary table t1( n int);`
2.What did you expect to see?
Query OK, 0 rows affected (0.00 sec)
3.What did you see instead?
ERROR 1105 (HY000): line 1 column 8 near ""temporary""
It can refer to [MySQL Doc](http://dev.mysql.com/doc/refman/5.7/en/create-table.html)
",True,"Support temporary table - 1. What did you do?
`create temporary table t1( n int);`
2.What did you expect to see?
Query OK, 0 rows affected (0.00 sec)
3.What did you see instead?
ERROR 1105 (HY000): line 1 column 8 near ""temporary""
It can refer to [MySQL Doc](http://dev.mysql.com/doc/refman/5.7/en/create-table.html)
",1,support temporary table what did you do create temporary table n int what did you expect to see query ok rows affected sec what did you see instead error line column near temporary it can refer to ,1
12778,15044067321.0,IssuesEvent,2021-02-03 02:07:03,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,mpp: the precision of avg(decimal) is wider than that from mysql,component/expression type/bug type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
create table test.t (id int, value decimal(6,3));
alter table test.t set tiflash replica 1;
insert into test.t values(1,2.3),(3,4.5),(5,6.7);
insert into test.t values(null,null),(1,null),(null,3.3);
### 2. What did you expect to see? (Required)
mysql> select avg(value) from t group by id;
+------------+
| avg(value) |
+------------+
| 2.3000000 |
| 6.7000000 |
| 4.5000000 |
| 3.3000000 |
+------------+
### 3. What did you see instead (Required)
````
mysql> select avg(value) from t group by id;
+---------------+
| avg(value) |
+---------------+
| 2.30000000000 |
| 6.70000000000 |
| 4.50000000000 |
| 3.30000000000 |
+---------------+
mysql> set @@tidb_allow_mpp=1;
Query OK, 0 rows affected (0.00 sec)
mysql> desc select avg(value) as av from t group by id having av>4;
+--------------------------------------+---------+--------------+---------------+---------------------------------------------------------------------------------------------+
| id | estRows | task | access object | operator info |
+--------------------------------------+---------+--------------+---------------+---------------------------------------------------------------------------------------------+
| Selection_7 | 3.60 | root | | gt(Column#4, 4) |
| └─TableReader_30 | 4.50 | root | | data:ExchangeSender_29 |
| └─ExchangeSender_29 | 4.50 | cop[tiflash] | | ExchangeType: PassThrough |
| └─Projection_25 | 4.50 | cop[tiflash] | | if(eq(Column#8, 0), , div(Column#4, cast(Column#8, decimal(20,0) BINARY)))->Column#4 |
| └─HashAgg_26 | 4.50 | cop[tiflash] | | group by:test.t.id, funcs:sum(Column#9)->Column#8, funcs:sum(Column#10)->Column#4 |
| └─ExchangeReceiver_28 | 4.50 | cop[tiflash] | | |
| └─ExchangeSender_27 | 4.50 | cop[tiflash] | | ExchangeType: HashPartition, Hash Cols: test.t.id |
| └─HashAgg_11 | 4.50 | cop[tiflash] | | group by:test.t.id, funcs:count(test.t.value)->Column#9, funcs:sum(test.t.value)->Column#10 |
| └─TableFullScan_24 | 9.00 | cop[tiflash] | table:t | keep order:false |
+--------------------------------------+---------+--------------+---------------+---------------------------------------------------------------------------------------------+
9 rows in set (0.00 sec)
```
### 4. What is your TiDB version? (Required)
master
",True,"mpp: the precision of avg(decimal) is wider than that from mysql - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
create table test.t (id int, value decimal(6,3));
alter table test.t set tiflash replica 1;
insert into test.t values(1,2.3),(3,4.5),(5,6.7);
insert into test.t values(null,null),(1,null),(null,3.3);
### 2. What did you expect to see? (Required)
mysql> select avg(value) from t group by id;
+------------+
| avg(value) |
+------------+
| 2.3000000 |
| 6.7000000 |
| 4.5000000 |
| 3.3000000 |
+------------+
### 3. What did you see instead (Required)
````
mysql> select avg(value) from t group by id;
+---------------+
| avg(value) |
+---------------+
| 2.30000000000 |
| 6.70000000000 |
| 4.50000000000 |
| 3.30000000000 |
+---------------+
mysql> set @@tidb_allow_mpp=1;
Query OK, 0 rows affected (0.00 sec)
mysql> desc select avg(value) as av from t group by id having av>4;
+--------------------------------------+---------+--------------+---------------+---------------------------------------------------------------------------------------------+
| id | estRows | task | access object | operator info |
+--------------------------------------+---------+--------------+---------------+---------------------------------------------------------------------------------------------+
| Selection_7 | 3.60 | root | | gt(Column#4, 4) |
| └─TableReader_30 | 4.50 | root | | data:ExchangeSender_29 |
| └─ExchangeSender_29 | 4.50 | cop[tiflash] | | ExchangeType: PassThrough |
| └─Projection_25 | 4.50 | cop[tiflash] | | if(eq(Column#8, 0), , div(Column#4, cast(Column#8, decimal(20,0) BINARY)))->Column#4 |
| └─HashAgg_26 | 4.50 | cop[tiflash] | | group by:test.t.id, funcs:sum(Column#9)->Column#8, funcs:sum(Column#10)->Column#4 |
| └─ExchangeReceiver_28 | 4.50 | cop[tiflash] | | |
| └─ExchangeSender_27 | 4.50 | cop[tiflash] | | ExchangeType: HashPartition, Hash Cols: test.t.id |
| └─HashAgg_11 | 4.50 | cop[tiflash] | | group by:test.t.id, funcs:count(test.t.value)->Column#9, funcs:sum(test.t.value)->Column#10 |
| └─TableFullScan_24 | 9.00 | cop[tiflash] | table:t | keep order:false |
+--------------------------------------+---------+--------------+---------------+---------------------------------------------------------------------------------------------+
9 rows in set (0.00 sec)
```
### 4. What is your TiDB version? (Required)
master
",1,mpp the precision of avg decimal is wider than that from mysql bug report please answer these questions before submitting your issue thanks minimal reproduce step required create table test t id int value decimal alter table test t set tiflash replica insert into test t values insert into test t values null null null null what did you expect to see required mysql select avg value from t group by id avg value what did you see instead required mysql select avg value from t group by id avg value mysql set tidb allow mpp query ok rows affected sec mysql desc select avg value as av from t group by id having av id estrows task access object operator info selection root gt column └─tablereader root data exchangesender └─exchangesender cop exchangetype passthrough └─projection cop if eq column div column cast column decimal binary column └─hashagg cop group by test t id funcs sum column column funcs sum column column └─exchangereceiver cop └─exchangesender cop exchangetype hashpartition hash cols test t id └─hashagg cop group by test t id funcs count test t value column funcs sum test t value column └─tablefullscan cop table t keep order false rows in set sec what is your tidb version required master ,1
11070,13097298340.0,IssuesEvent,2020-08-03 17:12:02,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,The result of `show variables` is not compatible with MySQL,status/help-wanted type/compatibility type/duplicate,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
select @@global.sql_log_bin;
show variables like ""sql_log_bin"";
```
2. What did you expect to see?
Your MySQL connection id is 172
Server version: 5.7.20 Homebrew
```
mysql> select @@global.sql_log_bin;
+----------------------+
| @@global.sql_log_bin |
+----------------------+
| 1 |
+----------------------+
1 row in set, 1 warning (0.00 sec)
mysql> show variables like ""sql_log_bin"";
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| sql_log_bin | ON |
+---------------+-------+
1 row in set (0.00 sec)
```
3. What did you see instead?
```
tidb> select @@global.sql_log_bin;
+----------------------+
| @@global.sql_log_bin |
+----------------------+
| 1 |
+----------------------+
1 row in set (0.00 sec)
tidb> show variables like ""sql_log_bin"";
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| sql_log_bin | 1 |
+---------------+-------+
1 row in set (0.02 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
Release Version: v3.0.0-beta-69-g84d1513b0-dirty
Git Commit Hash: 84d1513b09222c60ffba2d3397b6745e5148a603
Git Branch: master",True,"The result of `show variables` is not compatible with MySQL - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
select @@global.sql_log_bin;
show variables like ""sql_log_bin"";
```
2. What did you expect to see?
Your MySQL connection id is 172
Server version: 5.7.20 Homebrew
```
mysql> select @@global.sql_log_bin;
+----------------------+
| @@global.sql_log_bin |
+----------------------+
| 1 |
+----------------------+
1 row in set, 1 warning (0.00 sec)
mysql> show variables like ""sql_log_bin"";
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| sql_log_bin | ON |
+---------------+-------+
1 row in set (0.00 sec)
```
3. What did you see instead?
```
tidb> select @@global.sql_log_bin;
+----------------------+
| @@global.sql_log_bin |
+----------------------+
| 1 |
+----------------------+
1 row in set (0.00 sec)
tidb> show variables like ""sql_log_bin"";
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| sql_log_bin | 1 |
+---------------+-------+
1 row in set (0.02 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
Release Version: v3.0.0-beta-69-g84d1513b0-dirty
Git Commit Hash: 84d1513b09222c60ffba2d3397b6745e5148a603
Git Branch: master",1,the result of show variables is not compatible with mysql bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error select global sql log bin show variables like sql log bin what did you expect to see your mysql connection id is server version homebrew mysql select global sql log bin global sql log bin row in set warning sec mysql show variables like sql log bin variable name value sql log bin on row in set sec what did you see instead tidb select global sql log bin global sql log bin row in set sec tidb show variables like sql log bin variable name value sql log bin row in set sec what version of tidb are you using tidb server v or run select tidb version on tidb release version beta dirty git commit hash git branch master,1
20584,30582031316.0,IssuesEvent,2023-07-21 10:24:46,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,"Default value for TEXT, BLOB or JSON columns",type/bug type/compatibility sig/sql-infra compatibility-mysql8,"## Bug Report
TiDB doesn't allow a default value for TEXT, BLOB or JSON columns.
### 1. Minimal reproduce step (Required)
```sql
CREATE TABLE t1 (id INT PRIMARY KEY, c1 TEXT DEFAULT 'foo');
CREATE TABLE t1 (id INT PRIMARY KEY, c1 TEXT DEFAULT ('foo'));
SHOW CREATE TABLE t1\G
INSERT INTO t1(id) VALUES(1);
TABLE t1;
```
### 2. What did you expect to see? (Required)
With MySQL 8.1.0:
```
sql> CREATE TABLE t1 (id INT PRIMARY KEY, c1 TEXT DEFAULT 'foo');
ERROR: 1101 (42000): BLOB, TEXT, GEOMETRY or JSON column 'c1' can't have a default value
sql> CREATE TABLE t1 (id INT PRIMARY KEY, c1 TEXT DEFAULT ('foo'));
Query OK, 0 rows affected (0.0586 sec)
sql> SHOW CREATE TABLE t1\G
*************************** 1. row ***************************
Table: t1
Create Table: CREATE TABLE `t1` (
`id` int NOT NULL,
`c1` text COLLATE utf8mb4_general_ci DEFAULT (_utf8mb4'foo'),
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci
1 row in set (0.0184 sec)
sql> INSERT INTO t1(id) VALUES(1);
Query OK, 1 row affected (0.0076 sec)
sql> TABLE t1;
+----+-----+
| id | c1 |
+----+-----+
| 1 | foo |
+----+-----+
1 row in set (0.0009 sec)
```
### 3. What did you see instead (Required)
```
sql> CREATE TABLE t1 (id INT PRIMARY KEY, c1 TEXT DEFAULT 'foo');
ERROR: 1101 (42000): BLOB/TEXT/JSON column 'c1' can't have a default value
sql> CREATE TABLE t1 (id INT PRIMARY KEY, c1 TEXT DEFAULT ('foo'));
ERROR: 1064 (42000): 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 59 near ""'foo'))""
...
```
### 4. What is your TiDB version? (Required)
```
Release Version: v7.2.0
Edition: Community
Git Commit Hash: 9fd5f4a8e4f273a60fbe7d3848f85a1be8f0600b
Git Branch: heads/refs/tags/v7.2.0
UTC Build Time: 2023-06-27 15:04:42
GoVersion: go1.20.5
Race Enabled: false
Check Table Before Drop: false
Store: tikv
```",True,"Default value for TEXT, BLOB or JSON columns - ## Bug Report
TiDB doesn't allow a default value for TEXT, BLOB or JSON columns.
### 1. Minimal reproduce step (Required)
```sql
CREATE TABLE t1 (id INT PRIMARY KEY, c1 TEXT DEFAULT 'foo');
CREATE TABLE t1 (id INT PRIMARY KEY, c1 TEXT DEFAULT ('foo'));
SHOW CREATE TABLE t1\G
INSERT INTO t1(id) VALUES(1);
TABLE t1;
```
### 2. What did you expect to see? (Required)
With MySQL 8.1.0:
```
sql> CREATE TABLE t1 (id INT PRIMARY KEY, c1 TEXT DEFAULT 'foo');
ERROR: 1101 (42000): BLOB, TEXT, GEOMETRY or JSON column 'c1' can't have a default value
sql> CREATE TABLE t1 (id INT PRIMARY KEY, c1 TEXT DEFAULT ('foo'));
Query OK, 0 rows affected (0.0586 sec)
sql> SHOW CREATE TABLE t1\G
*************************** 1. row ***************************
Table: t1
Create Table: CREATE TABLE `t1` (
`id` int NOT NULL,
`c1` text COLLATE utf8mb4_general_ci DEFAULT (_utf8mb4'foo'),
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci
1 row in set (0.0184 sec)
sql> INSERT INTO t1(id) VALUES(1);
Query OK, 1 row affected (0.0076 sec)
sql> TABLE t1;
+----+-----+
| id | c1 |
+----+-----+
| 1 | foo |
+----+-----+
1 row in set (0.0009 sec)
```
### 3. What did you see instead (Required)
```
sql> CREATE TABLE t1 (id INT PRIMARY KEY, c1 TEXT DEFAULT 'foo');
ERROR: 1101 (42000): BLOB/TEXT/JSON column 'c1' can't have a default value
sql> CREATE TABLE t1 (id INT PRIMARY KEY, c1 TEXT DEFAULT ('foo'));
ERROR: 1064 (42000): 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 59 near ""'foo'))""
...
```
### 4. What is your TiDB version? (Required)
```
Release Version: v7.2.0
Edition: Community
Git Commit Hash: 9fd5f4a8e4f273a60fbe7d3848f85a1be8f0600b
Git Branch: heads/refs/tags/v7.2.0
UTC Build Time: 2023-06-27 15:04:42
GoVersion: go1.20.5
Race Enabled: false
Check Table Before Drop: false
Store: tikv
```",1,default value for text blob or json columns bug report tidb doesn t allow a default value for text blob or json columns minimal reproduce step required sql create table id int primary key text default foo create table id int primary key text default foo show create table g insert into id values table what did you expect to see required with mysql sql create table id int primary key text default foo error blob text geometry or json column can t have a default value sql create table id int primary key text default foo query ok rows affected sec sql show create table g row table create table create table id int not null text collate general ci default foo primary key id engine innodb default charset collate general ci row in set sec sql insert into id values query ok row affected sec sql table id foo row in set sec what did you see instead required sql create table id int primary key text default foo error blob text json column can t have a default value sql create table id int primary key text default foo error you have an error in your sql syntax check the manual that corresponds to your tidb version for the right syntax to use line column near foo what is your tidb version required release version edition community git commit hash git branch heads refs tags utc build time goversion race enabled false check table before drop false store tikv ,1
3895,6741642683.0,IssuesEvent,2017-10-20 02:18:34,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Field type year should have unsigned flag,compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
drop table if exists t;
create table t (
c_year year
);
insert into t values (
11
);
select * from t;
```
2. What did you expect to see?
```
Field 1: `c_year`
Catalog: `def`
Database: `mysql`
Table: `t`
Org_table: `t`
Type: YEAR
Collation: binary (63)
Length: 4
Max_length: 4
Decimals: 0
Flags: UNSIGNED ZEROFILL NUM
+--------+
| c_year |
+--------+
| 2011 |
+--------+
1 row in set (0.00 sec)
```
3. What did you see instead?
```
Field 1: `c_year`
Catalog: `def`
Database: `test`
Table: `t`
Org_table: `t`
Type: YEAR
Collation: binary (63)
Length: 16
Max_length: 4
Decimals: 0
Flags: BINARY NUM
+--------+
| c_year |
+--------+
| 2011 |
+--------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V`)?
",True,"Field type year should have unsigned flag - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
drop table if exists t;
create table t (
c_year year
);
insert into t values (
11
);
select * from t;
```
2. What did you expect to see?
```
Field 1: `c_year`
Catalog: `def`
Database: `mysql`
Table: `t`
Org_table: `t`
Type: YEAR
Collation: binary (63)
Length: 4
Max_length: 4
Decimals: 0
Flags: UNSIGNED ZEROFILL NUM
+--------+
| c_year |
+--------+
| 2011 |
+--------+
1 row in set (0.00 sec)
```
3. What did you see instead?
```
Field 1: `c_year`
Catalog: `def`
Database: `test`
Table: `t`
Org_table: `t`
Type: YEAR
Collation: binary (63)
Length: 16
Max_length: 4
Decimals: 0
Flags: BINARY NUM
+--------+
| c_year |
+--------+
| 2011 |
+--------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V`)?
",1,field type year should have unsigned flag please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error sql drop table if exists t create table t c year year insert into t values select from t what did you expect to see field c year catalog def database mysql table t org table t type year collation binary length max length decimals flags unsigned zerofill num c year row in set sec what did you see instead field c year catalog def database test table t org table t type year collation binary length max length decimals flags binary num c year row in set sec what version of tidb are you using tidb server v ,1
3260,6217365430.0,IssuesEvent,2017-07-08 14:22:09,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Support the sql_mode of `NO_AUTO_VALUE_ON_ZERO`,compatibility,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```
create table t(a int auto_increment primary key, b int null);
set sql_mode=NO_AUTO_VALUE_ON_ZERO;
insert into t value(0,1);
select * from t;
```
2. What did you expect to see?
```
+---+------+
| a | b |
+---+------+
| 0| 1 |
+---+------+
```
3. What did you see instead?
```
+---+------+
| a | b |
+---+------+
| 1 | 1 |
+---+------+
```
4. What version of TiDB are you using (`tidb-server -V`)?
",True,"Support the sql_mode of `NO_AUTO_VALUE_ON_ZERO` - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
```
create table t(a int auto_increment primary key, b int null);
set sql_mode=NO_AUTO_VALUE_ON_ZERO;
insert into t value(0,1);
select * from t;
```
2. What did you expect to see?
```
+---+------+
| a | b |
+---+------+
| 0| 1 |
+---+------+
```
3. What did you see instead?
```
+---+------+
| a | b |
+---+------+
| 1 | 1 |
+---+------+
```
4. What version of TiDB are you using (`tidb-server -V`)?
",1,support the sql mode of no auto value on zero please answer these questions before submitting your issue thanks what did you do create table t a int auto increment primary key b int null set sql mode no auto value on zero insert into t value select from t what did you expect to see a b what did you see instead a b what version of tidb are you using tidb server v ,1
12229,14442175482.0,IssuesEvent,2020-12-07 17:46:45,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,TiDB is case insensitive to schema/table name while MySQL 5.7/8.0 is case sentive by default,sig/DDL type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
Tested on MySQL 8.0
```
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.16 MySQL Community Server - GPL
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create database T;
Query OK, 1 row affected (0.28 sec)
mysql> create database t;
Query OK, 1 row affected (0.03 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| T |
| information_schema |
| mysql |
| performance_schema |
| sys |
| t |
+--------------------+
6 rows in set (0.01 sec)
```
Tested on MySQL 5.7
```
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.26-0ubuntu0.18.04.1 (Ubuntu)
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create database T;
Query OK, 1 row affected (0.00 sec)
mysql> create database t;
Query OK, 1 row affected (0.00 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| T |
| _gravity |
| ericsyh |
| helloJiu |
| mysql |
| performance_schema |
| sys |
| t |
+--------------------+
9 rows in set (0.00 sec)
```
Tested on TiDB:
```
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.25-TiDB-v3.0.0-rc.1-191-gbb3a92d70 MySQL Community Server (Apache License 2.0)
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create database T;
Query OK, 0 rows affected (0.26 sec)
mysql> create database t;
ERROR 1007 (HY000): Can't create database 't'; database exists
```
2. What did you expect to see?
TiDB should be case sensitive to schema/table name like MySQL by default.
3. What did you see instead?
TiDB should is case sensitive to schema/table name by by default.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
| Release Version: v3.0.0-rc.1-191-gbb3a92d70
Git Commit Hash: bb3a92d70f018bf11fe630f7e0328c6a95b10dd0
Git Branch: master
UTC Build Time: 2019-06-14 07:48:18
GoVersion: go version go1.12 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
```",True,"TiDB is case insensitive to schema/table name while MySQL 5.7/8.0 is case sentive by default - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
Tested on MySQL 8.0
```
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.16 MySQL Community Server - GPL
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create database T;
Query OK, 1 row affected (0.28 sec)
mysql> create database t;
Query OK, 1 row affected (0.03 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| T |
| information_schema |
| mysql |
| performance_schema |
| sys |
| t |
+--------------------+
6 rows in set (0.01 sec)
```
Tested on MySQL 5.7
```
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.26-0ubuntu0.18.04.1 (Ubuntu)
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create database T;
Query OK, 1 row affected (0.00 sec)
mysql> create database t;
Query OK, 1 row affected (0.00 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| T |
| _gravity |
| ericsyh |
| helloJiu |
| mysql |
| performance_schema |
| sys |
| t |
+--------------------+
9 rows in set (0.00 sec)
```
Tested on TiDB:
```
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.25-TiDB-v3.0.0-rc.1-191-gbb3a92d70 MySQL Community Server (Apache License 2.0)
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create database T;
Query OK, 0 rows affected (0.26 sec)
mysql> create database t;
ERROR 1007 (HY000): Can't create database 't'; database exists
```
2. What did you expect to see?
TiDB should be case sensitive to schema/table name like MySQL by default.
3. What did you see instead?
TiDB should is case sensitive to schema/table name by by default.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
| Release Version: v3.0.0-rc.1-191-gbb3a92d70
Git Commit Hash: bb3a92d70f018bf11fe630f7e0328c6a95b10dd0
Git Branch: master
UTC Build Time: 2019-06-14 07:48:18
GoVersion: go version go1.12 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
```",1,tidb is case insensitive to schema table name while mysql is case sentive by default bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error tested on mysql welcome to the mysql monitor commands end with or g your mysql connection id is server version mysql community server gpl copyright c oracle and or its affiliates all rights reserved oracle is a registered trademark of oracle corporation and or its affiliates other names may be trademarks of their respective owners type help or h for help type c to clear the current input statement mysql create database t query ok row affected sec mysql create database t query ok row affected sec mysql show databases database t information schema mysql performance schema sys t rows in set sec tested on mysql welcome to the mysql monitor commands end with or g your mysql connection id is server version ubuntu copyright c oracle and or its affiliates all rights reserved oracle is a registered trademark of oracle corporation and or its affiliates other names may be trademarks of their respective owners type help or h for help type c to clear the current input statement mysql create database t query ok row affected sec mysql create database t query ok row affected sec mysql show databases database information schema t gravity ericsyh hellojiu mysql performance schema sys t rows in set sec tested on tidb welcome to the mysql monitor commands end with or g your mysql connection id is server version tidb rc mysql community server apache license copyright c oracle and or its affiliates all rights reserved oracle is a registered trademark of oracle corporation and or its affiliates other names may be trademarks of their respective owners type help or h for help type c to clear the current input statement mysql create database t query ok rows affected sec mysql create database t error can t create database t database exists what did you expect to see tidb should be case sensitive to schema table name like mysql by default what did you see instead tidb should is case sensitive to schema table name by by default what version of tidb are you using tidb server v or run select tidb version on tidb release version rc git commit hash git branch master utc build time goversion go version linux race enabled false tikv min version alpha check table before drop false ,1
7065,9345171494.0,IssuesEvent,2019-03-30 04:47:47,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,`set time_zone` is not compatible with MySQL,for new contributors help wanted type/bug type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
set time_zone= '-20:00';
set time_zone= '+20:00';
```
2. What did you expect to see?
In Mysql
```
mysql> set time_zone= '-20:00';
ERROR 1298 (HY000): Unknown or incorrect time zone: '-20:00'
mysql> set time_zone= '+20:00';
ERROR 1298 (HY000): Unknown or incorrect time zone: '+20:00'
```
3. What did you see instead?
In TiDB
```
mysql> set time_zone= '-20:00';
Query OK, 0 rows affected (0.01 sec)
mysql> set time_zone= '+20:00';
Query OK, 0 rows affected (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v3.0.0-beta-227-g06183393e-dirty
Git Commit Hash: 06183393ed536aa248248b72d4bf9f5010947f66
Git Branch: master
UTC Build Time: 2019-03-15 08:22:53
GoVersion: go version go1.12 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
```
",True,"`set time_zone` is not compatible with MySQL - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
set time_zone= '-20:00';
set time_zone= '+20:00';
```
2. What did you expect to see?
In Mysql
```
mysql> set time_zone= '-20:00';
ERROR 1298 (HY000): Unknown or incorrect time zone: '-20:00'
mysql> set time_zone= '+20:00';
ERROR 1298 (HY000): Unknown or incorrect time zone: '+20:00'
```
3. What did you see instead?
In TiDB
```
mysql> set time_zone= '-20:00';
Query OK, 0 rows affected (0.01 sec)
mysql> set time_zone= '+20:00';
Query OK, 0 rows affected (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v3.0.0-beta-227-g06183393e-dirty
Git Commit Hash: 06183393ed536aa248248b72d4bf9f5010947f66
Git Branch: master
UTC Build Time: 2019-03-15 08:22:53
GoVersion: go version go1.12 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
```
",1, set time zone is not compatible with mysql bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error set time zone set time zone what did you expect to see in mysql mysql set time zone error unknown or incorrect time zone mysql set time zone error unknown or incorrect time zone what did you see instead in tidb mysql set time zone query ok rows affected sec mysql set time zone query ok rows affected sec what version of tidb are you using tidb server v or run select tidb version on tidb tidb version release version beta dirty git commit hash git branch master utc build time goversion go version darwin race enabled false tikv min version alpha check table before drop false ,1
12378,14633981912.0,IssuesEvent,2020-12-24 03:48:34,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,select .78$123,component/parser status/future type/compatibility type/feature-request,"```sql
select .78$123;
select .78_123;
```
MySQL:
```
mysql> select .78$123;
+------+
| $123 |
+------+
| 0.78 |
+------+
1 row in set (0.00 sec)
```
TiDB:
```
mysql> select .78$123;
ERROR 1105 (HY000): line 0 column 8 near ""78$123"" (total length 14)
```
Notice: fixing this issue need some tricks, since it requires knowledge about the parsing context at the lexer level. Consider the input `.78_123a` (pattern: dot, number, underscore):
In this context (https://github.com/pingcap/tidb/commit/5917a784be944903c12f2ce42d57665dbc608904), lexer should output `dot, identifier(78_123a)`:
```sql
SHOW COLUMNS FROM my_table.78_123a;
```
However in this context, lexer should output `decimal(.78), identifier(_123a)`:
```sql
SELECT .78_123a
```
",True,"select .78$123 - ```sql
select .78$123;
select .78_123;
```
MySQL:
```
mysql> select .78$123;
+------+
| $123 |
+------+
| 0.78 |
+------+
1 row in set (0.00 sec)
```
TiDB:
```
mysql> select .78$123;
ERROR 1105 (HY000): line 0 column 8 near ""78$123"" (total length 14)
```
Notice: fixing this issue need some tricks, since it requires knowledge about the parsing context at the lexer level. Consider the input `.78_123a` (pattern: dot, number, underscore):
In this context (https://github.com/pingcap/tidb/commit/5917a784be944903c12f2ce42d57665dbc608904), lexer should output `dot, identifier(78_123a)`:
```sql
SHOW COLUMNS FROM my_table.78_123a;
```
However in this context, lexer should output `decimal(.78), identifier(_123a)`:
```sql
SELECT .78_123a
```
",1,select sql select select mysql mysql select row in set sec tidb mysql select error line column near total length notice fixing this issue need some tricks since it requires knowledge about the parsing context at the lexer level consider the input pattern dot number underscore in this context lexer should output dot identifier sql show columns from my table however in this context lexer should output decimal identifier sql select ,1
12183,14367004351.0,IssuesEvent,2020-12-01 05:46:37,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,the range of bootstrapVer of different release should not overlapped,severity/critical sig/DDL type/bug type/compatibility,"The range of bootstrapVer of branch release-4.0 and branch master is overlapped for now.
* branch release-4.0
![企业微信截图_49777abf-e693-4914-ade9-0a3122214f10](https://user-images.githubusercontent.com/9039012/100322580-73267c00-2fff-11eb-8307-0c29c5dc187f.png)
* branch master
![企业微信截图_add06a2a-6071-4ca9-b47c-4b22ba2e6af2](https://user-images.githubusercontent.com/9039012/100322589-7588d600-2fff-11eb-8813-ff4446c1ba9f.png)
It'll cause unexpected results when upgrading from V4.0 to V5.0.
The following things need to be done to solve this problem.
- [ ] Define unoverlapped ranges of bootstrapVer numbers for the different release versions.
- [ ] Add version range check for the bootstrapVer.
- [ ] Make sure all the upgrade operations are reentrant.",True,"the range of bootstrapVer of different release should not overlapped - The range of bootstrapVer of branch release-4.0 and branch master is overlapped for now.
* branch release-4.0
![企业微信截图_49777abf-e693-4914-ade9-0a3122214f10](https://user-images.githubusercontent.com/9039012/100322580-73267c00-2fff-11eb-8307-0c29c5dc187f.png)
* branch master
![企业微信截图_add06a2a-6071-4ca9-b47c-4b22ba2e6af2](https://user-images.githubusercontent.com/9039012/100322589-7588d600-2fff-11eb-8813-ff4446c1ba9f.png)
It'll cause unexpected results when upgrading from V4.0 to V5.0.
The following things need to be done to solve this problem.
- [ ] Define unoverlapped ranges of bootstrapVer numbers for the different release versions.
- [ ] Add version range check for the bootstrapVer.
- [ ] Make sure all the upgrade operations are reentrant.",1,the range of bootstrapver of different release should not overlapped the range of bootstrapver of branch release and branch master is overlapped for now branch release branch master it ll cause unexpected results when upgrading from to the following things need to be done to solve this problem define unoverlapped ranges of bootstrapver numbers for the different release versions add version range check for the bootstrapver make sure all the upgrade operations are reentrant ,1
5312,7817596507.0,IssuesEvent,2018-06-13 09:31:14,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,Compatible problem on `asin` with mysql,compatibility for-new-contributors help wanted,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
2. What did you expect to see?
```
mysql> select asin(-0.999999999);
+---------------------+
| asin(-0.999999999) |
+---------------------+
| -1.5707516054359754 |
+---------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
```
mysql> select asin(-0.999999999);
+--------------------+
| asin(-0.999999999) |
+--------------------+
| -1.570751605435964 |
+--------------------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
master branch
commit message: 0ab1b228c0e14f4e62d9de93028183bb1df58125",True,"Compatible problem on `asin` with mysql - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
2. What did you expect to see?
```
mysql> select asin(-0.999999999);
+---------------------+
| asin(-0.999999999) |
+---------------------+
| -1.5707516054359754 |
+---------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
```
mysql> select asin(-0.999999999);
+--------------------+
| asin(-0.999999999) |
+--------------------+
| -1.570751605435964 |
+--------------------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
master branch
commit message: 0ab1b228c0e14f4e62d9de93028183bb1df58125",1,compatible problem on asin with mysql please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error what did you expect to see mysql select asin asin row in set sec what did you see instead mysql select asin asin row in set sec what version of tidb are you using tidb server v or run select tidb version on tidb master branch commit message ,1
11111,13131607739.0,IssuesEvent,2020-08-06 17:19:47,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,error message is not compatible with MySQL,good-first-issue status/help-wanted type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
``` sql
create table t(a int);
select a as b from t group by values(b);
```
2. What did you expect to see?
``` sql
mysql> SELECT a AS b FROM t GROUP BY VALUES(b);
ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'test.t.a' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
```
3. What did you see instead?
Column name is lost.
``` sql
tidb> SELECT a AS b FROM t GROUP BY VALUES(b);
ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column '' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
select tidb_version();
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v2.1.0-rc.3-1-geb617c5f9
Git Commit Hash: eb617c5f9f75c38d75fa848b6732c6071e66ab3e
Git Branch: master
UTC Build Time: 2018-09-30 03:35:34
GoVersion: go version go1.10.3 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
",True,"error message is not compatible with MySQL - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
``` sql
create table t(a int);
select a as b from t group by values(b);
```
2. What did you expect to see?
``` sql
mysql> SELECT a AS b FROM t GROUP BY VALUES(b);
ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'test.t.a' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
```
3. What did you see instead?
Column name is lost.
``` sql
tidb> SELECT a AS b FROM t GROUP BY VALUES(b);
ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column '' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
select tidb_version();
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v2.1.0-rc.3-1-geb617c5f9
Git Commit Hash: eb617c5f9f75c38d75fa848b6732c6071e66ab3e
Git Branch: master
UTC Build Time: 2018-09-30 03:35:34
GoVersion: go version go1.10.3 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
",1,error message is not compatible with mysql bug report please answer these questions before submitting your issue thanks what did you do sql create table t a int select a as b from t group by values b what did you expect to see sql mysql select a as b from t group by values b error expression of select list is not in group by clause and contains nonaggregated column test t a which is not functionally dependent on columns in group by clause this is incompatible with sql mode only full group by what did you see instead column name is lost sql tidb select a as b from t group by values b error expression of select list is not in group by clause and contains nonaggregated column which is not functionally dependent on columns in group by clause this is incompatible with sql mode only full group by what version of tidb are you using tidb server v or run select tidb version on tidb select tidb version tidb version release version rc git commit hash git branch master utc build time goversion go version darwin race enabled false tikv min version alpha check table before drop false row in set sec ,1
7145,9430605819.0,IssuesEvent,2019-04-12 09:25:49,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,json_key is not same with MySQL,type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
select json_keys(NULL);
select json_keys(NULL, '$.b');
select json_keys(NULL, NULL);
select json_keys('{""a"": 1, ""b"": {""e"": ""foo"", ""b"": 3}}', '$.a');
select json_keys('{""a"": 1, ""b"": {""e"": ""foo"", ""b"": 3}}', NULL);
```
2. What did you expect to see?
## In MySQL
```SQL
mysql> select version();
+-------------------------+
| version() |
+-------------------------+
| 5.7.25-0ubuntu0.18.04.2 |
+-------------------------+
1 row in set (0.00 sec)
mysql> select json_keys(NULL);
+-----------------+
| json_keys(NULL) |
+-----------------+
| NULL |
+-----------------+
1 row in set (0.00 sec)
mysql> select json_keys(NULL, '$.b');
+------------------------+
| json_keys(NULL, '$.b') |
+------------------------+
| NULL |
+------------------------+
1 row in set (0.00 sec)
mysql> select json_keys(NULL, NULL);
+-----------------------+
| json_keys(NULL, NULL) |
+-----------------------+
| NULL |
+-----------------------+
1 row in set (0.00 sec)
mysql> select json_keys('{""a"": 1, ""b"": {""e"": ""foo"", ""b"": 3}}', '$.a');
+---------------------------------------------------------+
| json_keys('{""a"": 1, ""b"": {""e"": ""foo"", ""b"": 3}}', '$.a') |
+---------------------------------------------------------+
| NULL |
+---------------------------------------------------------+
1 row in set (0.00 sec)
mysql> select json_keys('{""a"": 1, ""b"": {""e"": ""foo"", ""b"": 3}}', NULL);
+--------------------------------------------------------+
| json_keys('{""a"": 1, ""b"": {""e"": ""foo"", ""b"": 3}}', NULL) |
+--------------------------------------------------------+
| NULL |
+--------------------------------------------------------+
1 row in set (0.00 sec)
mysql>
```
3. What did you see instead?
## In TiDB
```SQL
mysql> select json_keys(NULL);
+-----------------+
| json_keys(NULL) |
+-----------------+
| NULL |
+-----------------+
1 row in set (0.00 sec)
mysql> select json_keys(NULL, '$.b');
+------------------------+
| json_keys(NULL, '$.b') |
+------------------------+
| NULL |
+------------------------+
1 row in set (0.00 sec)
mysql> select json_keys(NULL, NULL);
+-----------------------+
| json_keys(NULL, NULL) |
+-----------------------+
| NULL |
+-----------------------+
1 row in set (0.00 sec)
mysql> select json_keys('{""a"": 1, ""b"": {""e"": ""foo"", ""b"": 3}}', '$.a');
ERROR 3146 (22032): Invalid data type for JSON data
mysql> select json_keys('{""a"": 1, ""b"": {""e"": ""foo"", ""b"": 3}}', NULL);
+--------------------------------------------------------+
| json_keys('{""a"": 1, ""b"": {""e"": ""foo"", ""b"": 3}}', NULL) |
+--------------------------------------------------------+
| NULL |
+--------------------------------------------------------+
1 row in set (0.01 sec)
mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v3.0.0-beta-321-gc6a757b24
Git Commit Hash: c6a757b2435965a72ada9d61ea8b7a367bd89b5f
Git Branch: master
UTC Build Time: 2019-04-02 02:38:04
GoVersion: go version go1.12.1 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
1 row in set (0.00 sec)
mysql>
```",True,"json_key is not same with MySQL - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```sql
select json_keys(NULL);
select json_keys(NULL, '$.b');
select json_keys(NULL, NULL);
select json_keys('{""a"": 1, ""b"": {""e"": ""foo"", ""b"": 3}}', '$.a');
select json_keys('{""a"": 1, ""b"": {""e"": ""foo"", ""b"": 3}}', NULL);
```
2. What did you expect to see?
## In MySQL
```SQL
mysql> select version();
+-------------------------+
| version() |
+-------------------------+
| 5.7.25-0ubuntu0.18.04.2 |
+-------------------------+
1 row in set (0.00 sec)
mysql> select json_keys(NULL);
+-----------------+
| json_keys(NULL) |
+-----------------+
| NULL |
+-----------------+
1 row in set (0.00 sec)
mysql> select json_keys(NULL, '$.b');
+------------------------+
| json_keys(NULL, '$.b') |
+------------------------+
| NULL |
+------------------------+
1 row in set (0.00 sec)
mysql> select json_keys(NULL, NULL);
+-----------------------+
| json_keys(NULL, NULL) |
+-----------------------+
| NULL |
+-----------------------+
1 row in set (0.00 sec)
mysql> select json_keys('{""a"": 1, ""b"": {""e"": ""foo"", ""b"": 3}}', '$.a');
+---------------------------------------------------------+
| json_keys('{""a"": 1, ""b"": {""e"": ""foo"", ""b"": 3}}', '$.a') |
+---------------------------------------------------------+
| NULL |
+---------------------------------------------------------+
1 row in set (0.00 sec)
mysql> select json_keys('{""a"": 1, ""b"": {""e"": ""foo"", ""b"": 3}}', NULL);
+--------------------------------------------------------+
| json_keys('{""a"": 1, ""b"": {""e"": ""foo"", ""b"": 3}}', NULL) |
+--------------------------------------------------------+
| NULL |
+--------------------------------------------------------+
1 row in set (0.00 sec)
mysql>
```
3. What did you see instead?
## In TiDB
```SQL
mysql> select json_keys(NULL);
+-----------------+
| json_keys(NULL) |
+-----------------+
| NULL |
+-----------------+
1 row in set (0.00 sec)
mysql> select json_keys(NULL, '$.b');
+------------------------+
| json_keys(NULL, '$.b') |
+------------------------+
| NULL |
+------------------------+
1 row in set (0.00 sec)
mysql> select json_keys(NULL, NULL);
+-----------------------+
| json_keys(NULL, NULL) |
+-----------------------+
| NULL |
+-----------------------+
1 row in set (0.00 sec)
mysql> select json_keys('{""a"": 1, ""b"": {""e"": ""foo"", ""b"": 3}}', '$.a');
ERROR 3146 (22032): Invalid data type for JSON data
mysql> select json_keys('{""a"": 1, ""b"": {""e"": ""foo"", ""b"": 3}}', NULL);
+--------------------------------------------------------+
| json_keys('{""a"": 1, ""b"": {""e"": ""foo"", ""b"": 3}}', NULL) |
+--------------------------------------------------------+
| NULL |
+--------------------------------------------------------+
1 row in set (0.01 sec)
mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v3.0.0-beta-321-gc6a757b24
Git Commit Hash: c6a757b2435965a72ada9d61ea8b7a367bd89b5f
Git Branch: master
UTC Build Time: 2019-04-02 02:38:04
GoVersion: go version go1.12.1 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
1 row in set (0.00 sec)
mysql>
```",1,json key is not same with mysql bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error sql select json keys null select json keys null b select json keys null null select json keys a b e foo b a select json keys a b e foo b null what did you expect to see in mysql sql mysql select version version row in set sec mysql select json keys null json keys null null row in set sec mysql select json keys null b json keys null b null row in set sec mysql select json keys null null json keys null null null row in set sec mysql select json keys a b e foo b a json keys a b e foo b a null row in set sec mysql select json keys a b e foo b null json keys a b e foo b null null row in set sec mysql what did you see instead in tidb sql mysql select json keys null json keys null null row in set sec mysql select json keys null b json keys null b null row in set sec mysql select json keys null null json keys null null null row in set sec mysql select json keys a b e foo b a error invalid data type for json data mysql select json keys a b e foo b null json keys a b e foo b null null row in set sec mysql select tidb version g row tidb version release version beta git commit hash git branch master utc build time goversion go version linux race enabled false tikv min version alpha check table before drop false row in set sec mysql ,1
282717,24493107455.0,IssuesEvent,2022-10-10 05:41:51,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,unstable test TestDDLScheduling,type/bug component/test sig/sql-infra severity/major,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```
job_table_test.go:166:
Error Trace: /home/jenkins/.tidb/tmp/63a9840cd0739f2c243bb46478607469/sandbox/processwrapper-sandbox/5842/execroot/__main__/bazel-out/k8-fastbuild/bin/ddl/ddl_test_/ddl_test.runfiles/__main__/ddl/job_table_test.go:166
/home/jenkins/.tidb/tmp/63a9840cd0739f2c243bb46478607469/sandbox/processwrapper-sandbox/5842/execroot/__main__/bazel-out/k8-fastbuild/bin/ddl/ddl_test_/ddl_test.runfiles/__main__/ddl/job_table_test.go:175
/home/jenkins/.tidb/tmp/63a9840cd0739f2c243bb46478607469/sandbox/processwrapper-sandbox/5842/execroot/__main__/bazel-out/k8-fastbuild/bin/ddl/ddl_test_/ddl_test.runfiles/__main__/ddl/job_table_test.go:131
Error: Should be false
Test: TestDDLScheduling
```
https://do.pingcap.net/jenkins/blue/rest/organizations/jenkins/pipelines/pingcap/pipelines/tidb/pipelines/ghpr_unit_test/runs/1505/nodes/49/steps/52/log/?start=0
### 2. What did you expect to see? (Required)
### 3. What did you see instead (Required)
### 4. What is your TiDB version? (Required)
",1.0,"unstable test TestDDLScheduling - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
### 1. Minimal reproduce step (Required)
```
job_table_test.go:166:
Error Trace: /home/jenkins/.tidb/tmp/63a9840cd0739f2c243bb46478607469/sandbox/processwrapper-sandbox/5842/execroot/__main__/bazel-out/k8-fastbuild/bin/ddl/ddl_test_/ddl_test.runfiles/__main__/ddl/job_table_test.go:166
/home/jenkins/.tidb/tmp/63a9840cd0739f2c243bb46478607469/sandbox/processwrapper-sandbox/5842/execroot/__main__/bazel-out/k8-fastbuild/bin/ddl/ddl_test_/ddl_test.runfiles/__main__/ddl/job_table_test.go:175
/home/jenkins/.tidb/tmp/63a9840cd0739f2c243bb46478607469/sandbox/processwrapper-sandbox/5842/execroot/__main__/bazel-out/k8-fastbuild/bin/ddl/ddl_test_/ddl_test.runfiles/__main__/ddl/job_table_test.go:131
Error: Should be false
Test: TestDDLScheduling
```
https://do.pingcap.net/jenkins/blue/rest/organizations/jenkins/pipelines/pingcap/pipelines/tidb/pipelines/ghpr_unit_test/runs/1505/nodes/49/steps/52/log/?start=0
### 2. What did you expect to see? (Required)
### 3. What did you see instead (Required)
### 4. What is your TiDB version? (Required)
",0,unstable test testddlscheduling bug report please answer these questions before submitting your issue thanks minimal reproduce step required job table test go error trace home jenkins tidb tmp sandbox processwrapper sandbox execroot main bazel out fastbuild bin ddl ddl test ddl test runfiles main ddl job table test go home jenkins tidb tmp sandbox processwrapper sandbox execroot main bazel out fastbuild bin ddl ddl test ddl test runfiles main ddl job table test go home jenkins tidb tmp sandbox processwrapper sandbox execroot main bazel out fastbuild bin ddl ddl test ddl test runfiles main ddl job table test go error should be false test testddlscheduling what did you expect to see required what did you see instead required what is your tidb version required ,0
6247,8641062532.0,IssuesEvent,2018-11-24 13:49:57,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Incorrect CEIL/FLOOR infer type,type/compatibility,"```mysql
create table t (
c_int int,
c_int_unsigned int unsigned,
c_bigint bigint,
c_bigint_unsigned bigint unsigned,
c_float float,
c_float_unsigned float unsigned,
c_double double,
c_double_unsigned double unsigned,
c_decimal decimal(6, 3),
c_decimal_unsigned decimal(10, 3) unsigned,
c_datetime datetime(2),
c_time time,
c_timestamp timestamp,
c_char char(20),
c_char_binary char(20) binary,
c_varchar varchar(20),
c_varchar_binary varchar(20) binary,
c_binary binary(20),
c_varbinary varbinary(20),
c_text text,
c_blob blob,
c_text_binary text binary,
c_set set('a', 'b', 'c'),
c_enum enum('a', 'b', 'c'));
SELECT FLOOR(c_int), FLOOR(c_int_unsigned), FLOOR(c_bigint), FLOOR(c_bigint_unsigned), FLOOR(c_float), FLOOR(c_float_unsigned), FLOOR(c_double), FLOOR(c_double_unsigned), FLOOR(c_decimal), FLOOR(c_decimal_unsigned), FLOOR(c_datetime), FLOOR(c_time), FLOOR(c_timestamp), FLOOR(c_char), FLOOR(c_char_binary), FLOOR(c_varchar), FLOOR(c_varchar_binary), FLOOR(c_binary), FLOOR(c_varbinary), FLOOR(c_text), FLOOR(c_blob), FLOOR(c_text_binary), FLOOR(c_set), FLOOR(c_enum) FROM t;
```
```diff
--- diff-mysql.txt 2017-08-10 16:26:03.000000000 +0800
+++ diff-tidb.txt 2017-08-10 16:26:38.000000000 +0800
@@ -1,290 +1,290 @@
Field 1: `FLOOR(c_int)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: LONGLONG
Collation: binary (63)
-Length: 13
+Length: 11
Max_length: 0
Decimals: 0
Flags: BINARY NUM
Field 2: `FLOOR(c_int_unsigned)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
-Type: LONGLONG
+Type: NEWDECIMAL
Collation: binary (63)
-Length: 12
+Length: 11
Max_length: 0
Decimals: 0
-Flags: UNSIGNED BINARY NUM
+Flags: BINARY NUM
Field 3: `FLOOR(c_bigint)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
-Type: NEWDECIMAL
+Type: LONGLONG
Collation: binary (63)
-Length: 17
+Length: 21
Max_length: 0
Decimals: 0
Flags: BINARY NUM
Field 4: `FLOOR(c_bigint_unsigned)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: NEWDECIMAL
Collation: binary (63)
-Length: 17
+Length: 21
Max_length: 0
Decimals: 0
Flags: BINARY NUM
Field 5: `FLOOR(c_float)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
-Length: 17
+Length: 0
Max_length: 0
Decimals: 0
Flags: BINARY NUM
Field 6: `FLOOR(c_float_unsigned)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
-Length: 17
+Length: 0
Max_length: 0
Decimals: 0
Flags: BINARY NUM
Field 7: `FLOOR(c_double)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
-Length: 17
+Length: 0
Max_length: 0
Decimals: 0
Flags: BINARY NUM
Field 8: `FLOOR(c_double_unsigned)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
-Length: 17
+Length: 0
Max_length: 0
Decimals: 0
Flags: BINARY NUM
Field 9: `FLOOR(c_decimal)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: LONGLONG
Collation: binary (63)
Length: 6
Max_length: 0
Decimals: 0
Flags: BINARY NUM
Field 10: `FLOOR(c_decimal_unsigned)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: LONGLONG
Collation: binary (63)
-Length: 9
+Length: 10
Max_length: 0
Decimals: 0
-Flags: UNSIGNED BINARY NUM
+Flags: BINARY NUM
Field 11: `FLOOR(c_datetime)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
-Length: 17
+Length: 23
Max_length: 0
Decimals: 0
Flags: BINARY NUM
Field 12: `FLOOR(c_time)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
-Length: 17
+Length: 23
Max_length: 0
Decimals: 0
Flags: BINARY NUM
Field 13: `FLOOR(c_timestamp)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
-Length: 17
+Length: 23
Max_length: 0
Decimals: 0
-Flags: NOT_NULL BINARY NUM
+Flags: BINARY NUM
Field 14: `FLOOR(c_char)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
-Length: 17
+Length: 23
Max_length: 0
Decimals: 0
Flags: BINARY NUM
Field 15: `FLOOR(c_char_binary)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
-Length: 17
+Length: 23
Max_length: 0
Decimals: 0
Flags: BINARY NUM
Field 16: `FLOOR(c_varchar)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
-Length: 17
+Length: 23
Max_length: 0
Decimals: 0
Flags: BINARY NUM
Field 17: `FLOOR(c_varchar_binary)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
-Length: 17
+Length: 23
Max_length: 0
Decimals: 0
Flags: BINARY NUM
Field 18: `FLOOR(c_binary)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
-Length: 17
+Length: 23
Max_length: 0
Decimals: 0
Flags: BINARY NUM
Field 19: `FLOOR(c_varbinary)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
-Length: 17
+Length: 23
Max_length: 0
Decimals: 0
Flags: BINARY NUM
Field 20: `FLOOR(c_text)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
-Length: 17
+Length: 23
Max_length: 0
Decimals: 0
Flags: BINARY NUM
Field 21: `FLOOR(c_blob)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
-Length: 17
+Length: 23
Max_length: 0
Decimals: 0
Flags: BINARY NUM
Field 22: `FLOOR(c_text_binary)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
-Length: 17
+Length: 23
Max_length: 0
Decimals: 0
Flags: BINARY NUM
Field 23: `FLOOR(c_set)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
-Length: 17
+Length: 23
Max_length: 0
Decimals: 0
Flags: BINARY NUM
Field 24: `FLOOR(c_enum)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
-Length: 17
+Length: 23
Max_length: 0
Decimals: 0
Flags: BINARY NUM
0 rows in set (0.00 sec)
```",True,"Incorrect CEIL/FLOOR infer type - ```mysql
create table t (
c_int int,
c_int_unsigned int unsigned,
c_bigint bigint,
c_bigint_unsigned bigint unsigned,
c_float float,
c_float_unsigned float unsigned,
c_double double,
c_double_unsigned double unsigned,
c_decimal decimal(6, 3),
c_decimal_unsigned decimal(10, 3) unsigned,
c_datetime datetime(2),
c_time time,
c_timestamp timestamp,
c_char char(20),
c_char_binary char(20) binary,
c_varchar varchar(20),
c_varchar_binary varchar(20) binary,
c_binary binary(20),
c_varbinary varbinary(20),
c_text text,
c_blob blob,
c_text_binary text binary,
c_set set('a', 'b', 'c'),
c_enum enum('a', 'b', 'c'));
SELECT FLOOR(c_int), FLOOR(c_int_unsigned), FLOOR(c_bigint), FLOOR(c_bigint_unsigned), FLOOR(c_float), FLOOR(c_float_unsigned), FLOOR(c_double), FLOOR(c_double_unsigned), FLOOR(c_decimal), FLOOR(c_decimal_unsigned), FLOOR(c_datetime), FLOOR(c_time), FLOOR(c_timestamp), FLOOR(c_char), FLOOR(c_char_binary), FLOOR(c_varchar), FLOOR(c_varchar_binary), FLOOR(c_binary), FLOOR(c_varbinary), FLOOR(c_text), FLOOR(c_blob), FLOOR(c_text_binary), FLOOR(c_set), FLOOR(c_enum) FROM t;
```
```diff
--- diff-mysql.txt 2017-08-10 16:26:03.000000000 +0800
+++ diff-tidb.txt 2017-08-10 16:26:38.000000000 +0800
@@ -1,290 +1,290 @@
Field 1: `FLOOR(c_int)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: LONGLONG
Collation: binary (63)
-Length: 13
+Length: 11
Max_length: 0
Decimals: 0
Flags: BINARY NUM
Field 2: `FLOOR(c_int_unsigned)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
-Type: LONGLONG
+Type: NEWDECIMAL
Collation: binary (63)
-Length: 12
+Length: 11
Max_length: 0
Decimals: 0
-Flags: UNSIGNED BINARY NUM
+Flags: BINARY NUM
Field 3: `FLOOR(c_bigint)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
-Type: NEWDECIMAL
+Type: LONGLONG
Collation: binary (63)
-Length: 17
+Length: 21
Max_length: 0
Decimals: 0
Flags: BINARY NUM
Field 4: `FLOOR(c_bigint_unsigned)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: NEWDECIMAL
Collation: binary (63)
-Length: 17
+Length: 21
Max_length: 0
Decimals: 0
Flags: BINARY NUM
Field 5: `FLOOR(c_float)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
-Length: 17
+Length: 0
Max_length: 0
Decimals: 0
Flags: BINARY NUM
Field 6: `FLOOR(c_float_unsigned)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
-Length: 17
+Length: 0
Max_length: 0
Decimals: 0
Flags: BINARY NUM
Field 7: `FLOOR(c_double)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
-Length: 17
+Length: 0
Max_length: 0
Decimals: 0
Flags: BINARY NUM
Field 8: `FLOOR(c_double_unsigned)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
-Length: 17
+Length: 0
Max_length: 0
Decimals: 0
Flags: BINARY NUM
Field 9: `FLOOR(c_decimal)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: LONGLONG
Collation: binary (63)
Length: 6
Max_length: 0
Decimals: 0
Flags: BINARY NUM
Field 10: `FLOOR(c_decimal_unsigned)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: LONGLONG
Collation: binary (63)
-Length: 9
+Length: 10
Max_length: 0
Decimals: 0
-Flags: UNSIGNED BINARY NUM
+Flags: BINARY NUM
Field 11: `FLOOR(c_datetime)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
-Length: 17
+Length: 23
Max_length: 0
Decimals: 0
Flags: BINARY NUM
Field 12: `FLOOR(c_time)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
-Length: 17
+Length: 23
Max_length: 0
Decimals: 0
Flags: BINARY NUM
Field 13: `FLOOR(c_timestamp)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
-Length: 17
+Length: 23
Max_length: 0
Decimals: 0
-Flags: NOT_NULL BINARY NUM
+Flags: BINARY NUM
Field 14: `FLOOR(c_char)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
-Length: 17
+Length: 23
Max_length: 0
Decimals: 0
Flags: BINARY NUM
Field 15: `FLOOR(c_char_binary)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
-Length: 17
+Length: 23
Max_length: 0
Decimals: 0
Flags: BINARY NUM
Field 16: `FLOOR(c_varchar)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
-Length: 17
+Length: 23
Max_length: 0
Decimals: 0
Flags: BINARY NUM
Field 17: `FLOOR(c_varchar_binary)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
-Length: 17
+Length: 23
Max_length: 0
Decimals: 0
Flags: BINARY NUM
Field 18: `FLOOR(c_binary)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
-Length: 17
+Length: 23
Max_length: 0
Decimals: 0
Flags: BINARY NUM
Field 19: `FLOOR(c_varbinary)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
-Length: 17
+Length: 23
Max_length: 0
Decimals: 0
Flags: BINARY NUM
Field 20: `FLOOR(c_text)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
-Length: 17
+Length: 23
Max_length: 0
Decimals: 0
Flags: BINARY NUM
Field 21: `FLOOR(c_blob)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
-Length: 17
+Length: 23
Max_length: 0
Decimals: 0
Flags: BINARY NUM
Field 22: `FLOOR(c_text_binary)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
-Length: 17
+Length: 23
Max_length: 0
Decimals: 0
Flags: BINARY NUM
Field 23: `FLOOR(c_set)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
-Length: 17
+Length: 23
Max_length: 0
Decimals: 0
Flags: BINARY NUM
Field 24: `FLOOR(c_enum)`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: DOUBLE
Collation: binary (63)
-Length: 17
+Length: 23
Max_length: 0
Decimals: 0
Flags: BINARY NUM
0 rows in set (0.00 sec)
```",1,incorrect ceil floor infer type mysql create table t c int int c int unsigned int unsigned c bigint bigint c bigint unsigned bigint unsigned c float float c float unsigned float unsigned c double double c double unsigned double unsigned c decimal decimal c decimal unsigned decimal unsigned c datetime datetime c time time c timestamp timestamp c char char c char binary char binary c varchar varchar c varchar binary varchar binary c binary binary c varbinary varbinary c text text c blob blob c text binary text binary c set set a b c c enum enum a b c select floor c int floor c int unsigned floor c bigint floor c bigint unsigned floor c float floor c float unsigned floor c double floor c double unsigned floor c decimal floor c decimal unsigned floor c datetime floor c time floor c timestamp floor c char floor c char binary floor c varchar floor c varchar binary floor c binary floor c varbinary floor c text floor c blob floor c text binary floor c set floor c enum from t diff diff mysql txt diff tidb txt field floor c int catalog def database table org table type longlong collation binary length length max length decimals flags binary num field floor c int unsigned catalog def database table org table type longlong type newdecimal collation binary length length max length decimals flags unsigned binary num flags binary num field floor c bigint catalog def database table org table type newdecimal type longlong collation binary length length max length decimals flags binary num field floor c bigint unsigned catalog def database table org table type newdecimal collation binary length length max length decimals flags binary num field floor c float catalog def database table org table type double collation binary length length max length decimals flags binary num field floor c float unsigned catalog def database table org table type double collation binary length length max length decimals flags binary num field floor c double catalog def database table org table type double collation binary length length max length decimals flags binary num field floor c double unsigned catalog def database table org table type double collation binary length length max length decimals flags binary num field floor c decimal catalog def database table org table type longlong collation binary length max length decimals flags binary num field floor c decimal unsigned catalog def database table org table type longlong collation binary length length max length decimals flags unsigned binary num flags binary num field floor c datetime catalog def database table org table type double collation binary length length max length decimals flags binary num field floor c time catalog def database table org table type double collation binary length length max length decimals flags binary num field floor c timestamp catalog def database table org table type double collation binary length length max length decimals flags not null binary num flags binary num field floor c char catalog def database table org table type double collation binary length length max length decimals flags binary num field floor c char binary catalog def database table org table type double collation binary length length max length decimals flags binary num field floor c varchar catalog def database table org table type double collation binary length length max length decimals flags binary num field floor c varchar binary catalog def database table org table type double collation binary length length max length decimals flags binary num field floor c binary catalog def database table org table type double collation binary length length max length decimals flags binary num field floor c varbinary catalog def database table org table type double collation binary length length max length decimals flags binary num field floor c text catalog def database table org table type double collation binary length length max length decimals flags binary num field floor c blob catalog def database table org table type double collation binary length length max length decimals flags binary num field floor c text binary catalog def database table org table type double collation binary length length max length decimals flags binary num field floor c set catalog def database table org table type double collation binary length length max length decimals flags binary num field floor c enum catalog def database table org table type double collation binary length length max length decimals flags binary num rows in set sec ,1
7181,9473698991.0,IssuesEvent,2019-04-19 03:23:17,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,not support show open table ,help wanted type/compatibility,"## Bug Report
1. What did you do?
If possible, provide a recipe for reproducing the error.
I use heidisql, and meet error caused by unsupported `show open tables` command.
2. What did you expect to see?
no error
3. What did you see instead?
```
ERROR 1064 (42000): 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 9 near ""OPEN TABLES""
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
",True,"not support show open table - ## Bug Report
1. What did you do?
If possible, provide a recipe for reproducing the error.
I use heidisql, and meet error caused by unsupported `show open tables` command.
2. What did you expect to see?
no error
3. What did you see instead?
```
ERROR 1064 (42000): 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 9 near ""OPEN TABLES""
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
",1,not support show open table bug report what did you do if possible provide a recipe for reproducing the error i use heidisql and meet error caused by unsupported show open tables command what did you expect to see no error what did you see instead error you have an error in your sql syntax check the manual that corresponds to your tidb version for the right syntax to use line column near open tables what version of tidb are you using tidb server v or run select tidb version on tidb ,1
6614,8881908724.0,IssuesEvent,2019-01-14 11:34:23,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,sql_mode ALLOW_INVALID_DATES is not supported,type/compatibility,"## Feature Request
**Is your feature request related to a problem? Please describe:**
Relates to #2738 - currently `ALLOW_INVALID_DATES` is not supported. It is not commonly used, but could be useful for compatibility.
**Describe the feature you'd like:**
```
# testcase
CREATE TABLE d1 (d DATE);
SET sql_mode='STRICT_TRANS_TABLES,ALLOW_INVALID_DATES';
INSERT INTO d1 VALUES ('2010-00-01');
```
Passes in MySQL, produces this in TiDB:
```
MySQL [test]> SET sql_mode='STRICT_TRANS_TABLES,ALLOW_INVALID_DATES';
ERROR 1105 (HY000): ERROR 1231 (42000): Variable 'sql_mode' can't be set to the value of 'ALLOW_INVALID_DATES'
MySQL [test]> INSERT INTO d1 VALUES ('2010-00-01');
ERROR 1292 (22007): Incorrect datetime value: '2010-00-01'
```
**Describe alternatives you've considered:**
Possible to document as unsupported.
**Teachability, Documentation, Adoption, Migration Strategy:**
Improves compatibility with MySQL.",True,"sql_mode ALLOW_INVALID_DATES is not supported - ## Feature Request
**Is your feature request related to a problem? Please describe:**
Relates to #2738 - currently `ALLOW_INVALID_DATES` is not supported. It is not commonly used, but could be useful for compatibility.
**Describe the feature you'd like:**
```
# testcase
CREATE TABLE d1 (d DATE);
SET sql_mode='STRICT_TRANS_TABLES,ALLOW_INVALID_DATES';
INSERT INTO d1 VALUES ('2010-00-01');
```
Passes in MySQL, produces this in TiDB:
```
MySQL [test]> SET sql_mode='STRICT_TRANS_TABLES,ALLOW_INVALID_DATES';
ERROR 1105 (HY000): ERROR 1231 (42000): Variable 'sql_mode' can't be set to the value of 'ALLOW_INVALID_DATES'
MySQL [test]> INSERT INTO d1 VALUES ('2010-00-01');
ERROR 1292 (22007): Incorrect datetime value: '2010-00-01'
```
**Describe alternatives you've considered:**
Possible to document as unsupported.
**Teachability, Documentation, Adoption, Migration Strategy:**
Improves compatibility with MySQL.",1,sql mode allow invalid dates is not supported feature request is your feature request related to a problem please describe relates to currently allow invalid dates is not supported it is not commonly used but could be useful for compatibility describe the feature you d like testcase create table d date set sql mode strict trans tables allow invalid dates insert into values passes in mysql produces this in tidb mysql set sql mode strict trans tables allow invalid dates error error variable sql mode can t be set to the value of allow invalid dates mysql insert into values error incorrect datetime value describe alternatives you ve considered possible to document as unsupported teachability documentation adoption migration strategy improves compatibility with mysql ,1
6843,9160125824.0,IssuesEvent,2019-03-01 06:03:57,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,incompatible behavior for aggregation in subquery with MySQL,component/planner type/bug type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
In TiDB:
```
mysql> create table tbl(a int, b int);
Query OK, 0 rows affected (0.01 sec)
mysql> select t1.a, t1.b, (select max(t2.b) from tbl t2 where t2.a in (select t3.b from tbl t3 where t3.a = t1.a)) as agg_col
-> from tbl t1 WHERE t1.b = 2;
ERROR 1140 (42000): In aggregated query without GROUP BY, expression #1 of SELECT list contains nonaggregated column 'a'; this is incompatible with sql_mode=only_full_group_by
mysql> select @@sql_mode;
+-------------------------------------------------------------------------------------------------------------------------------------------+
| @@sql_mode |
+-------------------------------------------------------------------------------------------------------------------------------------------+
| ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
+-------------------------------------------------------------------------------------------------------------------------------------------+
```
2. What did you expect to see?
In MySQL:
```
mysql> select t1.a, t1.b, (select max(t2.b) from tbl t2 where t2.a in (select t3.b from tbl t3 where t3.a = t1.a)) as agg_col
-> from tbl t1 WHERE t1.b = 2;
Empty set (0.00 sec)
mysql> select @@sql_mode;
+-------------------------------------------------------------------------------------------------------------------------------------------+
| @@sql_mode |
+-------------------------------------------------------------------------------------------------------------------------------------------+
| ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
+-------------------------------------------------------------------------------------------------------------------------------------------+
```
3. What did you see instead?
TiDB has inconsistent behavior with MySQL.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
Release Version: v2.1.4-43-g103d3b3ef-dirty
Git Commit Hash: 103d3b3ef59c4f91c510f7a2e4bb649f323cd2d0
Git Branch: show_stats_pick_21
UTC Build Time: 2019-02-28 05:55:20
GoVersion: go version go1.11.1 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
```
",True,"incompatible behavior for aggregation in subquery with MySQL - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
In TiDB:
```
mysql> create table tbl(a int, b int);
Query OK, 0 rows affected (0.01 sec)
mysql> select t1.a, t1.b, (select max(t2.b) from tbl t2 where t2.a in (select t3.b from tbl t3 where t3.a = t1.a)) as agg_col
-> from tbl t1 WHERE t1.b = 2;
ERROR 1140 (42000): In aggregated query without GROUP BY, expression #1 of SELECT list contains nonaggregated column 'a'; this is incompatible with sql_mode=only_full_group_by
mysql> select @@sql_mode;
+-------------------------------------------------------------------------------------------------------------------------------------------+
| @@sql_mode |
+-------------------------------------------------------------------------------------------------------------------------------------------+
| ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
+-------------------------------------------------------------------------------------------------------------------------------------------+
```
2. What did you expect to see?
In MySQL:
```
mysql> select t1.a, t1.b, (select max(t2.b) from tbl t2 where t2.a in (select t3.b from tbl t3 where t3.a = t1.a)) as agg_col
-> from tbl t1 WHERE t1.b = 2;
Empty set (0.00 sec)
mysql> select @@sql_mode;
+-------------------------------------------------------------------------------------------------------------------------------------------+
| @@sql_mode |
+-------------------------------------------------------------------------------------------------------------------------------------------+
| ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
+-------------------------------------------------------------------------------------------------------------------------------------------+
```
3. What did you see instead?
TiDB has inconsistent behavior with MySQL.
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
Release Version: v2.1.4-43-g103d3b3ef-dirty
Git Commit Hash: 103d3b3ef59c4f91c510f7a2e4bb649f323cd2d0
Git Branch: show_stats_pick_21
UTC Build Time: 2019-02-28 05:55:20
GoVersion: go version go1.11.1 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
```
",1,incompatible behavior for aggregation in subquery with mysql bug report please answer these questions before submitting your issue thanks what did you do in tidb mysql create table tbl a int b int query ok rows affected sec mysql select a b select max b from tbl where a in select b from tbl where a a as agg col from tbl where b error in aggregated query without group by expression of select list contains nonaggregated column a this is incompatible with sql mode only full group by mysql select sql mode sql mode only full group by strict trans tables no zero in date no zero date error for division by zero no auto create user no engine substitution what did you expect to see in mysql mysql select a b select max b from tbl where a in select b from tbl where a a as agg col from tbl where b empty set sec mysql select sql mode sql mode only full group by strict trans tables no zero in date no zero date error for division by zero no auto create user no engine substitution what did you see instead tidb has inconsistent behavior with mysql what version of tidb are you using tidb server v or run select tidb version on tidb release version dirty git commit hash git branch show stats pick utc build time goversion go version darwin race enabled false tikv min version alpha check table before drop false ,1
12091,14259738896.0,IssuesEvent,2020-11-20 08:46:58,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Incompatible issues about date and time functions,severity/major sig/execution status/help-wanted type/bug type/compatibility,"## Historical
- [x] #9666 @qw4990 #9693 cherry-picked
- [x] #9667 @qw4990 #9702 cherry-picked
- [x] #9669 @zyycj #9685 cherry-picked
- [x] #9710 @qw4990 #9884 cherry-picked
- [x] #9711 @qw4990 #9884 cherry-picked
- [x] #9713 @qw4990 #9975 cherry-picked
- [x] #9715 @b41sh #9874 cherry-picked
- [x] #9727 @erjiaqing #10329 cherry-picked
- [x] #9728 @WangXiangUSTC #10116 cherry-picked
- [x] #9729 @wjhuang2016 #9751 **WON'T FIX**
- [x] #9730 @qw4990 #10314 cherry-picked
- [x] #9731 @wjhuang2016 #9746 #9750
- [x] #9732 @qw4990 #10109 cherry-picked
- [x] #9734 @WangXiangUSTC #9933 cherry-picked
- [x] #9735 @AndrewDi #10074 cherry-picked
- [x] #9736 @qw4990 #10380 cherry-picked
- [x] #9764 @erjiaqing #10313 cherry-picked
- [x] #9767 @b41sh #9856 cherry-picked
- [x] #9769 @qw4990 #10368 cherry-picked
- [x] #9770 @Debiancc #9899 cherry-picked
- [x] #9773 @b41sh #9819 cherry-picked
- [x] #9774 @lzmhhh123 #9841 cherry-picked
- [x] #9775 @WangXiangUSTC #9822 cherry-picked
- [x] #10051 **WON'T FIX**
- [x] #9776 **INVALID**
- [x] #10346 @erjiaqing #10347 cherry-picked
- [x] #10361 @qw4990 #10368 cherry-picked
- [x] #9813 @winoros #9830 cherry-picked
- [x] #10382 @mantuliu #10383 cherry-picked
- [x] #9763 @qw4990 #10753
",True,"Incompatible issues about date and time functions - ## Historical
- [x] #9666 @qw4990 #9693 cherry-picked
- [x] #9667 @qw4990 #9702 cherry-picked
- [x] #9669 @zyycj #9685 cherry-picked
- [x] #9710 @qw4990 #9884 cherry-picked
- [x] #9711 @qw4990 #9884 cherry-picked
- [x] #9713 @qw4990 #9975 cherry-picked
- [x] #9715 @b41sh #9874 cherry-picked
- [x] #9727 @erjiaqing #10329 cherry-picked
- [x] #9728 @WangXiangUSTC #10116 cherry-picked
- [x] #9729 @wjhuang2016 #9751 **WON'T FIX**
- [x] #9730 @qw4990 #10314 cherry-picked
- [x] #9731 @wjhuang2016 #9746 #9750
- [x] #9732 @qw4990 #10109 cherry-picked
- [x] #9734 @WangXiangUSTC #9933 cherry-picked
- [x] #9735 @AndrewDi #10074 cherry-picked
- [x] #9736 @qw4990 #10380 cherry-picked
- [x] #9764 @erjiaqing #10313 cherry-picked
- [x] #9767 @b41sh #9856 cherry-picked
- [x] #9769 @qw4990 #10368 cherry-picked
- [x] #9770 @Debiancc #9899 cherry-picked
- [x] #9773 @b41sh #9819 cherry-picked
- [x] #9774 @lzmhhh123 #9841 cherry-picked
- [x] #9775 @WangXiangUSTC #9822 cherry-picked
- [x] #10051 **WON'T FIX**
- [x] #9776 **INVALID**
- [x] #10346 @erjiaqing #10347 cherry-picked
- [x] #10361 @qw4990 #10368 cherry-picked
- [x] #9813 @winoros #9830 cherry-picked
- [x] #10382 @mantuliu #10383 cherry-picked
- [x] #9763 @qw4990 #10753
",1,incompatible issues about date and time functions historical cherry picked cherry picked zyycj cherry picked cherry picked cherry picked cherry picked cherry picked erjiaqing cherry picked wangxiangustc cherry picked won t fix cherry picked cherry picked wangxiangustc cherry picked andrewdi cherry picked cherry picked erjiaqing cherry picked cherry picked cherry picked debiancc cherry picked cherry picked cherry picked wangxiangustc cherry picked won t fix invalid erjiaqing cherry picked cherry picked winoros cherry picked mantuliu cherry picked ,1
7851,10062884541.0,IssuesEvent,2019-07-23 03:11:05,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,Incompatible with MySQL 8.0 about CAST string to unsigned,type/bug type/compatibility,"## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
MySQL(127.0.0.1:3306)> select cast('-1111.911' as unsigned)
+-------------------------------+
| cast('-1111.911' as unsigned) |
+-------------------------------+
| 18446744073709550505 |
+-------------------------------+
1 row in set (0.002 sec)
TiDB(127.0.0.1:4000)> select cast('-1111.911' as unsigned)
+-------------------------------+
| cast('-1111.911' as unsigned) |
+-------------------------------+
| 18446744073709550504 |
+-------------------------------+
1 row in set (0.003 sec)
```
2. What did you expect to see?
Expected: `18446744073709550505`
3. What did you see instead?
Got: `18446744073709550504`
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v2.1.8-24-g7b36cdfb6-dirty
Git Commit Hash: 7b36cdfb6e8a4c279fc360ed79cf1c499b553688
Git Branch: failpoint-2.1
UTC Build Time: 2019-04-30 08:26:17
GoVersion: go version go1.12 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
```
",True,"Incompatible with MySQL 8.0 about CAST string to unsigned - ## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
If possible, provide a recipe for reproducing the error.
```
MySQL(127.0.0.1:3306)> select cast('-1111.911' as unsigned)
+-------------------------------+
| cast('-1111.911' as unsigned) |
+-------------------------------+
| 18446744073709550505 |
+-------------------------------+
1 row in set (0.002 sec)
TiDB(127.0.0.1:4000)> select cast('-1111.911' as unsigned)
+-------------------------------+
| cast('-1111.911' as unsigned) |
+-------------------------------+
| 18446744073709550504 |
+-------------------------------+
1 row in set (0.003 sec)
```
2. What did you expect to see?
Expected: `18446744073709550505`
3. What did you see instead?
Got: `18446744073709550504`
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v2.1.8-24-g7b36cdfb6-dirty
Git Commit Hash: 7b36cdfb6e8a4c279fc360ed79cf1c499b553688
Git Branch: failpoint-2.1
UTC Build Time: 2019-04-30 08:26:17
GoVersion: go version go1.12 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
```
",1,incompatible with mysql about cast string to unsigned bug report please answer these questions before submitting your issue thanks what did you do if possible provide a recipe for reproducing the error mysql select cast as unsigned cast as unsigned row in set sec tidb select cast as unsigned cast as unsigned row in set sec what did you expect to see expected what did you see instead got what version of tidb are you using tidb server v or run select tidb version on tidb tidb version release version dirty git commit hash git branch failpoint utc build time goversion go version darwin race enabled false tikv min version alpha check table before drop false ,1
12297,14535380980.0,IssuesEvent,2020-12-15 05:28:01,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,closed,inconsistent behavior of `Found_Rows` and sql_calc_found_rows,challenge-program difficulty/easy high-performance severity/moderate sig/execution status/help-wanted type/bug type/compatibility,"## Description
## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
``` sql
CREATE TABLE t1 (a int not null, b char (10) not null);
insert into t1 values(1,'a'),(2,'b'),(3,'c'),(3,'c');
CREATE TABLE t2 (a int not null, b char (10) not null);
insert into t2 values (3,'c'),(4,'d'),(5,'f'),(6,'e');
(select sql_calc_found_rows a,b from t1 limit 2) union all (select a,b from t2 order by a) limit 2;
select found_rows();
```
2. What did you expect to see?
``` sql
mysql> (select sql_calc_found_rows a,b from t1 limit 2) union all (select a,b from t2 order by a) limit 2;
+---+---+
| a | b |
+---+---+
| 1 | a |
| 2 | b |
+---+---+
2 rows in set (0.00 sec)
mysql> select found_rows();
+--------------+
| found_rows() |
+--------------+
| 6 |
+--------------+
1 row in set (0.01 sec)
```
3. What did you see instead?
``` sql
tidb> (select sql_calc_found_rows a,b from t1 limit 2) union all (select a,b from
t2 order by a) limit 2;
+------+------+
| a | b |
+------+------+
| 1 | a |
| 2 | b |
+------+------+
2 rows in set (0.00 sec)
tidb> select found_rows();
+--------------+
| found_rows() |
+--------------+
| 2 |
+--------------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
tidb> select tidb_version();
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v2.1.0-rc.3-158-g1082d5f1a
Git Commit Hash: 1082d5f1ac90c7d73b34061ccef7c5cae1b69b6c
Git Branch: master
UTC Build Time: 2018-11-08 07:01:33
GoVersion: go version go1.11 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
## SIG slack channel
[#sig-exec](https://tidbcommunity.slack.com/archives/CMRD79DRR)
## Score
- 300
## Mentor
* @SunRunAway
",True,"inconsistent behavior of `Found_Rows` and sql_calc_found_rows - ## Description
## Bug Report
Please answer these questions before submitting your issue. Thanks!
1. What did you do?
``` sql
CREATE TABLE t1 (a int not null, b char (10) not null);
insert into t1 values(1,'a'),(2,'b'),(3,'c'),(3,'c');
CREATE TABLE t2 (a int not null, b char (10) not null);
insert into t2 values (3,'c'),(4,'d'),(5,'f'),(6,'e');
(select sql_calc_found_rows a,b from t1 limit 2) union all (select a,b from t2 order by a) limit 2;
select found_rows();
```
2. What did you expect to see?
``` sql
mysql> (select sql_calc_found_rows a,b from t1 limit 2) union all (select a,b from t2 order by a) limit 2;
+---+---+
| a | b |
+---+---+
| 1 | a |
| 2 | b |
+---+---+
2 rows in set (0.00 sec)
mysql> select found_rows();
+--------------+
| found_rows() |
+--------------+
| 6 |
+--------------+
1 row in set (0.01 sec)
```
3. What did you see instead?
``` sql
tidb> (select sql_calc_found_rows a,b from t1 limit 2) union all (select a,b from
t2 order by a) limit 2;
+------+------+
| a | b |
+------+------+
| 1 | a |
| 2 | b |
+------+------+
2 rows in set (0.00 sec)
tidb> select found_rows();
+--------------+
| found_rows() |
+--------------+
| 2 |
+--------------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V` or run `select tidb_version();` on TiDB)?
```
tidb> select tidb_version();
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version() |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v2.1.0-rc.3-158-g1082d5f1a
Git Commit Hash: 1082d5f1ac90c7d73b34061ccef7c5cae1b69b6c
Git Branch: master
UTC Build Time: 2018-11-08 07:01:33
GoVersion: go version go1.11 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
```
## SIG slack channel
[#sig-exec](https://tidbcommunity.slack.com/archives/CMRD79DRR)
## Score
- 300
## Mentor
* @SunRunAway
",1,inconsistent behavior of found rows and sql calc found rows description bug report please answer these questions before submitting your issue thanks what did you do sql create table a int not null b char not null insert into values a b c c create table a int not null b char not null insert into values c d f e select sql calc found rows a b from limit union all select a b from order by a limit select found rows what did you expect to see sql mysql select sql calc found rows a b from limit union all select a b from order by a limit a b a b rows in set sec mysql select found rows found rows row in set sec what did you see instead sql tidb select sql calc found rows a b from limit union all select a b from order by a limit a b a b rows in set sec tidb select found rows found rows row in set sec what version of tidb are you using tidb server v or run select tidb version on tidb tidb select tidb version tidb version release version rc git commit hash git branch master utc build time goversion go version darwin race enabled false tikv min version alpha check table before drop false row in set sec sig slack channel score mentor sunrunaway ,1
3299,6261267432.0,IssuesEvent,2017-07-14 23:23:17,pingcap/tidb,https://api.github.com/repos/pingcap/tidb,opened,overflow compability,compatibility rc3.1,"Please answer these questions before submitting your issue. Thanks!
1. What did you do?
`select -9223372036854775809;`
2. What did you expect to see?
`9223372036854775809` is overflow math.MaxInt64, but mysql convert it to Decimal type.
```
mysql> select -9223372036854775809;
Field 1: `-9223372036854775809`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: NEWDECIMAL
Collation: binary (63)
Length: 20
Max_length: 20
Decimals: 0
Flags: NOT_NULL BINARY NUM
+----------------------+
| -9223372036854775809 |
+----------------------+
| -9223372036854775809 |
+----------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
but TiDB return 9223372036854775807 caused by int overflow
```
mysql> select -9223372036854775809;
Field 1: `-9223372036854775809`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: LONGLONG
Collation: binary (63)
Length: 0
Max_length: 19
Decimals: 31
Flags: BINARY NUM
+----------------------+
| -9223372036854775809 |
+----------------------+
| 9223372036854775807 |
+----------------------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V`)?
",True,"overflow compability - Please answer these questions before submitting your issue. Thanks!
1. What did you do?
`select -9223372036854775809;`
2. What did you expect to see?
`9223372036854775809` is overflow math.MaxInt64, but mysql convert it to Decimal type.
```
mysql> select -9223372036854775809;
Field 1: `-9223372036854775809`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: NEWDECIMAL
Collation: binary (63)
Length: 20
Max_length: 20
Decimals: 0
Flags: NOT_NULL BINARY NUM
+----------------------+
| -9223372036854775809 |
+----------------------+
| -9223372036854775809 |
+----------------------+
1 row in set (0.00 sec)
```
3. What did you see instead?
but TiDB return 9223372036854775807 caused by int overflow
```
mysql> select -9223372036854775809;
Field 1: `-9223372036854775809`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: LONGLONG
Collation: binary (63)
Length: 0
Max_length: 19
Decimals: 31
Flags: BINARY NUM
+----------------------+
| -9223372036854775809 |
+----------------------+
| 9223372036854775807 |
+----------------------+
1 row in set (0.00 sec)
```
4. What version of TiDB are you using (`tidb-server -V`)?
",1,overflow compability please answer these questions before submitting your issue thanks what did you do select what did you expect to see is overflow math but mysql convert it to decimal type mysql select field catalog def database table org table type newdecimal collation binary length max length decimals flags not null binary num row in set sec what did you see instead but tidb return caused by int overflow mysql select field catalog def database table org table type longlong collation binary length max length decimals flags binary num row in set sec what version of tidb are you using tidb server v ,1