MySQL: Sort doesn't work with odd-cased column names
Description
Root cause:
MySQL's metadata says the column is "ColumnName" if queried with SELECT columnname FROM table1, but MySQL says the column is "columnname" with SELECT * FROM (SELECT columnname FROM table1) WHERE ....
Column names can't be escaped properly because " is the same as ' in MySQL, which makes "ColumnName" a literal string.
Root cause:
MySQL's metadata says the column is "ColumnName" if queried with
SELECT columnname FROM table1
, but MySQL says the column is "columnname" withSELECT * FROM (SELECT columnname FROM table1) WHERE ...
.Column names can't be escaped properly because
"
is the same as'
in MySQL, which makes"ColumnName"
a literal string.