Skip to content

Commit

Permalink
Fixing bug in DboMysql::describe()
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Oct 16, 2010
1 parent 17f2471 commit 88a2fb5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cake/libs/model/datasources/dbo/dbo_mysql.php
Expand Up @@ -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'])) {
Expand Down
Expand Up @@ -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)'
);
Expand Down Expand Up @@ -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));
}
/**
Expand Down

0 comments on commit 88a2fb5

Please sign in to comment.