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
c6eaae53
Commit
c6eaae53
authored
Jan 28, 2015
by
Marco Pivetta
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'hotfix/#773-fix-quoted-identifiers-in-database-creation-for-sqlanywhere' into 2.5
parents
67c4701e
06756d22
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
4 deletions
+20
-4
SQLAnywherePlatform.php
lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php
+12
-4
SQLAnywherePlatformTest.php
...Doctrine/Tests/DBAL/Platforms/SQLAnywherePlatformTest.php
+8
-0
No files found.
lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php
View file @
c6eaae53
...
...
@@ -405,7 +405,9 @@ class SQLAnywherePlatform extends AbstractPlatform
*/
public
function
getCreateDatabaseSQL
(
$database
)
{
return
"CREATE DATABASE '
$database
'"
;
$database
=
new
Identifier
(
$database
);
return
"CREATE DATABASE '"
.
$database
->
getName
()
.
"'"
;
}
/**
...
...
@@ -537,7 +539,9 @@ class SQLAnywherePlatform extends AbstractPlatform
*/
public
function
getDropDatabaseSQL
(
$database
)
{
return
"DROP DATABASE '
$database
'"
;
$database
=
new
Identifier
(
$database
);
return
"DROP DATABASE '"
.
$database
->
getName
()
.
"'"
;
}
/**
...
...
@@ -1025,7 +1029,9 @@ class SQLAnywherePlatform extends AbstractPlatform
*/
public
function
getStartDatabaseSQL
(
$database
)
{
return
"START DATABASE '
$database
' AUTOSTOP OFF"
;
$database
=
new
Identifier
(
$database
);
return
"START DATABASE '"
.
$database
->
getName
()
.
"' AUTOSTOP OFF"
;
}
/**
...
...
@@ -1042,7 +1048,9 @@ class SQLAnywherePlatform extends AbstractPlatform
*/
public
function
getStopDatabaseSQL
(
$database
)
{
return
'STOP DATABASE "'
.
$database
.
'" UNCONDITIONALLY'
;
$database
=
new
Identifier
(
$database
);
return
'STOP DATABASE "'
.
$database
->
getName
()
.
'" UNCONDITIONALLY'
;
}
/**
...
...
tests/Doctrine/Tests/DBAL/Platforms/SQLAnywherePlatformTest.php
View file @
c6eaae53
...
...
@@ -301,10 +301,18 @@ class SQLAnywherePlatformTest extends AbstractPlatformTestCase
public
function
testGeneratesDDLSnippets
()
{
$this
->
assertEquals
(
"CREATE DATABASE 'foobar'"
,
$this
->
_platform
->
getCreateDatabaseSQL
(
'foobar'
));
$this
->
assertEquals
(
"CREATE DATABASE 'foobar'"
,
$this
->
_platform
->
getCreateDatabaseSQL
(
'"foobar"'
));
$this
->
assertEquals
(
"CREATE DATABASE 'create'"
,
$this
->
_platform
->
getCreateDatabaseSQL
(
'create'
));
$this
->
assertEquals
(
"DROP DATABASE 'foobar'"
,
$this
->
_platform
->
getDropDatabaseSQL
(
'foobar'
));
$this
->
assertEquals
(
"DROP DATABASE 'foobar'"
,
$this
->
_platform
->
getDropDatabaseSQL
(
'"foobar"'
));
$this
->
assertEquals
(
"DROP DATABASE 'create'"
,
$this
->
_platform
->
getDropDatabaseSQL
(
'create'
));
$this
->
assertEquals
(
'CREATE GLOBAL TEMPORARY TABLE'
,
$this
->
_platform
->
getCreateTemporaryTableSnippetSQL
());
$this
->
assertEquals
(
"START DATABASE 'foobar' AUTOSTOP OFF"
,
$this
->
_platform
->
getStartDatabaseSQL
(
'foobar'
));
$this
->
assertEquals
(
"START DATABASE 'foobar' AUTOSTOP OFF"
,
$this
->
_platform
->
getStartDatabaseSQL
(
'"foobar"'
));
$this
->
assertEquals
(
"START DATABASE 'create' AUTOSTOP OFF"
,
$this
->
_platform
->
getStartDatabaseSQL
(
'create'
));
$this
->
assertEquals
(
'STOP DATABASE "foobar" UNCONDITIONALLY'
,
$this
->
_platform
->
getStopDatabaseSQL
(
'foobar'
));
$this
->
assertEquals
(
'STOP DATABASE "foobar" UNCONDITIONALLY'
,
$this
->
_platform
->
getStopDatabaseSQL
(
'"foobar"'
));
$this
->
assertEquals
(
'STOP DATABASE "create" UNCONDITIONALLY'
,
$this
->
_platform
->
getStopDatabaseSQL
(
'create'
));
$this
->
assertEquals
(
'TRUNCATE TABLE foobar'
,
$this
->
_platform
->
getTruncateTableSQL
(
'foobar'
));
$this
->
assertEquals
(
'TRUNCATE TABLE foobar'
,
$this
->
_platform
->
getTruncateTableSQL
(
'foobar'
),
true
);
...
...
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