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
e4c8f54b
Unverified
Commit
e4c8f54b
authored
May 16, 2017
by
mondrake
Committed by
Marco Pivetta
Jun 29, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix - Duplicate 'COMMENT' part in SQL statement
parent
8e3159b3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
3 deletions
+25
-3
AbstractPlatform.php
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
+3
-3
SchemaManagerFunctionalTestCase.php
...BAL/Functional/Schema/SchemaManagerFunctionalTestCase.php
+22
-0
No files found.
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
View file @
e4c8f54b
...
@@ -2238,11 +2238,11 @@ abstract class AbstractPlatform
...
@@ -2238,11 +2238,11 @@ abstract class AbstractPlatform
$typeDecl
=
$field
[
'type'
]
->
getSQLDeclaration
(
$field
,
$this
);
$typeDecl
=
$field
[
'type'
]
->
getSQLDeclaration
(
$field
,
$this
);
$columnDef
=
$typeDecl
.
$charset
.
$default
.
$notnull
.
$unique
.
$check
.
$collation
;
$columnDef
=
$typeDecl
.
$charset
.
$default
.
$notnull
.
$unique
.
$check
.
$collation
;
}
if
(
$this
->
supportsInlineColumnComments
()
&&
isset
(
$field
[
'comment'
])
&&
$field
[
'comment'
]
!==
''
)
{
if
(
$this
->
supportsInlineColumnComments
()
&&
isset
(
$field
[
'comment'
])
&&
$field
[
'comment'
]
!==
''
)
{
$columnDef
.=
' '
.
$this
->
getInlineColumnCommentSQL
(
$field
[
'comment'
]);
$columnDef
.=
' '
.
$this
->
getInlineColumnCommentSQL
(
$field
[
'comment'
]);
}
}
}
return
$name
.
' '
.
$columnDef
;
return
$name
.
' '
.
$columnDef
;
}
}
...
...
tests/Doctrine/Tests/DBAL/Functional/Schema/SchemaManagerFunctionalTestCase.php
View file @
e4c8f54b
...
@@ -1048,6 +1048,28 @@ class SchemaManagerFunctionalTestCase extends \Doctrine\Tests\DbalFunctionalTest
...
@@ -1048,6 +1048,28 @@ class SchemaManagerFunctionalTestCase extends \Doctrine\Tests\DbalFunctionalTest
$this
->
assertEquals
(
"It's a comment with a quote"
,
$columns
[
'id'
]
->
getComment
());
$this
->
assertEquals
(
"It's a comment with a quote"
,
$columns
[
'id'
]
->
getComment
());
}
}
public
function
testCommentNotDuplicated
()
{
if
(
!
$this
->
_conn
->
getDatabasePlatform
()
->
supportsInlineColumnComments
())
{
$this
->
markTestSkipped
(
'Database does not support column comments.'
);
}
$options
=
array
(
'type'
=>
Type
::
getType
(
'integer'
),
'default'
=>
0
,
'notnull'
=>
TRUE
,
'comment'
=>
'expected+column+comment'
,
);
$columnDefinition
=
substr
(
$this
->
_conn
->
getDatabasePlatform
()
->
getColumnDeclarationSQL
(
'id'
,
$options
),
strlen
(
'id'
)
+
1
);
$table
=
new
Table
(
'my_table'
);
$table
->
addColumn
(
'id'
,
'integer'
,
array
(
'columnDefinition'
=>
$columnDefinition
,
'comment'
=>
'unexpected_column_comment'
));
$sql
=
$this
->
_conn
->
getDatabasePlatform
()
->
getCreateTableSQL
(
$table
);
$this
->
assertContains
(
'expected+column+comment'
,
$sql
[
0
]);
$this
->
assertNotContains
(
'unexpected_column_comment'
,
$sql
[
0
]);
}
/**
/**
* @group DBAL-1009
* @group DBAL-1009
*
*
...
...
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