Browse Source

Sqlite SqlFunc.DataIsSame Bug

pull/12/MERGE
sunkaixuan 6 years ago
parent
commit
f05edfb112
  1. 2
      Src/Asp.Net/SqlSugar/Realization/Sqlite/SqlBuilder/SqliteExpressionContext.cs
  2. 2
      Src/Asp.Net/SqliteTest/Config.cs
  3. BIN
      Src/Asp.Net/SqliteTest/DataBase/SqlSugar4xTest.sqlite
  4. 2
      Src/Asp.Net/SqliteTest/UnitTest/ExpressionTest/Method.cs

2
Src/Asp.Net/SqlSugar/Realization/Sqlite/SqlBuilder/SqliteExpressionContext.cs

@ -157,7 +157,7 @@ namespace SqlSugar
var parameter = model.Args[0].MemberName; var parameter = model.Args[0].MemberName;
var parameter2 = model.Args[1].MemberName; var parameter2 = model.Args[1].MemberName;
int time = 1; int time = 1;
return string.Format(" Cast((JulianDay({0}) - JulianDay({1})) *{2} As INTEGER)", parameter, parameter2, time); return string.Format(" Cast((JulianDay({0}) - JulianDay({1})) *{2} As INTEGER)=0 ", parameter, parameter2, time);
} }
public override string DateIsSameByType(MethodCallExpressionModel model) public override string DateIsSameByType(MethodCallExpressionModel model)
{ {

2
Src/Asp.Net/SqliteTest/Config.cs

@ -8,6 +8,6 @@ namespace OrmTest
{ {
public class Config public class Config
{ {
public static string ConnectionString = @"DataSource=D:\MyGit\SqlSugar\Src\Asp.Net\SqliteTest\DataBase\SqlSugar4xTest.sqlite"; public static string ConnectionString = @"DataSource=F:\MyOpenSource\SqlSugar4.XNew\SqlSugar\Src\Asp.Net\SqliteTest\DataBase\SqlSugar4xTest.sqlite";
} }
} }

BIN
Src/Asp.Net/SqliteTest/DataBase/SqlSugar4xTest.sqlite

Binary file not shown.

2
Src/Asp.Net/SqliteTest/UnitTest/ExpressionTest/Method.cs

@ -356,7 +356,7 @@ namespace OrmTest.UnitTest
expContext.Resolve(exp, ResolveExpressType.WhereSingle); expContext.Resolve(exp, ResolveExpressType.WhereSingle);
var value = expContext.Result.GetString(); var value = expContext.Result.GetString();
var pars = expContext.Parameters; var pars = expContext.Parameters;
base.Check(value, pars, " Cast((JulianDay(@MethodConst0) - JulianDay(@MethodConst1)) *1 As INTEGER)", new List<SugarParameter>() { base.Check(value, pars, " Cast((JulianDay(@MethodConst0) - JulianDay(@MethodConst1)) *1 As INTEGER)=0 ", new List<SugarParameter>() {
new SugarParameter("@MethodConst0",x2),new SugarParameter("@MethodConst1",x2) new SugarParameter("@MethodConst0",x2),new SugarParameter("@MethodConst1",x2)
}, "DateIsSameDay error"); }, "DateIsSameDay error");
} }

Loading…
Cancel
Save