#302395 by chx: Minor DBTNG clean-up.
parent
c17a5e70bc
commit
df7bcec717
|
@ -712,7 +712,7 @@ abstract class Database {
|
||||||
* TRUE if there is at least one database connection established, FALSE otherwise.
|
* TRUE if there is at least one database connection established, FALSE otherwise.
|
||||||
*/
|
*/
|
||||||
final public static function isActiveConnection() {
|
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()
|
* query: the SQL query executed, passed through check_plain()
|
||||||
*/
|
*/
|
||||||
function update_sql($sql) {
|
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));
|
return array('success' => $result !== FALSE, 'query' => check_plain($sql));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue