mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-08 04:22:40 +00:00
Fixing bug in DboMysql::value()
This commit is contained in:
parent
88a2fb5058
commit
d83c95cf46
2 changed files with 3 additions and 4 deletions
|
@ -231,7 +231,7 @@ class DboMysql extends DboSource {
|
|||
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);
|
||||
|
|
|
@ -277,10 +277,9 @@ class DboMysqlTest extends CakeTestCase {
|
|||
* @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'
|
||||
|
@ -308,7 +307,7 @@ class DboMysqlTest extends CakeTestCase {
|
|||
$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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue