Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error message about "create table" is not same with MYSQL #9285

Closed
xiekeyi98 opened this issue Feb 12, 2019 · 3 comments · Fixed by #9291
Closed

Error message about "create table" is not same with MYSQL #9285

xiekeyi98 opened this issue Feb 12, 2019 · 3 comments · Fixed by #9291
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. type/compatibility

Comments

@xiekeyi98
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?

Exec SQL

 create table tt( charID varchar(10), charID varchar(10) charset utf8mb4 );
  1. What did you expect to see?
mysql>  create table tt( charID varchar(10), charID varchar(10) charset utf8mb4 );
ERROR 1060 (42S21): Duplicate column name 'charID'
mysql> select version();
+-------------------------+
| version()               |
+-------------------------+
| 5.7.25-0ubuntu0.18.04.2 |
+-------------------------+
1 row in set (0.00 sec)
  1. What did you see instead?
TiDB>  create table tt( charID varchar(10), charID varchar(10) charset utf8mb4 );
ERROR 1060 (42S21): Duplicate column name 'charid'
TiDB> select version();
+----------------------------------------------+
| version()                                    |
+----------------------------------------------+
| 5.7.10-TiDB-v2.1.0-rc.3-528-g98c22dd2d-dirty |
+----------------------------------------------+
1 row in set (0.01 sec)
  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
TiDB> select tidb_version() \G
*************************** 1. row ***************************
tidb_version(): Release Version: v2.1.0-rc.3-528-g98c22dd2d-dirty
Git Commit Hash: 98c22dd2d5bd91c8b63c8866a717d31054d25ca6
Git Branch: TiDB-2866
UTC Build Time: 2019-02-12 09:12:22
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 row in set (0.00 sec)
@xiekeyi98 xiekeyi98 added help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. type/compatibility good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. labels Feb 12, 2019
@u5surf
Copy link
Contributor

u5surf commented Feb 12, 2019

I was checking out master branch and build make server
It could not reproduce same situation.
Which branch or tags do you checkout and test it?
and do you try to rebase master branch?

mysql> create table tt( charID varchar(10), charID varchar(10) charset utf8mb4 );
ERROR 1060 (42S21): Duplicate column name 'charID'
mysql> select version();
+------------------+
| version()        |
+------------------+
| 5.7.10-TiDB-None |
+------------------+
1 row in set (0.01 sec)

mysql>  select tidb_version() \G
*************************** 1. row ***************************
tidb_version(): Release Version: None
Git Commit Hash: a4cff40a18da37b146ad763a8f7cd6756fdf569d
Git Branch: master
UTC Build Time: 2019-02-12 09:28:11
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 row in set (0.00 sec)

mysql>

@xiekeyi98
Copy link
Contributor Author

xiekeyi98 commented Feb 13, 2019

@u5surf
Hello, sorry for that I am not build in master at first.
I can reproduce in master now.

The following is for you reference:

xiekeyi@ubuntu:~/gopath/src/github.com/pingcap/tidb$ git checkout master 
切换到分支 'master'
您的分支与上游分支 'origin/master' 一致。
xiekeyi@ubuntu:~/gopath/src/github.com/pingcap/tidb$ git fetch upstream master
来自 github.com:pingcap/tidb
 * branch                master     -> FETCH_HEAD
xiekeyi@ubuntu:~/gopath/src/github.com/pingcap/tidb$ git reset --hard upstream/master 
HEAD 现在位于 2f9ab6099 infoschema: remove pfs setup_timers (#9217)
xiekeyi@ubuntu:~/gopath/src/github.com/pingcap/tidb$ make && ./bin/tidb-server 
CGO_ENABLED=1 GO111MODULE=on go build   -ldflags '-X "github.com/pingcap/parser/mysql.TiDBReleaseVersion=v2.1.0-rc.3-541-g2f9ab6099" -X "github.com/pingcap/tidb/util/printer.TiDBBuildTS=2019-02-13 02:09:44" -X "github.com/pingcap/tidb/util/printer.TiDBGitHash=2f9ab60995c972be14c407e204e68ea1621e585d" -X "github.com/pingcap/tidb/util/printer.TiDBGitBranch=master" -X "github.com/pingcap/tidb/util/printer.GoVersion=go version go1.11.2 linux/amd64" ' -o bin/tidb-server tidb-server/main.go
Build TiDB Server successfully!
xiekeyi@ubuntu:~$ mysql -u root -P 4000 -h 127.0.0.1
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.7.10-TiDB-v2.1.0-rc.3-541-g2f9ab6099 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> show databases;
+--------------------+
| Database           |
+--------------------+
| INFORMATION_SCHEMA |
| PERFORMANCE_SCHEMA |
| mysql              |
| test               |
+--------------------+
4 rows in set (0.00 sec)

mysql> use test;
Database changed
mysql> show tables;
Empty set (0.00 sec)

mysql> create table tt( ID123 int , ID123 int );
ERROR 1060 (42S21): Duplicate column name 'id123'
mysql> create table tt( charID varchar(10) , charID varchar(10) charset utf8mb4);
ERROR 1060 (42S21): Duplicate column name 'charid'
mysql> create table tt( WHYNOTUPPER char , WHYNOTUPPER int);
ERROR 1060 (42S21): Duplicate column name 'whynotupper'
mysql> select version();
+----------------------------------------+
| version()                              |
+----------------------------------------+
| 5.7.10-TiDB-v2.1.0-rc.3-541-g2f9ab6099 |
+----------------------------------------+
1 row in set (0.00 sec)
mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v2.1.0-rc.3-541-g2f9ab6099
Git Commit Hash: 2f9ab60995c972be14c407e204e68ea1621e585d
Git Branch: master
UTC Build Time: 2019-02-13 02:09:44
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 row in set (0.00 sec)

mysql> exit
Bye
xiekeyi@ubuntu:~$ uname -a
Linux ubuntu 4.15.0-45-generic #48-Ubuntu SMP Tue Jan 29 16:28:13 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

I think maybe because operating system case sensitivity.

@xiekeyi98
Copy link
Contributor Author

I think your commitID a4cff40a18da37b146ad763a8f7cd6756fdf569d is a little old.
Would you mind update your HEAD ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. type/compatibility
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants