Compare commits
2 Commits
a9fb4be5d1
...
28f0461113
Author | SHA1 | Date | |
---|---|---|---|
28f0461113 | |||
b1045def04 |
@ -528,8 +528,8 @@ WHERE
|
||||
var subsql = sql.Split(';');
|
||||
#region 处理
|
||||
// 正则表达式
|
||||
string pattern = @"(?<=ALTER\s+TABLE\s+`)[^`]+";
|
||||
string pattern2 = @"(?<=CREATE\s+TABLE\s+`)[^`]+";
|
||||
string pattern = @"(?i)\balter\s+table\s+[`']?([a-zA-Z0-9_]+)[`']?";
|
||||
string pattern2 = @"(?i)\bcreate\s+table\s+[`']?([a-zA-Z0-9_]+)[`']?";
|
||||
int patternType;//1是create,0是update
|
||||
foreach (var sqlstr in subsql)
|
||||
{
|
||||
@ -554,7 +554,7 @@ WHERE
|
||||
if (match.Length == 0 )
|
||||
{
|
||||
//无效的sql
|
||||
LogInfo(baseDirectory + logFileName, $"无法从{SQLFILENAME}.sql文件中解析出正确的create table 或 update table。确保是有效的sql。文本为 {sqlstr}");
|
||||
LogInfo(baseDirectory + logFileName, $"无法从{SQLFILENAME}文件中解析出正确的create table 或 update table。确保是有效的sql。文本为 {sqlstr}");
|
||||
continue;
|
||||
}
|
||||
var groupMatch = Regex.Matches(sqlstr, pattern);
|
||||
|
@ -20,7 +20,7 @@
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<OutputPath>..\..\..\..\IIS\SWS\UpgradeTool\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user