Skip to content
Permalink
Browse files

Fixing bug in DboMysql::describe()

  • Loading branch information...
lorenzo committed Oct 16, 2010
1 parent 17f2471 commit 88a2fb5058d7c04865fb8c6feec07438f5b8c2f4
@@ -423,7 +423,7 @@ function describe($model) {
}
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'])) {
@@ -835,7 +835,8 @@ function testGetCharsetName() {
* @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 @@ function testDescribeGettingFieldParameters() {
)
)
));
$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));
}

/**

0 comments on commit 88a2fb5

Please sign in to comment.
You can’t perform that action at this time.