Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
534129d6
Commit
534129d6
authored
Mar 31, 2014
by
Steve Müller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix integer 0 default value reverse engineering on SQL Anywhere
parent
7c68e80f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
SQLAnywhereSchemaManager.php
lib/Doctrine/DBAL/Schema/SQLAnywhereSchemaManager.php
+1
-1
SchemaManagerFunctionalTestCase.php
...BAL/Functional/Schema/SchemaManagerFunctionalTestCase.php
+4
-0
No files found.
lib/Doctrine/DBAL/Schema/SQLAnywhereSchemaManager.php
View file @
534129d6
...
...
@@ -109,7 +109,7 @@ class SQLAnywhereSchemaManager extends AbstractSchemaManager
$fixed
=
false
;
$default
=
null
;
if
(
$tableColumn
[
'default'
])
{
if
(
null
!==
$tableColumn
[
'default'
])
{
// Strip quotes from default value.
$default
=
preg_replace
(
array
(
"/^'(.*)'$/"
,
"/''/"
),
array
(
"$1"
,
"'"
),
$tableColumn
[
'default'
]);
...
...
tests/Doctrine/Tests/DBAL/Functional/Schema/SchemaManagerFunctionalTestCase.php
View file @
534129d6
...
...
@@ -726,6 +726,7 @@ class SchemaManagerFunctionalTestCase extends \Doctrine\Tests\DbalFunctionalTest
$table
->
addColumn
(
'column4'
,
'string'
,
array
(
'default'
=>
0
));
$table
->
addColumn
(
'column5'
,
'string'
,
array
(
'default'
=>
''
));
$table
->
addColumn
(
'column6'
,
'string'
,
array
(
'default'
=>
'def'
));
$table
->
addColumn
(
'column7'
,
'integer'
,
array
(
'default'
=>
0
));
$table
->
setPrimaryKey
(
array
(
'id'
));
$this
->
_sm
->
dropAndCreateTable
(
$table
);
...
...
@@ -739,6 +740,7 @@ class SchemaManagerFunctionalTestCase extends \Doctrine\Tests\DbalFunctionalTest
$this
->
assertSame
(
'0'
,
$columns
[
'column4'
]
->
getDefault
());
$this
->
assertSame
(
''
,
$columns
[
'column5'
]
->
getDefault
());
$this
->
assertSame
(
'def'
,
$columns
[
'column6'
]
->
getDefault
());
$this
->
assertSame
(
'0'
,
$columns
[
'column7'
]
->
getDefault
());
$diffTable
=
clone
$table
;
...
...
@@ -748,6 +750,7 @@ class SchemaManagerFunctionalTestCase extends \Doctrine\Tests\DbalFunctionalTest
$diffTable
->
changeColumn
(
'column4'
,
array
(
'default'
=>
null
));
$diffTable
->
changeColumn
(
'column5'
,
array
(
'default'
=>
false
));
$diffTable
->
changeColumn
(
'column6'
,
array
(
'default'
=>
666
));
$diffTable
->
changeColumn
(
'column7'
,
array
(
'default'
=>
null
));
$comparator
=
new
Comparator
();
...
...
@@ -761,6 +764,7 @@ class SchemaManagerFunctionalTestCase extends \Doctrine\Tests\DbalFunctionalTest
$this
->
assertNull
(
$columns
[
'column4'
]
->
getDefault
());
$this
->
assertSame
(
''
,
$columns
[
'column5'
]
->
getDefault
());
$this
->
assertSame
(
'666'
,
$columns
[
'column6'
]
->
getDefault
());
$this
->
assertNull
(
$columns
[
'column7'
]
->
getDefault
());
}
public
function
testListTableWithBinary
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment