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
220
Merge Requests
220
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
df7bcec7
Commit
df7bcec7
authored
Sep 03, 2008
by
webchick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#302395
by chx: Minor DBTNG clean-up.
parent
c17a5e70
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
includes/database/database.inc
includes/database/database.inc
+3
-3
includes/database/schema.inc
includes/database/schema.inc
+8
-8
No files found.
includes/database/database.inc
View file @
df7bcec7
...
...
@@ -250,7 +250,7 @@ protected function prefixTables($sql) {
/**
* Prepare a query string and return the prepared statement.
*
*
* This method statically caches prepared statements, reusing them when
* possible. It also prefixes tables names enclosed in curly-braces.
*
...
...
@@ -712,7 +712,7 @@ abstract class Database {
* TRUE if there is at least one database connection established, FALSE otherwise.
*/
final
public
static
function
isActiveConnection
()
{
return
!
empty
(
self
::
$
connections
);
return
!
empty
(
self
::
$
activeKey
)
&&
!
empty
(
self
::
$connections
)
&&
!
empty
(
self
::
$connections
[
self
::
$activeKey
]
);
}
/**
...
...
@@ -1356,7 +1356,7 @@ function db_escape_table($table) {
* query: the SQL query executed, passed through check_plain()
*/
function
update_sql
(
$sql
)
{
$result
=
Database
::
getActiveConnection
()
->
query
(
$sql
/*, array(true)*/
);
$result
=
Database
::
getActiveConnection
()
->
query
(
$sql
);
return
array
(
'success'
=>
$result
!==
FALSE
,
'query'
=>
check_plain
(
$sql
));
}
...
...
includes/database/schema.inc
View file @
df7bcec7
...
...
@@ -117,29 +117,29 @@
*/
abstract
class
DatabaseSchema
{
protected
$connection
;
public
function
__construct
(
$connection
)
{
$this
->
connection
=
$connection
;
}
/**
* Check if a table exists.
*/
abstract
public
function
tableExists
(
$table
);
/**
* Check if a column exists in the given table.
*/
abstract
public
function
columnExists
(
$table
,
$column
);
/**
* This maps a generic data type in combination with its data size
* to the engine-specific data type.
*/
abstract
public
function
getFieldTypeMap
();
/**
* Rename a table.
*
...
...
@@ -161,7 +161,7 @@ public function __construct($connection) {
* The table to be dropped.
*/
abstract
public
function
dropTable
(
&
$ret
,
$table
);
/**
* Add a new field to a table.
*
...
...
@@ -380,7 +380,7 @@ public function createTable(&$ret, $name, $table) {
$ret
[]
=
update_sql
(
$statement
);
}
}
/**
* Return an array of field names from an array of key/index column specifiers.
*
...
...
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