From 21d858596d84d2c010e8cd6943c9f9f8da1ced2b Mon Sep 17 00:00:00 2001 From: tshit11 Date: Fri, 30 Apr 2021 11:32:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dmysql=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E7=9A=84bug=20=E6=B7=BB=E5=8A=A0=E5=88=86?= =?UTF-8?q?=E7=B1=BB=E4=BF=A1=E6=81=AF=20=E4=BF=AE=E5=A4=8D=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E7=9B=AE=E5=BD=95=E8=B7=B3=E8=BD=AC=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DBChm/CHM/ChmHtmlHelper.cs | 4 ++-- DBChm/config.txt | 10 ---------- MJTop.Data/DatabaseInfo/MySqlDBInfo.cs | 4 ++-- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/DBChm/CHM/ChmHtmlHelper.cs b/DBChm/CHM/ChmHtmlHelper.cs index 66c9ca1..b568540 100644 --- a/DBChm/CHM/ChmHtmlHelper.cs +++ b/DBChm/CHM/ChmHtmlHelper.cs @@ -396,7 +396,7 @@ public static void CreateHtml(List tables, string tabs code.AppendLine("
{0}
{1}{2}".FormatString( tab.TableName, "" + tab.Comment + "", - "返回目录")); + "返回目录")); code.AppendLine(" "); @@ -537,7 +537,7 @@ public static void CreateHtml(Dictionary dictTabs, string tab code.AppendLine("
{0}
{1}{2}".FormatString( tabInfo.TableName, "" + tabInfo.TabComment + "", - "返回目录")); + "返回目录")); code.AppendLine(" "); diff --git a/DBChm/config.txt b/DBChm/config.txt index a1ec526..56dc76f 100644 --- a/DBChm/config.txt +++ b/DBChm/config.txt @@ -48,13 +48,3 @@ warden=区长 weikedao=威客道 weixin=微信公众号 yimeiduo=一美多 -risk=风控 -treasure=夺宝 -seckill=秒杀 -distributor=分销 -groups=拼团 -consult=商品咨询 -evaluate=评价 -index=首页 -purchase=采购 -special=专题 diff --git a/MJTop.Data/DatabaseInfo/MySqlDBInfo.cs b/MJTop.Data/DatabaseInfo/MySqlDBInfo.cs index 8c7286a..d4514f0 100644 --- a/MJTop.Data/DatabaseInfo/MySqlDBInfo.cs +++ b/MJTop.Data/DatabaseInfo/MySqlDBInfo.cs @@ -102,7 +102,7 @@ public bool Refresh() string dbSql = "SELECT SCHEMA_NAME FROM information_schema.SCHEMATA order by SCHEMA_NAME asc"; - string strSql = string.Format("SELECT table_name name,TABLE_COMMENT value FROM INFORMATION_SCHEMA.TABLES WHERE lower(table_type)='base table' and table_schema = '{0}' order by table_name asc ", DBName); + string strSql = string.Format("SELECT table_name name,TRIM(TABLE_COMMENT) value FROM INFORMATION_SCHEMA.TABLES WHERE lower(table_type)='base table' and table_schema = '{0}' order by table_name asc ", DBName); string viewSql = string.Format("SELECT table_name,VIEW_DEFINITION FROM information_schema.views where TABLE_SCHEMA='{0}' order by table_name asc", DBName); string procSql = string.Format("SELECT ROUTINE_NAME,ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA='{0}' AND ROUTINE_TYPE='PROCEDURE' ORDER BY ROUTINE_NAME ASC", DBName); @@ -135,7 +135,7 @@ public bool Refresh() //strSql = "SHOW FULL COLUMNS FROM " + tableName; - strSql = @"select ORDINAL_POSITION as Colorder,Column_Name as ColumnName,data_type as TypeName,COLUMN_COMMENT as DeText, + strSql = @"select ORDINAL_POSITION as Colorder,Column_Name as ColumnName,data_type as TypeName,TRIM(COLUMN_COMMENT) as DeText, (case when data_type = 'float' or data_type = 'double' or data_type = 'decimal' then NUMERIC_PRECISION else CHARACTER_MAXIMUM_LENGTH end ) as length, (case when data_type = 'int' or data_type = 'bigint' then null else NUMERIC_SCALE end) as Scale,( case when EXTRA='auto_increment' then 1 else 0 end) as IsIdentity,(case when COLUMN_KEY='PRI' then 1 else 0 end) as IsPK, (case when IS_NULLABLE = 'NO' then 0 else 1 end)as CanNull,COLUMN_DEFAULT as DefaultVal