Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
310
Merge Requests
310
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
488fee8c
Commit
488fee8c
authored
Aug 24, 2009
by
Dries
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Patch
#496500
by chx: rollback.
parent
c95c99f7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
27 deletions
+8
-27
includes/database/database.inc
includes/database/database.inc
+0
-24
includes/database/pgsql/database.inc
includes/database/pgsql/database.inc
+0
-2
includes/database/query.inc
includes/database/query.inc
+8
-1
No files found.
includes/database/database.inc
View file @
488fee8c
...
...
@@ -316,13 +316,6 @@ abstract class DatabaseConnection extends PDO {
*/
protected
$schema
=
NULL
;
/**
* A unique number used for dynamic placeholders.
*
* It gets reset after every executed query.
*/
protected
$nextPlaceholder
=
1
;
function
__construct
(
$dsn
,
$username
,
$password
,
$driver_options
=
array
())
{
// Because the other methods don't seem to work right.
$driver_options
[
PDO
::
ATTR_ERRMODE
]
=
PDO
::
ERRMODE_EXCEPTION
;
...
...
@@ -336,20 +329,6 @@ function __construct($dsn, $username, $password, $driver_options = array()) {
}
}
/**
* Reset the next placeholder number back to 1.
*/
public
function
resetPlaceholder
()
{
$this
->
nextPlaceholder
=
1
;
}
/**
* Get the current unique placeholder number and increment it.
*/
public
function
getNextPlaceholder
()
{
return
$this
->
nextPlaceholder
++
;
}
/**
* Return the default query options for any given query.
*
...
...
@@ -588,9 +567,6 @@ public function query($query, array $args = array(), $options = array()) {
$stmt
->
execute
(
$args
,
$options
);
}
// Reset the placeholder numbering.
$this
->
resetPlaceholder
();
// Depending on the type of query we may need to return a different value.
// See DatabaseConnection::defaultOptions() for a description of each value.
switch
(
$options
[
'return'
])
{
...
...
includes/database/pgsql/database.inc
View file @
488fee8c
...
...
@@ -68,8 +68,6 @@ public function query($query, array $args = array(), $options = array()) {
$stmt
=
$this
->
prepareQuery
(
$query
,
!
$modified
);
$stmt
->
execute
(
$args
,
$options
);
}
// Reset the placeholder numbering.
$this
->
resetPlaceholder
();
switch
(
$options
[
'return'
])
{
case
Database
::
RETURN_STATEMENT
:
...
...
includes/database/query.inc
View file @
488fee8c
...
...
@@ -1161,6 +1161,13 @@ public function arguments() {
}
public
function
compile
(
DatabaseConnection
$connection
)
{
// This value is static, so it will increment across the entire request
// rather than just this query. That is OK, because we only need definitive
// placeholder names if we're going to use them for _alter hooks, which we
// are not. The alter hook would intervene before compilation.
// $next_placeholder does not use drupal_static as it increments and should
// never be reset during a request.
static
$next_placeholder
=
1
;
if
(
$this
->
changed
)
{
...
...
@@ -1213,7 +1220,7 @@ public function compile(DatabaseConnection $connection) {
}
if
(
$operator
[
'use_value'
])
{
foreach
(
$condition
[
'value'
]
as
$value
)
{
$placeholder
=
':db_condition_placeholder_'
.
$
connection
->
getNextPlaceholder
()
;
$placeholder
=
':db_condition_placeholder_'
.
$
next_placeholder
++
;
$arguments
[
$placeholder
]
=
$value
;
$placeholders
[]
=
$placeholder
;
}
...
...
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