Fixing bug in DboMysql::describe()

This commit is contained in:
José Lorenzo Rodríguez 2010-10-16 13:44:16 -04:30
parent 17f24719ee
commit 88a2fb5058
2 changed files with 6 additions and 5 deletions

View file

@ -423,7 +423,7 @@ class DboMysql extends DboSource {
}
foreach ($this->fieldParameters as $name => $value) {
if (!empty($column->{$value['column']})) {
$fields[$column->Field][$name] = $column[0][$value['column']];
$fields[$column->Field][$name] = $column->{$value['column']};
}
}
if (isset($fields[$column->Field]['collate'])) {

View file

@ -835,7 +835,8 @@ class DboMysqlTest extends CakeTestCase {
* @return void
*/
function testVirtualFieldSeparators() {
$model =& new CakeTestModel(array('table' => 'binary_tests', 'ds' => 'test', 'name' => 'BinaryTest'));
$this->loadFixtures('BinaryTest');
$model = new CakeTestModel(array('table' => 'binary_tests', 'ds' => 'test', 'name' => 'BinaryTest'));
$model->virtualFields = array(
'other__field' => 'SUM(id)'
);
@ -870,15 +871,15 @@ class DboMysqlTest extends CakeTestCase {
)
)
));
$this->db->execute($this->db->createSchema($schema));
$this->db->execute($this->db->createSchema($schema));
$model = new CakeTestModel(array('table' => 'testdescribes', 'name' => 'Testdescribes'));
$result = $this->db->describe($model);
$this->db->execute($this->db->dropSchema($schema));
$this->assertEqual($result['stringy']['collate'], 'cp1250_general_ci');
$this->assertEqual($result['stringy']['charset'], 'cp1250');
$this->assertEqual($result['other_col']['comment'], 'Test Comment');
$this->db->execute($this->db->dropSchema($schema));
}
/**