[SOLVED] CDbConnection exception upon SET NAMES

Did anyone of you experience problems during initialization of your database connection?

I'm working with yii 1.0.6, started on my windows machine (latest XAMPP) where everything went fine. Then I moved my application to the server (MySQL-Version: 5.0.32-Debian_7etch8) where I came accross some errors. I tracked it down to CDbConnection::initConnection, where the following throws an exception:


$stmt=$pdo->prepare('SET NAMES ?');



If I change the code to


$pdo->exec("SET NAMES '{$this->charset}'");


It works as expected (well, at least it doesn't crash).

Did you set 'emulatePrepare'=>true in your app config for the db connection?

Nope, I didn't.

Thanks for your fast reply, works as expected with that option turned on. :)