1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-11 17:14:07 +02:00

Fix type of select_db()

This commit is contained in:
Jakub Vrana
2025-03-31 11:08:37 +02:00
parent 366342985d
commit e6c0c8ab6b
11 changed files with 18 additions and 16 deletions

View File

@@ -53,7 +53,7 @@ if (isset($_GET["mssql"])) {
return ($unicode ? "N" : "") . "'" . str_replace("'", "''", $string) . "'";
}
function select_db(string $database): bool {
function select_db(string $database) {
return $this->query(use_sql($database));
}
@@ -159,7 +159,7 @@ if (isset($_GET["mssql"])) {
} else {
abstract class MssqlDb extends PdoDb {
function select_db(string $database): bool {
function select_db(string $database) {
// database selection is separated from the connection so dbname in DSN can't be used
return $this->query(use_sql($database));
}

View File

@@ -91,7 +91,7 @@ if (!defined('Adminer\DRIVER')) {
return "'" . mysql_real_escape_string($string, $this->link) . "'";
}
function select_db(string $database): bool {
function select_db(string $database) {
return mysql_select_db($database, $this->link);
}
@@ -186,7 +186,7 @@ if (!defined('Adminer\DRIVER')) {
return $this->query("SET NAMES $charset"); // charset in DSN is ignored before PHP 5.3.6
}
function select_db(string $database): bool {
function select_db(string $database) {
// database selection is separated from the connection so dbname in DSN can't be used
return $this->query("USE " . idf_escape($database));
}

View File

@@ -33,7 +33,7 @@ if (isset($_GET["oracle"])) {
return "'" . str_replace("'", "''", $string) . "'";
}
function select_db(string $database): bool {
function select_db(string $database) {
$this->_current_db = $database;
return true;
}
@@ -109,7 +109,7 @@ if (isset($_GET["oracle"])) {
return $this->dsn("oci:dbname=//$server;charset=AL32UTF8", $username, $password);
}
function select_db(string $database): bool {
function select_db(string $database) {
$this->_current_db = $database;
return true;
}

View File

@@ -51,7 +51,7 @@ if (isset($_GET["pgsql"])) {
return ($field["type"] == "bytea" && $val !== null ? pg_unescape_bytea($val) : $val);
}
function select_db(string $database): bool {
function select_db(string $database) {
if ($database == adminer()->database()) {
return $this->database;
}
@@ -138,7 +138,7 @@ if (isset($_GET["pgsql"])) {
return $this->dsn($dsn, $username, $password);
}
function select_db(string $database): bool {
function select_db(string $database) {
return (adminer()->database() == $database);
}