Lith 4 달 전
부모
커밋
be0bf13c5e

+ 1 - 1
src/Vitorm.ClickHouse/DataProvider.cs

@@ -1,7 +1,7 @@
 using System.Collections.Generic;
 
-using Vitorm.DataProvider;
 using Vitorm.Sql;
+using Vitorm.Sql.DataProvider;
 
 namespace Vitorm.ClickHouse
 {

+ 1 - 0
src/Vitorm.ClickHouse/DbContext_Extensions_UseClickHouse.cs

@@ -6,6 +6,7 @@ using Vit.Linq;
 
 using Vitorm.ClickHouse;
 using Vitorm.Sql;
+using Vitorm.Sql.SqlExecute;
 
 namespace Vitorm
 {

+ 2 - 0
test/Vitorm.ClickHouse.MsTest/ExpressionNodesTest/ExpressionTester.Model.cs

@@ -3,6 +3,8 @@
 
     public abstract partial class ExpressionTester
     {
+        static bool canCalculate = true;
+
         [System.ComponentModel.DataAnnotations.Schema.Table("User2")]
         public class User : Vitorm.MsTest.User
         {

+ 11 - 4
test/Vitorm.ClickHouse.MsTest/ExpressionNodesTest/ExpressionTester.cs

@@ -7,10 +7,8 @@ using Vit.Linq;
 
 namespace Vit.Linq.ExpressionNodes.ExpressionNodesTest
 {
-
     public abstract partial class ExpressionTester
     {
-
         public static List<User> Test(IQueryable<User> query, Expression<Func<User, bool>> predicate)
         {
             var expected = GetSourceData().AsQueryable().Where(predicate).ToList();
@@ -33,12 +31,12 @@ namespace Vit.Linq.ExpressionNodes.ExpressionNodesTest
         }
 
 
-
         public static void TestQueryable(IQueryable<User> query)
         {
             Expression<Func<User, bool>> predicate;
 
             #region #0 Add, An addition operation, such as a + b, without overflow checking, for numeric operands.
+            if (canCalculate)
             {
                 predicate = u => u.id + 1 == 6;
                 var rows = Test(query, predicate);
@@ -54,13 +52,15 @@ namespace Vit.Linq.ExpressionNodes.ExpressionNodesTest
             #endregion
 
             #region #7 Coalesce, A node that represents a null coalescing operation, such as (a ?? b)
+            if (canCalculate)
             {
                 predicate = u => (u.fatherId ?? u.id) == 5;
                 var rows = Test(query, predicate);
             }
             #endregion
 
-            #region #8 Conditional, A conditional operation, such as a > b ? a : b 
+            #region #8 Conditional, A conditional operation, such as a > b ? a : b
+            if (canCalculate)
             {
                 predicate = u => (u.id == 2 ? 1 : 0) == 1;
                 var rows = Test(query, predicate);
@@ -75,6 +75,7 @@ namespace Vit.Linq.ExpressionNodes.ExpressionNodesTest
             #endregion
 
             #region #10 Convert, A cast or conversion operation, such as (SampleType)obj
+            if (canCalculate)
             {
                 predicate = u => ((double)u.id) <= 2.0;
                 var rows = Test(query, predicate);
@@ -82,6 +83,7 @@ namespace Vit.Linq.ExpressionNodes.ExpressionNodesTest
             #endregion
 
             #region #12 Divide, A division operation, such as (a / b), for numeric operands.
+            if (canCalculate)
             {
                 predicate = u => u.id / 10.0 == 10.0;
                 var rows = Test(query, predicate);
@@ -135,6 +137,7 @@ namespace Vit.Linq.ExpressionNodes.ExpressionNodesTest
             #endregion
 
             #region #25 Modulo, An arithmetic remainder operation, such as (a % b)
+            if (canCalculate)
             {
                 predicate = u => (u.id % 10) == 0;
                 var rows = Test(query, predicate);
@@ -142,6 +145,7 @@ namespace Vit.Linq.ExpressionNodes.ExpressionNodesTest
             #endregion
 
             #region #26 Multiply, A multiplication operation, such as (a * b), without overflow checking, for numeric operands
+            if (canCalculate)
             {
                 predicate = u => u.id * 10 == 20;
                 var rows = Test(query, predicate);
@@ -149,6 +153,7 @@ namespace Vit.Linq.ExpressionNodes.ExpressionNodesTest
             #endregion
 
             #region #28 Negate, An arithmetic negation operation, such as (-a). The object a should not be modified in place.
+            if (canCalculate)
             {
                 predicate = u => -u.id == -2;
                 var rows = Test(query, predicate);
@@ -181,6 +186,7 @@ namespace Vit.Linq.ExpressionNodes.ExpressionNodesTest
             #endregion
 
             #region #42 Subtract,  A subtraction operation, such as (a - b), without overflow checking
+            if (canCalculate)
             {
                 predicate = u => u.id - 2 == 9;
                 var rows = Test(query, predicate);
@@ -189,6 +195,7 @@ namespace Vit.Linq.ExpressionNodes.ExpressionNodesTest
 
 
             #region Test the priority of mathematical calculations
+            if (canCalculate)
             {
                 predicate = u => 10 + u.id * 10 == 110;
                 var rows = Test(query, predicate);