yiisoft / yii

Yii PHP Framework 1.1.x
http://www.yiiframework.com
BSD 3-Clause "New" or "Revised" License
4.84k stars 2.28k forks source link

Added the CDbCommand::throwExceptionIfSqlQueryTextExists() method #4550

Closed JustMisha closed 8 months ago

JustMisha commented 8 months ago

This method is called by the methods that populate the $_query array to prevent hard to debug errors.

If __construct() or setText sets $_text there is no point in using the methods like select(), from(), etc after that because the sql query text already exists and the buildQuery() method will never be called.

marcovtwout commented 8 months ago

Thanks for your PR, but Yii 1 is only accepting compatibility and security fixes as it is in maintainance mode. Also I understand why you would want the framework to prevent this kind of misusage of the query builder, but this is not something we can change easily and keep backward compatible.