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
45606dc9
Commit
45606dc9
authored
Jun 15, 2011
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'DDC-1202' into 2.0.x
parents
999e9aec
39678614
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
129 additions
and
113 deletions
+129
-113
MsSqlPlatform.php
lib/Doctrine/DBAL/Platforms/MsSqlPlatform.php
+129
-113
No files found.
lib/Doctrine/DBAL/Platforms/MsSqlPlatform.php
View file @
45606dc9
...
...
@@ -22,7 +22,8 @@ namespace Doctrine\DBAL\Platforms;
use
Doctrine\DBAL\Schema\TableDiff
;
use
Doctrine\DBAL\DBALException
;
use
Doctrine\DBAL\Schema\Index
,
Doctrine\DBAL\Schema\Table
;
use
Doctrine\DBAL\Schema\Index
,
Doctrine\DBAL\Schema\Table
;
/**
* The MsSqlPlatform provides the behavior, features and SQL dialect of the
...
...
@@ -441,11 +442,11 @@ class MsSqlPlatform extends AbstractPlatform
$pattern
=
"'%[^' +
$char
+ ']%'"
;
if
(
$pos
==
self
::
TRIM_LEADING
)
{
return
'stuff('
.
$str
.
', 1, patindex('
.
$pattern
.
', '
.
$str
.
') - 1, null)'
;
return
'stuff('
.
$str
.
', 1, patindex('
.
$pattern
.
', '
.
$str
.
') - 1, null)'
;
}
else
if
(
$pos
==
self
::
TRIM_TRAILING
)
{
return
'reverse(stuff(reverse('
.
$str
.
'), 1, patindex('
.
$pattern
.
', reverse('
.
$str
.
')) - 1, null))'
;
return
'reverse(stuff(reverse('
.
$str
.
'), 1, patindex('
.
$pattern
.
', reverse('
.
$str
.
')) - 1, null))'
;
}
else
{
return
'reverse(stuff(reverse(stuff('
.
$str
.
', 1, patindex('
.
$pattern
.
', '
.
$str
.
') - 1, null)), 1, patindex('
.
$pattern
.
', reverse(stuff('
.
$str
.
', 1, patindex('
.
$pattern
.
', '
.
$str
.
') - 1, null))) - 1, null))'
;
return
'reverse(stuff(reverse(stuff('
.
$str
.
', 1, patindex('
.
$pattern
.
', '
.
$str
.
') - 1, null)), 1, patindex('
.
$pattern
.
', reverse(stuff('
.
$str
.
', 1, patindex('
.
$pattern
.
', '
.
$str
.
') - 1, null))) - 1, null))'
;
}
}
}
...
...
@@ -761,8 +762,7 @@ class MsSqlPlatform extends AbstractPlatform
return
$fromClause
.
' WITH (tablockx)'
;
}
else
if
(
$lockMode
==
\Doctrine\DBAL\LockMode
::
PESSIMISTIC_WRITE
)
{
return
$fromClause
.
' WITH (tablockx)'
;
}
else
{
}
else
{
return
$fromClause
;
}
}
...
...
@@ -774,4 +774,20 @@ class MsSqlPlatform extends AbstractPlatform
{
return
' '
;
}
/**
* Quotes a string so that it can be safely used as a table or column name,
* even if it is a reserved word of the platform.
*
* NOTE: Just because you CAN use quoted identifiers doesn't mean
* you SHOULD use them. In general, they end up causing way more
* problems than they solve.
*
* @param string $str identifier name to be quoted
* @return string quoted identifier string
*/
public
function
quoteIdentifier
(
$str
)
{
return
"["
.
$str
.
"]"
;
}
}
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