Skip to content

Commit

Permalink
Fixing bug in DboMysql::value()
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Oct 16, 2010
1 parent 88a2fb5 commit d83c95c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cake/libs/model/datasources/dbo/dbo_mysql.php
Expand Up @@ -231,7 +231,7 @@ function value($data, $column = null, $safe = false) {
return $parent;
}
if ($data === null || (is_array($data) && empty($data))) {
return $this->_connection->quote($data, PDO::PARAM_NULL);
return 'NULL';
}
if ($data === '' && $column !== 'integer' && $column !== 'float' && $column !== 'boolean') {
return $this->_connection->quote($data, PDO::PARAM_STR);
Expand Down
Expand Up @@ -277,10 +277,9 @@ function testLocalizedFloats() {
* @return void
*/
function testTinyintCasting() {
$this->skipIf(true, 'Is this a test over the DBO?');
$this->Dbo->cacheSources = false;
$tableName = 'tinyint_' . uniqid();
$this->Dbo->execute('CREATE TABLE ' . $this->Dbo->fullTableName($tableName) . ' (id int(11) AUTO_INCREMENT, bool tinyint(1), small_int tinyint(2), primary key(id));');
$this->Dbo->rawQuery('CREATE TABLE ' . $this->Dbo->fullTableName($tableName) . ' (id int(11) AUTO_INCREMENT, bool tinyint(1), small_int tinyint(2), primary key(id));');

$this->model = new CakeTestModel(array(
'name' => 'Tinyint', 'table' => $tableName, 'ds' => 'test'
Expand Down Expand Up @@ -308,7 +307,7 @@ function testTinyintCasting() {
$this->assertIdentical($result['Tinyint']['small_int'], '0');
$this->model->deleteAll(true);

$this->Dbo->query('DROP TABLE ' . $this->Dbo->fullTableName($tableName));
$this->Dbo->rawQuery('DROP TABLE ' . $this->Dbo->fullTableName($tableName));
}

/**
Expand Down

0 comments on commit d83c95c

Please sign in to comment.