From b328bb1a2da76e35c3c8e41701a7f0869a73439a Mon Sep 17 00:00:00 2001 From: dailyccc <963922242@qq.com> Date: Tue, 13 Sep 2022 18:17:10 +0800 Subject: [PATCH] Repair ClickHuse DBFrist ExistsTable --- Providers/FreeSql.Provider.ClickHouse/ClickHouseDbFirst.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Providers/FreeSql.Provider.ClickHouse/ClickHouseDbFirst.cs b/Providers/FreeSql.Provider.ClickHouse/ClickHouseDbFirst.cs index 5c1b9da8..116c5b43 100644 --- a/Providers/FreeSql.Provider.ClickHouse/ClickHouseDbFirst.cs +++ b/Providers/FreeSql.Provider.ClickHouse/ClickHouseDbFirst.cs @@ -147,7 +147,7 @@ namespace FreeSql.ClickHouse tbname = new[] { database, tbname[0] }; } if (ignoreCase) tbname = tbname.Select(a => a.ToLower()).ToArray(); - var sql = $" SELECT 1 FROM information_schema.TABLES WHERE {(ignoreCase ? "lower(table_schema)" : "table_schema")} = {_commonUtils.FormatSql("{0}", tbname[0])} and {(ignoreCase ? "lower(table_name)" : "table_name")} = {_commonUtils.FormatSql("{0}", tbname[1])}"; + var sql = $" SELECT 1 FROM information_schema.tables WHERE {(ignoreCase ? "lower(table_schema)" : "table_schema")} = {_commonUtils.FormatSql("{0}", tbname[0])} and {(ignoreCase ? "lower(table_name)" : "table_name")} = {_commonUtils.FormatSql("{0}", tbname[1])}"; return string.Concat(_orm.Ado.ExecuteScalar(CommandType.Text, sql)) == "1"; }