From dcca887f18c06751094e0076633a31ec982c4365 Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Mon, 11 Nov 2013 17:58:21 +0100 Subject: [PATCH 1/2] Don't set a default value when there isn't a default specified --- lib/private/db/mdb2schemareader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; From 9c1c8d57f0ba8fb0d65c65141b8ffdf118bcc012 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Tue, 12 Nov 2013 11:29:09 +0100 Subject: [PATCH 2/2] fix DB schema test - no default value --- tests/lib/db/mdb2schemareader.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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());