Fixing DboMysql not quoting database names in listSources.

Updated tests.
Fixes #1552
This commit is contained in:
mark_story 2011-02-23 11:36:41 -05:00
parent 30c7b954ec
commit 98df3e331f
2 changed files with 5 additions and 5 deletions

View file

@ -182,7 +182,7 @@ class DboMysql extends DboSource {
if ($cache != null) {
return $cache;
}
$result = $this->_execute('SHOW TABLES FROM ' . $this->config['database']);
$result = $this->_execute('SHOW TABLES FROM ' . $this->name($this->config['database']));
if (!$result) {
$result->closeCursor();

View file

@ -779,7 +779,7 @@ class DboMysqlTest extends CakeTestCase {
$queryResult = $this->getMock('PDOStatement');
$db->expects($this->once())
->method('_execute')
->with('SHOW TABLES FROM cake')
->with('SHOW TABLES FROM `cake`')
->will($this->returnValue($queryResult));
$queryResult->expects($this->at(0))
->method('fetch')
@ -2869,7 +2869,7 @@ class DboMysqlTest extends CakeTestCase {
* @return void
*/
function testVirtualFields() {
$this->loadFixtures('Article', 'Comment');
$this->loadFixtures('Article', 'Comment', 'Tag');
$this->Dbo->virtualFieldSeparator = '__';
$Article = ClassRegistry::init('Article');
$Article->virtualFields = array(
@ -2939,7 +2939,7 @@ class DboMysqlTest extends CakeTestCase {
* @return void
*/
function testVirtualFieldsInConditions() {
$Article = ClassRegistry::init('Article');
$Article = ClassRegistry::init('Article', 'Comment', 'Tag');
$Article->virtualFields = array(
'this_moment' => 'NOW()',
'two' => '1 + 1',
@ -2973,7 +2973,7 @@ class DboMysqlTest extends CakeTestCase {
* @return void
*/
function testConditionsWithComplexVirtualFields() {
$Article = ClassRegistry::init('Article');
$Article = ClassRegistry::init('Article', 'Comment', 'Tag');
$Article->virtualFields = array(
'distance' => 'ACOS(SIN(20 * PI() / 180)
* SIN(Article.latitude * PI() / 180)