Sorry, I've just realised what your update actually says.
if I use this configuration
'db'=>array( 'connectionString' => '...', 'emulatePrepare' => ..., 'username' => '...', 'password' => '...', 'charset' => '...', 'tablePrefix' => '' ),
pay attention to the empty tablePrefix — all works fine.
Yes, of course it does: you have defined tablePrefix
to be an empty string (and, as I already pointed out, empty-string prefixes have been supported since v.1.1.6).
Removing this key I get the problem described above. But I don't need table prefix. I just want to use a component that can work with prefixes, not only in my application.
If you don't define tablePrefix
, then comparing it against null
will be true (and as I also pointed out before, CDbCommand::setText()
replaces non-null prefixes):
if($this->_connection->tablePrefix!==null && $value!='')
$this->_text=preg_replace('/{{(.*?)}}/',$this->_connection->tablePrefix.'\1',$value);
Thus you must either replace braces yourself or else explicitly set tablePrefix
to be the empty string. If you have no control over the configuration file, but want to ensure that tablePrefix
is set, you could manually override it:
if (!isset($connection->tablePrefix)) $connection->tablePrefix = '';