mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Fixing DboMysql not quoting database names in listSources.
Updated tests. Fixes #1552
This commit is contained in:
parent
30c7b954ec
commit
98df3e331f
2 changed files with 5 additions and 5 deletions
|
@ -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();
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue