-
-
Notifications
You must be signed in to change notification settings - Fork 481
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
Strange behavior with enum in composite unique key in a table without primary key #4503
Comments
Great bug. We'll get on this today. |
MySQL says:
From the above, the problem seems to be in the |
I think this is also a bug @druvv:
We should return a row here. |
Hey @Wuvist, I couldn't reproduce this issue using Dolt as a backend. Are you by chance running go-mysql-server with the memory engine? |
Yup, I'm using go-mysql-server with the memory engine for unit testing in my go application and encounter this issue. I didn't try Dolt. |
Another finding maybe related related. Consider the following table: CREATE TABLE `users` (
`id` int NOT NULL AUTO_INCREMENT,
`hobby` enum ('swimming', 'running', 'singing') NOT NULL DEFAULT 'swimming',
`sports` SET('SWIM', 'TENNIS', 'BASKETBALL', 'FOOTBALL') NOT NULL DEFAULT ("SWIM, FOOTBALL") ,
`sports2` SET('SWIM', 'TENNIS', 'BASKETBALL', 'FOOTBALL') NOT NULL DEFAULT "SWIM,FOOTBALL",
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4; In existing will return:
which is correct. But in current main branch ( commit `c5b2d44) . it returns:
The default values stored in
|
I think I'm going to resolve this one. Please create a new bug in |
I've a very strange table:
Usually, the
UNIQUE KEY
is should be declared as primary key, but somehow it's declared asUNIQUE KEY
only, and the table has no other keys.If I create this table in
go-mysql-server v0.12.0
, and run the following queryIt failed to return result when
type
is in where condition.I test the same table & query on
MySQL 5.7.35
, although it works:but it seems that
MySQL 5.7.35
consider the unique key as primary key:It works if unique key is declared as primary in
go-mysql-server v0.12.0
, it also works iftype
is notenum
butint
.I suppose this is a extreme corner case and may not worth fixing, but would like to report it here first in case it's related to some other hidden bug related to enum support.
The text was updated successfully, but these errors were encountered: