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
cf93b0dc
Commit
cf93b0dc
authored
Oct 30, 2011
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Quote identifier if its a keyword in the given platform
parent
576eae09
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
AbstractAsset.php
lib/Doctrine/DBAL/Schema/AbstractAsset.php
+4
-3
PostgreSqlSchemaManagerTest.php
...ts/DBAL/Functional/Schema/PostgreSqlSchemaManagerTest.php
+3
-3
No files found.
lib/Doctrine/DBAL/Schema/AbstractAsset.php
View file @
cf93b0dc
...
...
@@ -71,7 +71,7 @@ abstract class AbstractAsset
/**
* Trim quotes from the identifier.
*
*
* @param string $identifier
* @return string
*/
...
...
@@ -82,7 +82,7 @@ abstract class AbstractAsset
/**
* Return name of this schema asset.
*
*
* @return string
*/
public
function
getName
()
...
...
@@ -99,7 +99,8 @@ abstract class AbstractAsset
*/
public
function
getQuotedName
(
AbstractPlatform
$platform
)
{
return
(
$this
->
_quoted
)
?
$platform
->
quoteIdentifier
(
$this
->
_name
)
:
$this
->
_name
;
$keywords
=
$platform
->
getReservedKeywordsList
();
return
(
$this
->
_quoted
||
$keywords
->
isKeyword
(
$this
->
_name
))
?
$platform
->
quoteIdentifier
(
$this
->
_name
)
:
$this
->
_name
;
}
/**
...
...
tests/Doctrine/Tests/DBAL/Functional/Schema/PostgreSqlSchemaManagerTest.php
View file @
cf93b0dc
...
...
@@ -7,7 +7,7 @@ use Doctrine\DBAL\Types\Type;
use
Doctrine\DBAL\Platforms\AbstractPlatform
;
require_once
__DIR__
.
'/../../../TestInit.php'
;
class
PostgreSqlSchemaManagerTest
extends
SchemaManagerFunctionalTestCase
{
/**
...
...
@@ -116,7 +116,7 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
$column
->
setAutoincrement
(
true
);
$nestedSchemaTable
->
setPrimaryKey
(
array
(
'id'
));
$nestedSchemaTable
->
addUnnamedForeignKeyConstraint
(
$nestedRelatedTable
,
array
(
'id'
),
array
(
'id'
));
$this
->
_sm
->
createTable
(
$nestedRelatedTable
);
$this
->
_sm
->
createTable
(
$nestedSchemaTable
);
...
...
@@ -149,7 +149,7 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
$this
->
assertEquals
(
array
(
"CREATE TABLE dbal91_something (id INT NOT NULL,
table
INT DEFAULT NULL, PRIMARY KEY(id))"
,
"CREATE TABLE dbal91_something (id INT NOT NULL,
\"
table
\"
INT DEFAULT NULL, PRIMARY KEY(id))"
,
"CREATE INDEX IDX_A9401304ECA7352B ON dbal91_something (
\"
table
\"
)"
,
),
$this
->
_conn
->
getDatabasePlatform
()
->
getCreateTableSQL
(
$table
)
...
...
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