mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Fixing bug in DboMysql::describe()
This commit is contained in:
parent
17f24719ee
commit
88a2fb5058
2 changed files with 6 additions and 5 deletions
|
@ -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'])) {
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue