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;