-
-
Notifications
You must be signed in to change notification settings - Fork 504
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
Information_Schema.Columns => COLUMN_KEY in ('PRI','pri') causes matched behavior to MYSQL #4874
Comments
Hey @ywadi, thanks for taking the time to report this problem. We want Dolt and go-mysql-server to work with the MySQL ecosystem of tooling, and Metabase is definitely included in that. I'm moving this over to the |
Quick update on this one... I debugged through this, and you are correct that MySQL is not strict about the values in a Thanks again for reporting this issue! This is a great one for us to fix. |
Awesome thank you for the awesome work! |
Hey @ywadi, I got the fix for this merged in to Thanks a ton for taking the time to report this issue so we could dig in and get this fixed! 🙏 Let us know if you see anything else odd or just have any questions and we'll be happy to help out. |
Awesome and my pleasure, I will let you know how it goes. |
I stumbled upon this, when I connected my datasource through go-mysql-server to metabase;
Metabase was trying to scan tables with the query
SELECT A.TABLE_SCHEMA TABLE_CAT, NULL TABLE_SCHEM, A.TABLE_NAME, A.COLUMN_NAME, B.SEQ_IN_INDEX KEY_SEQ, B.INDEX_NAME PK_NAME FROM INFORMATION_SCHEMA.COLUMNS A, INFORMATION_SCHEMA.STATISTICS B WHERE A.COLUMN_KEY in ('PRI','pri') AND B.INDEX_NAME='PRIMARY' AND A.TABLE_SCHEMA = database() AND B.TABLE_SCHEMA = database() AND A.TABLE_NAME='jokes' AND B.TABLE_NAME='jokes' AND A.TABLE_SCHEMA = B.TABLE_SCHEMA AND A.TABLE_NAME = B.TABLE_NAME AND A.COLUMN_NAME = B.COLUMN_NAME ORDER BY A.COLUMN_NAME
, and the error is as follows from the go terminal
operand should have &{%!d(string=pri) {6165 [112 114 105]} {6163 1073741823 4294967295 4294967295 309}} columns, but has 1"
After debuging, I found out that the ENUM in the sql/information_schema/information_schema.go has the "PRI" all caps,
MYSQL tends to allow the "pri" and ignore it, where as it seems go-mysql-server here is considering it a mis-match to the ENUM and causes the error reported back, is this something that can be fixed ? I assume its a simple fix?
The text was updated successfully, but these errors were encountered: