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
0bb2e66d
Unverified
Commit
0bb2e66d
authored
Apr 10, 2020
by
Sergei Morozov
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.10.x' into 2.11.x
parents
156d774d
6c789b30
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletion
+16
-1
SqliteSchemaManager.php
lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php
+1
-1
SqliteSchemaManagerTest.php
.../Tests/DBAL/Functional/Schema/SqliteSchemaManagerTest.php
+15
-0
No files found.
lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php
View file @
0bb2e66d
...
...
@@ -496,7 +496,7 @@ CREATE\sTABLE # Match "CREATE TABLE"
private
function
parseColumnCommentFromSQL
(
string
$column
,
string
$sql
)
:
?
string
{
$pattern
=
'{[\s(,](?:\W'
.
preg_quote
(
$this
->
_platform
->
quoteSingleIdentifier
(
$column
))
.
'\W|\W'
.
preg_quote
(
$column
)
.
'\W)(?:\(
.
*?\)|[^,(])*?,?((?:(?!\n))(?:\s*--[^\n]*\n?)+)}i'
;
.
'\W)(?:\(
[^)]
*?\)|[^,(])*?,?((?:(?!\n))(?:\s*--[^\n]*\n?)+)}i'
;
if
(
preg_match
(
$pattern
,
$sql
,
$match
)
!==
1
)
{
return
null
;
...
...
tests/Doctrine/Tests/DBAL/Functional/Schema/SqliteSchemaManagerTest.php
View file @
0bb2e66d
...
...
@@ -278,4 +278,19 @@ SQL;
// with an empty table, non autoincrement rowid is always 1
$this
->
assertEquals
(
1
,
$lastUsedIdAfterDelete
);
}
public
function
testOnlyOwnCommentIsParsed
()
:
void
{
$table
=
new
Table
(
'own_column_comment'
);
$table
->
addColumn
(
'col1'
,
'string'
,
[
'length'
=>
16
]);
$table
->
addColumn
(
'col2'
,
'string'
,
[
'length'
=>
16
,
'comment'
=>
'Column #2'
]);
$table
->
addColumn
(
'col3'
,
'string'
,
[
'length'
=>
16
]);
$sm
=
$this
->
connection
->
getSchemaManager
();
$sm
->
createTable
(
$table
);
$this
->
assertNull
(
$sm
->
listTableDetails
(
'own_column_comment'
)
->
getColumn
(
'col1'
)
->
getComment
());
}
}
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