-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Fix when use lower_case_table_names 0 in mysql #2524
Conversation
Can you explain a bit more about what's going on here? thanks :) |
sorry, there is typo. if set lower_case_table_names to 0 in mysql, column name is in upper case. row['table_schema'] will generate an error. (redash/redash/query_runner/mysql.py line 117) |
references about lower_case_table_names : https://dev.mysql.com/doc/refman/8.0/en/identifier-case-sensitivity.html |
col.column_name | ||
SELECT col.TABLE_SCHEMA as table_schema, | ||
col.TABLE_NAME as table_name, | ||
col.COLUMN_NAME as column_name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this breaking for anyone who didn't set local_case_table_names
to 0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll answer instead: no, it will not, because originally all column names in information_schema
are upper-cased. When lower_case_table_names == 0
- then query must use upper-cased names as well; when lower_case_table_names != 0
- no matter what case the query use, MySQL will use CI comparison. So common denominator is to always use upper-cased names.
Yeah, I see now 👍 |
No description provided.