-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
The "varchar" type column flags are not compatible with MySQL #13992
Comments
Confirming that I can still reproduce this in master: DROP TABLE IF EXISTS t;
CREATE TABLE t (
c varchar(120) DEFAULT NULL
) CHARSET=utf8 COLLATE=utf8_bin;
SELECT c FROM t;
..
mysql> SELECT c FROM t;
Field 1: `c`
Catalog: `def`
Database: `test`
Table: `t`
Org_table: `t`
Type: VAR_STRING
Collation: utf8_bin (83)
Length: 360
Max_length: 0
Decimals: 0
Flags:
mysql> SELECT tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v4.0.0-beta.2-771-gca41972fb
Edition: Community
Git Commit Hash: ca41972fbac068c8a5de107d9075f09ac68842ac
Git Branch: master
UTC Build Time: 2020-07-14 02:41:21
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)
vs mysql:
mysql [localhost:5731] {msandbox} (test) > SELECT c FROM t;
Field 1: `c`
Catalog: `def`
Database: `test`
Table: `t`
Org_table: `t`
Type: VAR_STRING
Collation: utf8_general_ci (33)
Length: 360
Max_length: 0
Decimals: 0
Flags: BINARY |
The simple fix is if we meet collation in [charset.CollationUTF8, charset.CollationUTF8MB4, charset.CollationASCII, charset.CollationLatin1], just add |
MySQL's behavior is strange, and we decide not to fix it unless it really affect the usage. |
Bug Report
Please answer these questions before submitting your issue. Thanks!
If possible, provide a recipe for reproducing the error.
tidb-server -V
or runselect tidb_version();
on TiDB)?Release Version: v2.1.18-32-g8ddd007c7-dirty
Git Commit Hash: 8ddd007
Git Branch: heads/zimuxia/drop-col
The text was updated successfully, but these errors were encountered: