Jeremy Baron wrote:
Seems pretty clearly broken; we should fix the way we quote. (and maybe not break anyone because anyone using the syntax that triggers this would already be broken because of this) Maybe we need backticks instead of quotes? I can test when I'm less sleepy but maybe someone else knows. Looks like it per http://dev.mysql.com/doc/refman/5.0/en/identifiers.html
Yes, the problem is that it is using parameter quoting instead of identifier quoting. Was quite obvious once I was looking at it on mysql-cli.
Not particulary useful in this case, but when dealing with wrapper selects you may enjoy http://toolserver.org/~platonides/mwtools/ExpandSelect.php </spam>