No Quoting Of Certain Columns?

I am having a little trouble getting a query to work:


	[$attribute => new Expression($db->quoteColumnName($attribute) . sprintf('%+d', $delta))],

	['and', $attribute . ' >= :key', $this->rootAttribute . ' = :root'],

	[':key' => $key, ':root' => $owner->{$this->rootAttribute}]


The problem is that $attribute is in fact the word "left" which is a reserved word in MySQL, of course, so the query fails. It in fact creates:

UPDATE `tbl_geozone` SET `left`=`left`+2 WHERE (left >= '170') AND (root = '1')

The docs seem unclear on how I can take advantage of Yii2 quoting on this query, how can I?

From what I can tell, unlike the rest of the QueryBuilder.php class forming a where does not actually ever call quoteColumnName() on the db object.

As such there is no way, from what I can see in the coding to actually do a query as simple as this without having to manually quote.

Not that I am resolving your problem, but could you look at your DB design. Using reserved words as column names is normally not recommended.

Yeah though I was able to resolve this in the end by stating which to escape.