summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-11-15 01:06:38 -0800
committerThomas Müller <thomas.mueller@tmit.eu>2013-11-15 01:06:38 -0800
commit49e9f771ffb524e2aa30748837fd4fca9b42f700 (patch)
treef38e59bf66cac38b4c31f14049d964474b6e8d11
parent6ef39931cb484286e7bb7bcd8373060d3a8a5ffc (diff)
parent9c1c8d57f0ba8fb0d65c65141b8ffdf118bcc012 (diff)
downloadnextcloud-server-49e9f771ffb524e2aa30748837fd4fca9b42f700.tar.gz
nextcloud-server-49e9f771ffb524e2aa30748837fd4fca9b42f700.zip
Merge pull request #5813 from owncloud/fix-4736-master
Don't set a default value when there isn't a default specified
-rw-r--r--lib/private/db/mdb2schemareader.php2
-rw-r--r--tests/lib/db/mdb2schemareader.php4
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/private/db/mdb2schemareader.php b/lib/private/db/mdb2schemareader.php
index b7128a2f176..ad4c39a9935 100644
--- a/lib/private/db/mdb2schemareader.php
+++ b/lib/private/db/mdb2schemareader.php
@@ -186,7 +186,7 @@ class MDB2SchemaReader {
}
}
if (isset($name) && isset($type)) {
- if (empty($options['default'])) {
+ if (isset($options['default']) && empty($options['default'])) {
if (empty($options['notnull']) || !$options['notnull']) {
unset($options['default']);
$options['notnull'] = false;
diff --git a/tests/lib/db/mdb2schemareader.php b/tests/lib/db/mdb2schemareader.php
index b9b241194fd..57cafa7c76b 100644
--- a/tests/lib/db/mdb2schemareader.php
+++ b/tests/lib/db/mdb2schemareader.php
@@ -57,13 +57,13 @@ class MDB2SchemaReader extends \PHPUnit_Framework_TestCase {
$this->assertNull($table->getColumn('clobfield')->getLength());
$this->assertFalse($table->getColumn('clobfield')->getAutoincrement());
- $this->assertSame('', $table->getColumn('clobfield')->getDefault());
+ $this->assertNull($table->getColumn('clobfield')->getDefault());
$this->assertTrue($table->getColumn('clobfield')->getNotnull());
$this->assertInstanceOf('Doctrine\DBAL\Types\TextType', $table->getColumn('clobfield')->getType());
$this->assertNull($table->getColumn('booleanfield')->getLength());
$this->assertFalse($table->getColumn('booleanfield')->getAutoincrement());
- $this->assertFalse($table->getColumn('booleanfield')->getDefault());
+ $this->assertNull($table->getColumn('booleanfield')->getDefault());
$this->assertInstanceOf('Doctrine\DBAL\Types\BooleanType', $table->getColumn('booleanfield')->getType());
$this->assertTrue($table->getColumn('booleanfield_true')->getDefault());