1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-08 23:57:29 +02:00

New plugin: Specify query timeout

This commit is contained in:
Jakub Vrana
2025-06-28 22:11:03 +02:00
parent c9a52cd28c
commit 6dec0d63b0
10 changed files with 70 additions and 9 deletions

View File

@@ -340,7 +340,7 @@ if (!defined('Adminer\DRIVER')) {
function partitionsInfo(string $table): array {
$from = "FROM information_schema.PARTITIONS WHERE TABLE_SCHEMA = " . q(DB) . " AND TABLE_NAME = " . q($table);
$result = connection()->query("SELECT PARTITION_METHOD, PARTITION_EXPRESSION, PARTITION_ORDINAL_POSITION $from ORDER BY PARTITION_ORDINAL_POSITION DESC LIMIT 1");
$result = $this->conn->query("SELECT PARTITION_METHOD, PARTITION_EXPRESSION, PARTITION_ORDINAL_POSITION $from ORDER BY PARTITION_ORDINAL_POSITION DESC LIMIT 1");
$return = array();
list($return["partition_by"], $return["partition"], $return["partitions"]) = $result->fetch_row();
$partitions = get_key_vals("SELECT PARTITION_NAME, PARTITION_DESCRIPTION $from AND PARTITION_NAME != '' ORDER BY PARTITION_ORDINAL_POSITION");

View File

@@ -60,6 +60,10 @@ if (isset($_GET["oracle"])) {
}
return $return;
}
function timeout(int $ms): bool {
return oci_set_call_timeout($this->link, $ms);
}
}
class Result {