mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-07-17 10:41:56 +08:00
code optimization
This commit is contained in:
parent
f7b87a78d9
commit
4e05603cea
@ -481,7 +481,12 @@ namespace SqlSugar
|
|||||||
if (this.IsSqlQuery && (Skip == null && Take == null))
|
if (this.IsSqlQuery && (Skip == null && Take == null))
|
||||||
{
|
{
|
||||||
var old = result;
|
var old = result;
|
||||||
result = System.Text.RegularExpressions.Regex.Match(result, @"^SELECT .* FROM \(((.|\n|\r)*)\) t $").Groups[1].Value;
|
var regex = @"^SELECT .* FROM \(((.|\n|\r)*)\) t $";
|
||||||
|
if (this.Context.CurrentConnectionConfig.DbType == DbType.MySql)
|
||||||
|
{
|
||||||
|
result = result.Substring(0,result.Length-1);
|
||||||
|
}
|
||||||
|
result = System.Text.RegularExpressions.Regex.Match(result,regex).Groups[1].Value;
|
||||||
if (string.IsNullOrEmpty(result))
|
if (string.IsNullOrEmpty(result))
|
||||||
{
|
{
|
||||||
result = old;
|
result = old;
|
||||||
|
Loading…
Reference in New Issue
Block a user