Closed Obramko closed 10 years ago
The fix is not correct since it breaks aliases usage:
SELECT * FROM post p WHERE active = 1;
becomes
SELECT * FROM `post p` WHERE `active` = 1;
I don't see a way to automatically differentiate usage of table with space from table with alias.
does yii escape already escaped table names?
Yes, it seems so.
Duplicate of #3533.
Some RDMS (like PostgreSQL) allows whitespaces in table names, which have to be quoted. A regex at db/QueryBuilder.php breaks such table names, e.g. table ' "one two" ' becomes ' "one" "two" ' instead.
I'm preparing a pull request with easy fix of this issue, but it needs testing.