From e15e8644b3dbe0bcaea0aa9937486d979fb53c5c Mon Sep 17 00:00:00 2001 From: Marcus <47229647+Marcus-Nightingale@users.noreply.github.com> Date: Wed, 24 Sep 2025 10:16:02 +0100 Subject: [PATCH] Update clickhouse.php --- plugins/drivers/clickhouse.php | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/plugins/drivers/clickhouse.php b/plugins/drivers/clickhouse.php index 7fa1d5fc8..7c335b134 100644 --- a/plugins/drivers/clickhouse.php +++ b/plugins/drivers/clickhouse.php @@ -272,17 +272,20 @@ function count_tables($databases) { return array(); } - function table_status($name = "", $fast = false) { - $return = array(); - $tables = get_rows("SELECT name, engine FROM system.tables WHERE database = " . q(connection()->_db)); - foreach ($tables as $table) { - $return[$table['name']] = array( - 'Name' => $table['name'], - 'Engine' => $table['engine'], - ); - } - return $return; - } + function table_status($name = "", $fast = false) { + $return = array(); + $query = "SELECT name, engine FROM system.tables WHERE database = " . q(connection()->_db); + if ($name !== "") { + $query .= " AND name = " . q($name); + } + foreach (get_rows($query) as $table) { + $return[$table['name']] = array( + 'Name' => $table['name'], + 'Engine' => $table['engine'], + ); + } + return $return; + } function is_view($table_status) { return false;