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
69d563f7
Commit
69d563f7
authored
Jan 13, 2015
by
Steve Müller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix quoted identifiers for database creation SQL on SQL Anywhere
parent
06e64e27
Changes
2
Hide 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 @
69d563f7
...
@@ -405,7 +405,9 @@ class SQLAnywherePlatform extends AbstractPlatform
...
@@ -405,7 +405,9 @@ class SQLAnywherePlatform extends AbstractPlatform
*/
*/
public
function
getCreateDatabaseSQL
(
$database
)
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
...
@@ -537,7 +539,9 @@ class SQLAnywherePlatform extends AbstractPlatform
*/
*/
public
function
getDropDatabaseSQL
(
$database
)
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
...
@@ -1025,7 +1029,9 @@ class SQLAnywherePlatform extends AbstractPlatform
*/
*/
public
function
getStartDatabaseSQL
(
$database
)
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
...
@@ -1042,7 +1048,9 @@ class SQLAnywherePlatform extends AbstractPlatform
*/
*/
public
function
getStopDatabaseSQL
(
$database
)
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 @
69d563f7
...
@@ -301,10 +301,18 @@ class SQLAnywherePlatformTest extends AbstractPlatformTestCase
...
@@ -301,10 +301,18 @@ class SQLAnywherePlatformTest extends AbstractPlatformTestCase
public
function
testGeneratesDDLSnippets
()
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 '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 '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
(
'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 '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 "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'
));
$this
->
assertEquals
(
'TRUNCATE TABLE foobar'
,
$this
->
_platform
->
getTruncateTableSQL
(
'foobar'
),
true
);
$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