1331 references to SqlNodeType
System.Data.Linq (1331)
SqlClient\Common\SqlFactory.cs (33)
95
return Binary(
SqlNodeType
.And, left, right);
107
return Binary(
SqlNodeType
.Or, left, right);
114
result = Binary(
SqlNodeType
.Concat, expressions[i], result);
122
sum = Binary(
SqlNodeType
.Add, expressions[i], sum);
128
return Binary(
SqlNodeType
.Sub, first, second);
134
result = Binary(
SqlNodeType
.Mul, expressions[i], result);
140
return Binary(
SqlNodeType
.Div, first, second);
144
return Binary(
SqlNodeType
.Add, expr, ValueFromObject(second, false, expr.SourceExpression));
148
return Binary(
SqlNodeType
.Sub, expr, ValueFromObject(second, false, expr.SourceExpression));
152
return Binary(
SqlNodeType
.Mul, expr, ValueFromObject(second, false, expr.SourceExpression));
156
return Binary(
SqlNodeType
.Div, expr, ValueFromObject(second, false, expr.SourceExpression));
160
return Binary(
SqlNodeType
.Mod, expr, ValueFromObject(second, false, expr.SourceExpression));
184
return Unary(
SqlNodeType
.ClrLength, expr);
320
internal SqlUnary Unary(
SqlNodeType
nodeType, SqlExpression expression) {
328
internal SqlUnary Unary(
SqlNodeType
nodeType, SqlExpression expression, Expression sourceExpression) {
332
internal SqlUnary Unary(
SqlNodeType
nodeType, SqlExpression expression, MethodInfo method, Expression sourceExpression) {
336
if (nodeType ==
SqlNodeType
.Count) {
340
else if (nodeType ==
SqlNodeType
.LongCount) {
344
else if (nodeType ==
SqlNodeType
.ClrLength) {
365
return new SqlUnary(
SqlNodeType
.Convert, targetClrType, targetSqlType, expression, null, sourceExpression);
371
return new SqlUnary(
SqlNodeType
.ValueOf, valueType, expression.SqlType, expression, null, sourceExpression);
374
internal SqlBinary Binary(
SqlNodeType
nodeType, SqlExpression left, SqlExpression right) {
378
internal SqlBinary Binary(
SqlNodeType
nodeType, SqlExpression left, SqlExpression right, MethodInfo method) {
382
internal SqlBinary Binary(
SqlNodeType
nodeType, SqlExpression left, SqlExpression right, Type clrType) {
386
internal SqlBinary Binary(
SqlNodeType
nodeType, SqlExpression left, SqlExpression right, MethodInfo method, Type clrType) {
534
internal SqlSubSelect SubSelect(
SqlNodeType
nt, SqlSelect select) {
537
internal SqlSubSelect SubSelect(
SqlNodeType
nt, SqlSelect select, Type clrType) {
540
case
SqlNodeType
.ScalarSubSelect:
541
case
SqlNodeType
.Element:
545
case
SqlNodeType
.Multiset:
551
case
SqlNodeType
.Exists:
597
if (sel != null && sel.Selection != null && sel.Selection.NodeType !=
SqlNodeType
.OptionalValue) {
602
this.Unary(
SqlNodeType
.OuterJoinedValue,
SqlClient\Common\SqlNode.cs (116)
114
private
SqlNodeType
nodeType;
117
internal SqlNode(
SqlNodeType
nodeType, Expression sourceExpression) {
130
internal
SqlNodeType
NodeType {
153
internal SqlExpression(
SqlNodeType
nodeType, Type clrType, Expression sourceExpression)
174
if (this.NodeType ==
SqlNodeType
.Column) {
180
else if (this.NodeType ==
SqlNodeType
.ColumnRef) {
183
else if (this.NodeType ==
SqlNodeType
.OptionalValue) {
186
else if (this.NodeType ==
SqlNodeType
.Value ||
187
this.NodeType ==
SqlNodeType
.Parameter) {
201
internal SqlSimpleTypeExpression(
SqlNodeType
nodeType, Type clrType, ProviderType sqlType, Expression sourceExpression)
218
: base(
SqlNodeType
.DiscriminatorOf, clrType, sqlType, sourceExpression) {
236
: base(
SqlNodeType
.DiscriminatedType,
259
internal SqlStatement(
SqlNodeType
nodeType, Expression sourceExpression)
265
internal SqlSource(
SqlNodeType
nt, Expression sourceExpression)
285
: base(
SqlNodeType
.Select, sourceExpression) {
385
: base(
SqlNodeType
.Table, sourceExpression) {
428
internal SqlUserQuery(
SqlNodeType
nt, SqlExpression projection, IEnumerable<SqlExpression> args, Expression source)
436
: base(
SqlNodeType
.UserQuery, source) {
477
: base(
SqlNodeType
.StoredProcedureCall, projection, args, source) {
493
: base(
SqlNodeType
.UserRow, rowType.Type, sqlType, source) {
520
: base(
SqlNodeType
.UserColumn, clrType, sqlType, source) {
551
: base(
SqlNodeType
.Alias, node.SourceExpression) {
576
: base(
SqlNodeType
.AliasRef, GetClrType(alias.Node), alias.SourceExpression) {
636
: base(
SqlNodeType
.Join, sourceExpression) {
686
: base(
SqlNodeType
.Union, right.SourceExpression) {
744
: base(
SqlNodeType
.Nop, clrType, sqlType, sourceExpression) {
752
: base(
SqlNodeType
.Lift, type, sourceExpression) {
876
: base(
SqlNodeType
.RowNumber, clrType, sqlType, sourceExpression) {
890
internal SqlUnary(
SqlNodeType
nt, Type clrType, ProviderType sqlType, SqlExpression expr, Expression sourceExpression)
894
internal SqlUnary(
SqlNodeType
nt, Type clrType, ProviderType sqlType, SqlExpression expr, MethodInfo method, Expression sourceExpression)
897
case
SqlNodeType
.Not:
898
case
SqlNodeType
.Not2V:
899
case
SqlNodeType
.Negate:
900
case
SqlNodeType
.BitNot:
901
case
SqlNodeType
.IsNull:
902
case
SqlNodeType
.IsNotNull:
903
case
SqlNodeType
.Count:
904
case
SqlNodeType
.LongCount:
905
case
SqlNodeType
.Max:
906
case
SqlNodeType
.Min:
907
case
SqlNodeType
.Sum:
908
case
SqlNodeType
.Avg:
909
case
SqlNodeType
.Stddev:
910
case
SqlNodeType
.Convert:
911
case
SqlNodeType
.ValueOf:
912
case
SqlNodeType
.Treat:
913
case
SqlNodeType
.OuterJoinedValue:
914
case
SqlNodeType
.ClrLength:
926
if (value == null && (this.NodeType !=
SqlNodeType
.Count && this.NodeType !=
SqlNodeType
.LongCount))
943
internal SqlBinary(
SqlNodeType
nt, Type clrType, ProviderType sqlType, SqlExpression left, SqlExpression right)
947
internal SqlBinary(
SqlNodeType
nt, Type clrType, ProviderType sqlType, SqlExpression left, SqlExpression right, MethodInfo method)
950
case
SqlNodeType
.Add:
951
case
SqlNodeType
.Sub:
952
case
SqlNodeType
.Mul:
953
case
SqlNodeType
.Div:
954
case
SqlNodeType
.Mod:
955
case
SqlNodeType
.BitAnd:
956
case
SqlNodeType
.BitOr:
957
case
SqlNodeType
.BitXor:
958
case
SqlNodeType
.And:
959
case
SqlNodeType
.Or:
960
case
SqlNodeType
.GE:
961
case
SqlNodeType
.GT:
962
case
SqlNodeType
.LE:
963
case
SqlNodeType
.LT:
964
case
SqlNodeType
.EQ:
965
case
SqlNodeType
.NE:
966
case
SqlNodeType
.EQ2V:
967
case
SqlNodeType
.NE2V:
968
case
SqlNodeType
.Concat:
969
case
SqlNodeType
.Coalesce:
1008
: base(
SqlNodeType
.Between, clrType, sqlType, source) {
1035
:base(
SqlNodeType
.In, clrType, sqlType, sourceExpression) {
1060
: base(
SqlNodeType
.Like, clrType, sqlType, source) {
1153
: base(
SqlNodeType
.SearchedCase, clrType, sourceExpression) {
1197
: base(
SqlNodeType
.SimpleCase, clrType, sourceExpression) {
1241
: base(
SqlNodeType
.ClientCase, clrType, sourceExpression) {
1321
: base(
SqlNodeType
.TypeCase, clrType, sourceExpression) {
1388
: base(
SqlNodeType
.Value, clrType, sqlType, sourceExpression) {
1407
: base(
SqlNodeType
.Parameter, clrType, sqlType, sourceExpression) {
1430
: base(
SqlNodeType
.Variable, clrType, sqlType, sourceExpression) {
1446
: base(
SqlNodeType
.Member, clrType, sqlType, expr.SourceExpression) {
1479
: base(
SqlNodeType
.Column, clrType, sourceExpression) {
1547
: base(
SqlNodeType
.ColumnRef, col.ClrType, col.SourceExpression) {
1570
while (c.Expression != null && c.Expression.NodeType ==
SqlNodeType
.ColumnRef) {
1581
: base(
SqlNodeType
.Row, sourceExpression) {
1603
: base(
SqlNodeType
.MemberAssign, expr.SourceExpression) {
1629
: base(
SqlNodeType
.Grouping, clrType, sqlType, sourceExpression) {
1668
: base(
SqlNodeType
.New, metaType.Type, sqlType, sourceExpression) {
1733
: base(
SqlNodeType
.MethodCall, clrType, sqlType, sourceExpression) {
1766
: base(
SqlNodeType
.IncludeScope, sourceExpression) {
1779
: base(
SqlNodeType
.ClientArray, clrType, sqlType, sourceExpression) {
1799
: base(
SqlNodeType
.Link, clrType, sqlType, sourceExpression) {
1842
: base(
SqlNodeType
.ExprSet, clrType, sourceExpression) {
1870
internal SqlSubSelect(
SqlNodeType
nt , Type clrType, ProviderType sqlType , SqlSelect select)
1873
case
SqlNodeType
.Multiset:
1874
case
SqlNodeType
.ScalarSubSelect:
1875
case
SqlNodeType
.Element:
1876
case
SqlNodeType
.Exists:
1901
: base(
SqlNodeType
.ClientQuery, subquery.ClrType, subquery.SqlType, subquery.SourceExpression) {
1935
: base(
SqlNodeType
.JoinedCollection, clrType, sqlType, sourceExpression) {
1966
: base(
SqlNodeType
.Update, sourceExpression) {
1993
: base(
SqlNodeType
.Insert, sourceExpression) {
2039
: base(
SqlNodeType
.Delete, sourceExpression) {
2057
: base(
SqlNodeType
.Block, sourceExpression) {
2071
: base(
SqlNodeType
.Assign, sourceExpression) {
2103
: base(
SqlNodeType
.DoNotVisit, expr.ClrType, expr.SourceExpression) {
2123
: base(
SqlNodeType
.OptionalValue, value.ClrType, value.SqlType, value.SourceExpression) {
2154
: this(
SqlNodeType
.FunctionCall, clrType , sqlType, name, args, source) {
2157
internal SqlFunctionCall(
SqlNodeType
nodeType, Type clrType, ProviderType sqlType, string name , IEnumerable <SqlExpression> args , Expression source)
2181
: base(
SqlNodeType
.TableValuedFunctionCall, clrType , sqlType, name, args, source) {
2208
: base(
SqlNodeType
.SharedExpression, expr.ClrType, expr.SourceExpression) {
2233
: base(
SqlNodeType
.SharedExpressionRef, expr.ClrType, expr.SourceExpression) {
2250
: base(
SqlNodeType
.SimpleExpression, expr.ClrType, expr.SourceExpression) {
2274
base(
SqlNodeType
.ClientParameter, clrType, sqlType, sourceExpression) {
SqlClient\Common\SqlNodeTypeOperators.cs (105)
14
internal static bool IsPredicateUnaryOperator(this
SqlNodeType
nodeType) {
16
case
SqlNodeType
.Not:
17
case
SqlNodeType
.Not2V:
18
case
SqlNodeType
.IsNull:
19
case
SqlNodeType
.IsNotNull:
21
case
SqlNodeType
.Negate:
22
case
SqlNodeType
.BitNot:
23
case
SqlNodeType
.Count:
24
case
SqlNodeType
.LongCount:
25
case
SqlNodeType
.Max:
26
case
SqlNodeType
.Min:
27
case
SqlNodeType
.Sum:
28
case
SqlNodeType
.Avg:
29
case
SqlNodeType
.Stddev:
30
case
SqlNodeType
.Convert:
31
case
SqlNodeType
.ValueOf:
32
case
SqlNodeType
.OuterJoinedValue:
33
case
SqlNodeType
.ClrLength:
44
internal static bool IsUnaryOperatorExpectingPredicateOperand(this
SqlNodeType
nodeType) {
46
case
SqlNodeType
.Not:
47
case
SqlNodeType
.Not2V:
49
case
SqlNodeType
.IsNull:
50
case
SqlNodeType
.IsNotNull:
51
case
SqlNodeType
.Negate:
52
case
SqlNodeType
.BitNot:
53
case
SqlNodeType
.Count:
54
case
SqlNodeType
.LongCount:
55
case
SqlNodeType
.Max:
56
case
SqlNodeType
.Min:
57
case
SqlNodeType
.Sum:
58
case
SqlNodeType
.Avg:
59
case
SqlNodeType
.Stddev:
60
case
SqlNodeType
.Convert:
61
case
SqlNodeType
.ValueOf:
62
case
SqlNodeType
.OuterJoinedValue:
63
case
SqlNodeType
.ClrLength:
75
internal static bool IsPredicateBinaryOperator(this
SqlNodeType
nodeType) {
77
case
SqlNodeType
.GE:
78
case
SqlNodeType
.GT:
79
case
SqlNodeType
.LE:
80
case
SqlNodeType
.LT:
81
case
SqlNodeType
.EQ:
82
case
SqlNodeType
.NE:
83
case
SqlNodeType
.EQ2V:
84
case
SqlNodeType
.NE2V:
85
case
SqlNodeType
.And:
86
case
SqlNodeType
.Or:
88
case
SqlNodeType
.Add:
89
case
SqlNodeType
.Sub:
90
case
SqlNodeType
.Mul:
91
case
SqlNodeType
.Div:
92
case
SqlNodeType
.Mod:
93
case
SqlNodeType
.BitAnd:
94
case
SqlNodeType
.BitOr:
95
case
SqlNodeType
.BitXor:
96
case
SqlNodeType
.Concat:
97
case
SqlNodeType
.Coalesce:
107
internal static bool IsComparisonOperator(this
SqlNodeType
nodeType)
111
case
SqlNodeType
.GE:
112
case
SqlNodeType
.GT:
113
case
SqlNodeType
.LE:
114
case
SqlNodeType
.LT:
115
case
SqlNodeType
.EQ:
116
case
SqlNodeType
.NE:
117
case
SqlNodeType
.EQ2V:
118
case
SqlNodeType
.NE2V:
120
case
SqlNodeType
.And:
121
case
SqlNodeType
.Or:
122
case
SqlNodeType
.Add:
123
case
SqlNodeType
.Sub:
124
case
SqlNodeType
.Mul:
125
case
SqlNodeType
.Div:
126
case
SqlNodeType
.Mod:
127
case
SqlNodeType
.BitAnd:
128
case
SqlNodeType
.BitOr:
129
case
SqlNodeType
.BitXor:
130
case
SqlNodeType
.Concat:
131
case
SqlNodeType
.Coalesce:
143
internal static bool IsBinaryOperatorExpectingPredicateOperands(this
SqlNodeType
nodeType) {
145
case
SqlNodeType
.And:
146
case
SqlNodeType
.Or:
148
case
SqlNodeType
.EQ:
149
case
SqlNodeType
.EQ2V:
150
case
SqlNodeType
.GE:
151
case
SqlNodeType
.GT:
152
case
SqlNodeType
.LE:
153
case
SqlNodeType
.LT:
154
case
SqlNodeType
.NE:
155
case
SqlNodeType
.NE2V:
156
case
SqlNodeType
.Add:
157
case
SqlNodeType
.Sub:
158
case
SqlNodeType
.Mul:
159
case
SqlNodeType
.Div:
160
case
SqlNodeType
.Mod:
161
case
SqlNodeType
.BitAnd:
162
case
SqlNodeType
.BitOr:
163
case
SqlNodeType
.BitXor:
164
case
SqlNodeType
.Concat:
165
case
SqlNodeType
.Coalesce:
178
case
SqlNodeType
.Link:
179
case
SqlNodeType
.Element:
180
case
SqlNodeType
.Multiset:
181
case
SqlNodeType
.ClientQuery:
182
case
SqlNodeType
.TypeCase:
183
case
SqlNodeType
.New:
SqlClient\Common\SqlVisitor.cs (103)
26
case
SqlNodeType
.Not:
27
case
SqlNodeType
.Not2V:
28
case
SqlNodeType
.Negate:
29
case
SqlNodeType
.BitNot:
30
case
SqlNodeType
.IsNull:
31
case
SqlNodeType
.IsNotNull:
32
case
SqlNodeType
.Count:
33
case
SqlNodeType
.LongCount:
34
case
SqlNodeType
.Max:
35
case
SqlNodeType
.Min:
36
case
SqlNodeType
.Sum:
37
case
SqlNodeType
.Avg:
38
case
SqlNodeType
.Stddev:
39
case
SqlNodeType
.Convert:
40
case
SqlNodeType
.ValueOf:
41
case
SqlNodeType
.OuterJoinedValue:
42
case
SqlNodeType
.ClrLength:
45
case
SqlNodeType
.Lift:
48
case
SqlNodeType
.Add:
49
case
SqlNodeType
.Sub:
50
case
SqlNodeType
.Mul:
51
case
SqlNodeType
.Div:
52
case
SqlNodeType
.Mod:
53
case
SqlNodeType
.BitAnd:
54
case
SqlNodeType
.BitOr:
55
case
SqlNodeType
.BitXor:
56
case
SqlNodeType
.And:
57
case
SqlNodeType
.Or:
58
case
SqlNodeType
.GE:
59
case
SqlNodeType
.GT:
60
case
SqlNodeType
.LE:
61
case
SqlNodeType
.LT:
62
case
SqlNodeType
.EQ:
63
case
SqlNodeType
.NE:
64
case
SqlNodeType
.EQ2V:
65
case
SqlNodeType
.NE2V:
66
case
SqlNodeType
.Concat:
67
case
SqlNodeType
.Coalesce:
70
case
SqlNodeType
.Between:
73
case
SqlNodeType
.In:
76
case
SqlNodeType
.Like:
79
case
SqlNodeType
.Treat:
82
case
SqlNodeType
.Alias:
85
case
SqlNodeType
.AliasRef:
88
case
SqlNodeType
.Member:
91
case
SqlNodeType
.Row:
94
case
SqlNodeType
.Column:
97
case
SqlNodeType
.ColumnRef:
100
case
SqlNodeType
.Table:
103
case
SqlNodeType
.UserQuery:
106
case
SqlNodeType
.StoredProcedureCall:
109
case
SqlNodeType
.UserRow:
112
case
SqlNodeType
.UserColumn:
115
case
SqlNodeType
.Multiset:
116
case
SqlNodeType
.ScalarSubSelect:
117
case
SqlNodeType
.Element:
118
case
SqlNodeType
.Exists:
121
case
SqlNodeType
.Join:
124
case
SqlNodeType
.Select:
127
case
SqlNodeType
.Parameter:
130
case
SqlNodeType
.New:
133
case
SqlNodeType
.Link:
136
case
SqlNodeType
.ClientQuery:
139
case
SqlNodeType
.JoinedCollection:
142
case
SqlNodeType
.Value:
145
case
SqlNodeType
.ClientArray:
148
case
SqlNodeType
.Insert:
151
case
SqlNodeType
.Update:
154
case
SqlNodeType
.Delete:
157
case
SqlNodeType
.MemberAssign:
160
case
SqlNodeType
.Assign:
163
case
SqlNodeType
.Block:
166
case
SqlNodeType
.SearchedCase:
169
case
SqlNodeType
.ClientCase:
172
case
SqlNodeType
.SimpleCase:
175
case
SqlNodeType
.TypeCase:
178
case
SqlNodeType
.Union:
181
case
SqlNodeType
.ExprSet:
184
case
SqlNodeType
.Variable:
187
case
SqlNodeType
.DoNotVisit:
190
case
SqlNodeType
.OptionalValue:
193
case
SqlNodeType
.FunctionCall:
196
case
SqlNodeType
.TableValuedFunctionCall:
199
case
SqlNodeType
.MethodCall:
202
case
SqlNodeType
.Nop:
205
case
SqlNodeType
.SharedExpression:
208
case
SqlNodeType
.SharedExpressionRef:
211
case
SqlNodeType
.SimpleExpression:
214
case
SqlNodeType
.Grouping:
217
case
SqlNodeType
.DiscriminatedType:
220
case
SqlNodeType
.DiscriminatorOf:
223
case
SqlNodeType
.ClientParameter:
226
case
SqlNodeType
.RowNumber:
229
case
SqlNodeType
.IncludeScope:
262
if (expr.NodeType ==
SqlNodeType
.Value) {
405
case
SqlNodeType
.ScalarSubSelect: return this.VisitScalarSubSelect(ss);
406
case
SqlNodeType
.Multiset: return this.VisitMultiset(ss);
407
case
SqlNodeType
.Element: return this.VisitElement(ss);
408
case
SqlNodeType
.Exists: return this.VisitExists(ss);
621
case
SqlNodeType
.Column:
623
case
SqlNodeType
.ColumnRef:
626
case
SqlNodeType
.ExprSet:
634
case
SqlNodeType
.OuterJoinedValue:
SqlClient\Common\TypeSystemProvider.cs (2)
17
internal abstract ProviderType PredictTypeForUnary(
SqlNodeType
unaryOp, ProviderType operandType);
19
internal abstract ProviderType PredictTypeForBinary(
SqlNodeType
binaryOp, ProviderType leftType, ProviderType rightType);
SqlClient\Query\MethodCallConverter.cs (41)
37
&& bo.Left.NodeType ==
SqlNodeType
.MethodCall
38
&& bo.Right.NodeType ==
SqlNodeType
.Value) {
54
private static bool IsComparison(
SqlNodeType
nodeType) {
56
case
SqlNodeType
.EQ:
57
case
SqlNodeType
.NE:
58
case
SqlNodeType
.LT:
59
case
SqlNodeType
.LE:
60
case
SqlNodeType
.GT:
61
case
SqlNodeType
.GE:
62
case
SqlNodeType
.EQ2V:
63
case
SqlNodeType
.NE2V:
72
&& bo.Left.NodeType ==
SqlNodeType
.MethodCall
73
&& bo.Right.NodeType ==
SqlNodeType
.Value
175
private SqlBinary MakeCompareTo(SqlExpression left, SqlExpression right,
SqlNodeType
op, int iValue) {
179
else if (op ==
SqlNodeType
.EQ || op ==
SqlNodeType
.EQ2V) {
182
return sql.Binary(
SqlNodeType
.LT, left, right);
184
return sql.Binary(
SqlNodeType
.GT, left, right);
191
SqlExpression lower = sql.Binary(
SqlNodeType
.LT, a, b);
192
SqlExpression equal = sql.Binary(
SqlNodeType
.EQ2V, a, b);
208
return sql.Unary(
SqlNodeType
.IsNotNull, m.Expression, m.SourceExpression);
220
return sql.Binary(
SqlNodeType
.EQ2V, mc.Arguments[0], mc.Arguments[1], mc.Method);
259
return sql.Binary(
SqlNodeType
.EQ, mc.Arguments[0], mc.Arguments[1], mc.Method, mc.ClrType);
261
return sql.Binary(
SqlNodeType
.NE, mc.Arguments[0], mc.Arguments[1], mc.Method, mc.ClrType);
263
return sql.Binary(
SqlNodeType
.LT, mc.Arguments[0], mc.Arguments[1], mc.Method, mc.ClrType);
265
return sql.Binary(
SqlNodeType
.LE, mc.Arguments[0], mc.Arguments[1], mc.Method, mc.ClrType);
267
return sql.Binary(
SqlNodeType
.GT, mc.Arguments[0], mc.Arguments[1], mc.Method, mc.ClrType);
269
return sql.Binary(
SqlNodeType
.GE, mc.Arguments[0], mc.Arguments[1], mc.Method, mc.ClrType);
271
return sql.Binary(
SqlNodeType
.Mul, mc.Arguments[0], mc.Arguments[1], mc.Method, mc.ClrType);
273
return sql.Binary(
SqlNodeType
.Div, mc.Arguments[0], mc.Arguments[1], mc.Method, mc.ClrType);
275
return sql.Binary(
SqlNodeType
.Sub, mc.Arguments[0], mc.Arguments[1], mc.Method, mc.ClrType);
277
return sql.Binary(
SqlNodeType
.Add, mc.Arguments[0], mc.Arguments[1], mc.Method, mc.ClrType);
279
return sql.Binary(
SqlNodeType
.Mod, mc.Arguments[0], mc.Arguments[1], mc.Method, mc.ClrType);
281
return sql.Binary(
SqlNodeType
.BitAnd, mc.Arguments[0], mc.Arguments[1], mc.Method, mc.ClrType);
283
return sql.Binary(
SqlNodeType
.BitOr, mc.Arguments[0], mc.Arguments[1], mc.Method, mc.ClrType);
285
return sql.Binary(
SqlNodeType
.BitXor, mc.Arguments[0], mc.Arguments[1], mc.Method, mc.ClrType);
287
return sql.Unary(
SqlNodeType
.Negate, mc.Arguments[0], mc.Method, mc.SourceExpression);
289
return sql.Unary(
SqlNodeType
.BitNot, mc.Arguments[0], mc.Method, mc.SourceExpression);
291
return sql.Unary(
SqlNodeType
.Not, mc.Arguments[0], mc.Method, mc.SourceExpression);
297
return sql.Binary(
SqlNodeType
.EQ, mc.Object, mc.Arguments[0]);
318
while (@else.NodeType ==
SqlNodeType
.SearchedCase) {
SqlClient\Query\QueryConverter.cs (122)
107
if (retNode.NodeType ==
SqlNodeType
.MethodCall) {
259
if (sel.Selection.NodeType !=
SqlNodeType
.AliasRef ||
281
if (node.NodeType ==
SqlNodeType
.Value) {
301
else if (node.NodeType ==
SqlNodeType
.Multiset || node.NodeType ==
SqlNodeType
.Element) {
304
else if (node.NodeType ==
SqlNodeType
.ClientArray) {
307
else if (node.NodeType ==
SqlNodeType
.ClientParameter) {
337
if (expr.NodeType ==
SqlNodeType
.Value) {
406
SqlSubSelect ms = sql.SubSelect(
SqlNodeType
.Multiset, select, exp.Type);
422
return new SqlSelect(sql.SubSelect(
SqlNodeType
.Multiset, pselect, selector.Body.Type), alias, this.dominatingExpression);
424
else if ((project.NodeType ==
SqlNodeType
.Element || project.NodeType ==
SqlNodeType
.ScalarSubSelect) &&
430
if (project.NodeType ==
SqlNodeType
.Element) {
435
SqlNodeType
.OuterJoinedValue,
439
sql.Unary(
SqlNodeType
.OuterJoinedValue, inner.Selection)
443
inner.Selection = sql.Unary(
SqlNodeType
.OuterJoinedValue, inner.Selection);
501
SqlExpression condition = sql.Binary(
SqlNodeType
.EQ, outerKey, innerKey);
530
SqlExpression pred = sql.Binary(
SqlNodeType
.EQ, outerKey, innerKey);
533
SqlSubSelect subquery = sql.SubSelect(
SqlNodeType
.Multiset, select);
551
sql.Unary(
SqlNodeType
.OuterJoinedValue,
555
sql.Unary(
SqlNodeType
.OuterJoinedValue, aliasRef)
578
select.Selection = new SqlUnary(
SqlNodeType
.Treat, ofType, typeProvider.From(ofType), aref, this.dominatingExpression);
585
sql.Unary(
SqlNodeType
.IsNotNull, aref, this.dominatingExpression)
620
result = sql.Unary(
SqlNodeType
.IsNotNull, new SqlUnary(
SqlNodeType
.Treat, ofType, typeProvider.From(ofType), expr, this.dominatingExpression), this.dominatingExpression);
640
return new SqlUnary(
SqlNodeType
.Treat, a.Type, typeProvider.From(a.Type), expr, a);
644
SqlSubSelect ms = sql.SubSelect(
SqlNodeType
.Multiset, select);
645
return new SqlUnary(
SqlNodeType
.Treat, a.Type, typeProvider.From(a.Type), ms, a);
665
if (array.NodeType ==
SqlNodeType
.ClientParameter
666
&& index.NodeType ==
SqlNodeType
.Value) {
707
else if (expr.NodeType ==
SqlNodeType
.Value && ((SqlValue)expr).Value == null) {
710
else if (expr.NodeType ==
SqlNodeType
.ClientParameter) {
734
return new SqlUnary(
SqlNodeType
.Treat, type, typeProvider.From(type), expr, expr.SourceExpression);
813
while (@else.NodeType ==
SqlNodeType
.SearchedCase) {
931
if (takeExp.NodeType ==
SqlNodeType
.Value) {
943
if (skipExp.NodeType ==
SqlNodeType
.Value) {
979
case
SqlNodeType
.AliasRef: {
1005
case
SqlNodeType
.New:
1045
if (skipExp.NodeType ==
SqlNodeType
.Value) {
1084
sql.Binary(
SqlNodeType
.Add, (SqlExpression)SqlDuplicator.Copy(skipExp), takeExp),
1089
final.Where = sql.Binary(
SqlNodeType
.GT, rowNumberRef, skipExp);
1131
eqsel.Where = sql.Binary(
SqlNodeType
.EQ2V, aref, dupRef);
1132
SqlSubSelect ss = sql.SubSelect(
SqlNodeType
.Exists, eqsel);
1135
final.Where = sql.Unary(
SqlNodeType
.Not, ss, this.dominatingExpression);
1277
result = sql.Unary(
SqlNodeType
.Negate, exp, this.dominatingExpression);
1281
result = sql.Unary(
SqlNodeType
.Not, exp, this.dominatingExpression);
1284
result = sql.Unary(
SqlNodeType
.BitNot, exp, this.dominatingExpression);
1288
result = sql.Unary(
SqlNodeType
.Treat, exp, this.dominatingExpression);
1309
result = sql.Binary(
SqlNodeType
.Add, left, right, b.Type);
1313
result = sql.Binary(
SqlNodeType
.Sub, left, right, b.Type);
1317
result = sql.Binary(
SqlNodeType
.Mul, left, right, b.Type);
1320
result = sql.Binary(
SqlNodeType
.Div, left, right, b.Type);
1323
result = sql.Binary(
SqlNodeType
.Mod, left, right, b.Type);
1327
result = sql.Binary(
SqlNodeType
.And, left, right, b.Type);
1330
result = sql.Binary(
SqlNodeType
.BitAnd, left, right, b.Type);
1334
result = sql.Binary(
SqlNodeType
.And, left, right, b.Type);
1338
result = sql.Binary(
SqlNodeType
.Or, left, right, b.Type);
1341
result = sql.Binary(
SqlNodeType
.BitOr, left, right, b.Type);
1345
result = sql.Binary(
SqlNodeType
.Or, left, right, b.Type);
1348
result = sql.Binary(
SqlNodeType
.LT, left, right, b.Type);
1351
result = sql.Binary(
SqlNodeType
.LE, left, right, b.Type);
1354
result = sql.Binary(
SqlNodeType
.GT, left, right, b.Type);
1357
result = sql.Binary(
SqlNodeType
.GE, left, right, b.Type);
1360
result = sql.Binary(
SqlNodeType
.EQ, left, right, b.Type);
1363
result = sql.Binary(
SqlNodeType
.NE, left, right, b.Type);
1366
result = sql.Binary(
SqlNodeType
.BitXor, left, right, b.Type);
1380
return sql.Binary(
SqlNodeType
.Coalesce, left, right, resultType);
1384
whens.Add(new SqlWhen(sql.Unary(
SqlNodeType
.IsNull, left, left.SourceExpression), right));
1440
SqlExpression any = this.GenerateQuantifier(alias2, sql.Binary(
SqlNodeType
.EQ2V, aref1, aref2), true);
1464
SqlExpression any = this.GenerateQuantifier(alias2, sql.Binary(
SqlNodeType
.EQ2V, aref1, aref2), true);
1467
result.Where = sql.Unary(
SqlNodeType
.Not, any);
1494
if (select.Selection.NodeType !=
SqlNodeType
.AliasRef || select.OrderBy.Count > 0) {
1516
System.Diagnostics.Debug.Assert(select.Selection.NodeType ==
SqlNodeType
.AliasRef);
1577
selElem.Where = sql.Binary(
SqlNodeType
.EQ2V, keyExpr, keyDup);
1580
SqlSubSelect ss = sql.SubSelect(
SqlNodeType
.Multiset, selElem);
1626
private SqlNode VisitAggregate(Expression sequence, LambdaExpression lambda,
SqlNodeType
aggType, Type returnType) {
1633
bool isCount = aggType ==
SqlNodeType
.Count || aggType ==
SqlNodeType
.LongCount;
1737
return sql.SubSelect(
SqlNodeType
.ScalarSubSelect, sel);
1759
case
SqlNodeType
.AliasRef:
1761
case
SqlNodeType
.Member:
1771
private SqlExpression GetAggregate(
SqlNodeType
aggType, Type clrType, SqlExpression exp) {
1779
if (seqNode.NodeType ==
SqlNodeType
.ClientArray) {
1783
else if (seqNode.NodeType ==
SqlNodeType
.Value) {
1806
SqlExpression pred = sql.Binary(
SqlNodeType
.EQ, expr, list[0]);
1808
pred = sql.Binary(
SqlNodeType
.Or, pred, sql.Binary(
SqlNodeType
.EQ, (SqlExpression)SqlDuplicator.Copy(expr), list[i]));
1834
SqlSubSelect exists = sql.SubSelect(
SqlNodeType
.Exists, sel);
1839
SqlSubSelect ss = sql.SubSelect(
SqlNodeType
.Exists, sel);
1840
sel.Where = sql.Unary(
SqlNodeType
.Not2V, cond, this.dominatingExpression);
1841
return sql.Unary(
SqlNodeType
.Not, ss, this.dominatingExpression);
1868
return this.VisitAggregate(ma.Expression, null,
SqlNodeType
.Count, typeof(int));
1949
if (exp.NodeType ==
SqlNodeType
.Value) {
2172
return this.VisitAggregate(mc.Arguments[0], null,
SqlNodeType
.Count, mc.Type);
2176
return this.VisitAggregate(mc.Arguments[0], this.GetLambda(mc.Arguments[1]),
SqlNodeType
.Count, mc.Type);
2182
return this.VisitAggregate(mc.Arguments[0], null,
SqlNodeType
.LongCount, mc.Type);
2186
return this.VisitAggregate(mc.Arguments[0], this.GetLambda(mc.Arguments[1]),
SqlNodeType
.LongCount, mc.Type);
2192
return this.VisitAggregate(mc.Arguments[0], null,
SqlNodeType
.Sum, mc.Type);
2196
return this.VisitAggregate(mc.Arguments[0], this.GetLambda(mc.Arguments[1]),
SqlNodeType
.Sum, mc.Type);
2202
return this.VisitAggregate(mc.Arguments[0], null,
SqlNodeType
.Min, mc.Type);
2206
return this.VisitAggregate(mc.Arguments[0], this.GetLambda(mc.Arguments[1]),
SqlNodeType
.Min, mc.Type);
2212
return this.VisitAggregate(mc.Arguments[0], null,
SqlNodeType
.Max, mc.Type);
2216
return this.VisitAggregate(mc.Arguments[0], this.GetLambda(mc.Arguments[1]),
SqlNodeType
.Max, mc.Type);
2222
return this.VisitAggregate(mc.Arguments[0], null,
SqlNodeType
.Avg, mc.Type);
2226
return this.VisitAggregate(mc.Arguments[0], this.GetLambda(mc.Arguments[1]),
SqlNodeType
.Avg, mc.Type);
2383
SqlNodeType
subType = (this.typeProvider.From(select.Selection.ClrType).CanBeColumn) ?
SqlNodeType
.ScalarSubSelect :
SqlNodeType
.Element;
2453
SqlNodeType
.EQ,
2460
pred = sql.Binary(
SqlNodeType
.EQ2V, tableAliasRef, itemExpression);
2620
sql.Binary(
SqlNodeType
.GT, this.GetRowCountExpression(), sql.ValueFromObject(0, false, this.dominatingExpression)),
2672
if (r.NodeType ==
SqlNodeType
.Value) {
2773
case
SqlNodeType
.Column:
2774
case
SqlNodeType
.ColumnRef:
2775
case
SqlNodeType
.Member: {
2788
case
SqlNodeType
.New:
2789
case
SqlNodeType
.AliasRef: {
2793
case
SqlNodeType
.Treat:
2794
case
SqlNodeType
.TypeCase: {
2870
case
SqlNodeType
.Column: {
2874
case
SqlNodeType
.ColumnRef: {
2878
case
SqlNodeType
.Member: {
SqlClient\Query\SimpleExpression.cs (71)
41
case
SqlNodeType
.Not:
42
case
SqlNodeType
.Not2V:
43
case
SqlNodeType
.Negate:
44
case
SqlNodeType
.BitNot:
45
case
SqlNodeType
.IsNull:
46
case
SqlNodeType
.IsNotNull:
47
case
SqlNodeType
.ValueOf:
48
case
SqlNodeType
.OuterJoinedValue:
49
case
SqlNodeType
.ClrLength:
50
case
SqlNodeType
.Add:
51
case
SqlNodeType
.Sub:
52
case
SqlNodeType
.Mul:
53
case
SqlNodeType
.Div:
54
case
SqlNodeType
.Mod:
55
case
SqlNodeType
.BitAnd:
56
case
SqlNodeType
.BitOr:
57
case
SqlNodeType
.BitXor:
58
case
SqlNodeType
.And:
59
case
SqlNodeType
.Or:
60
case
SqlNodeType
.GE:
61
case
SqlNodeType
.GT:
62
case
SqlNodeType
.LE:
63
case
SqlNodeType
.LT:
64
case
SqlNodeType
.EQ:
65
case
SqlNodeType
.NE:
66
case
SqlNodeType
.EQ2V:
67
case
SqlNodeType
.NE2V:
68
case
SqlNodeType
.Between:
69
case
SqlNodeType
.Concat:
70
case
SqlNodeType
.Convert:
71
case
SqlNodeType
.Treat:
72
case
SqlNodeType
.Member:
73
case
SqlNodeType
.TypeCase:
74
case
SqlNodeType
.SearchedCase:
75
case
SqlNodeType
.SimpleCase:
76
case
SqlNodeType
.Like:
77
case
SqlNodeType
.FunctionCall:
78
case
SqlNodeType
.ExprSet:
79
case
SqlNodeType
.OptionalValue:
80
case
SqlNodeType
.Parameter:
81
case
SqlNodeType
.ColumnRef:
82
case
SqlNodeType
.Value:
83
case
SqlNodeType
.Variable:
85
case
SqlNodeType
.Column:
86
case
SqlNodeType
.ClientCase:
87
case
SqlNodeType
.DiscriminatedType:
88
case
SqlNodeType
.Link:
89
case
SqlNodeType
.Row:
90
case
SqlNodeType
.UserQuery:
91
case
SqlNodeType
.StoredProcedureCall:
92
case
SqlNodeType
.UserRow:
93
case
SqlNodeType
.UserColumn:
94
case
SqlNodeType
.Multiset:
95
case
SqlNodeType
.ScalarSubSelect:
96
case
SqlNodeType
.Element:
97
case
SqlNodeType
.Exists:
98
case
SqlNodeType
.Join:
99
case
SqlNodeType
.Select:
100
case
SqlNodeType
.New:
101
case
SqlNodeType
.ClientQuery:
102
case
SqlNodeType
.ClientArray:
103
case
SqlNodeType
.Insert:
104
case
SqlNodeType
.Update:
105
case
SqlNodeType
.Delete:
106
case
SqlNodeType
.MemberAssign:
107
case
SqlNodeType
.Assign:
108
case
SqlNodeType
.Block:
109
case
SqlNodeType
.Union:
110
case
SqlNodeType
.DoNotVisit:
111
case
SqlNodeType
.MethodCall:
112
case
SqlNodeType
.Nop:
SqlClient\Query\SqlAggregateChecker.cs (6)
35
case
SqlNodeType
.Min:
36
case
SqlNodeType
.Max:
37
case
SqlNodeType
.Avg:
38
case
SqlNodeType
.Sum:
39
case
SqlNodeType
.Count:
40
case
SqlNodeType
.LongCount:
SqlClient\Query\SqlBinder.cs (133)
176
case
SqlNodeType
.EQ:
177
case
SqlNodeType
.EQ2V:
179
return this.VisitUnaryOperator(this.sql.Unary(
SqlNodeType
.IsNull, bo.Right, bo.SourceExpression));
182
return this.VisitUnaryOperator(this.sql.Unary(
SqlNodeType
.IsNull, bo.Left, bo.SourceExpression));
185
case
SqlNodeType
.NE:
186
case
SqlNodeType
.NE2V:
188
return this.VisitUnaryOperator(this.sql.Unary(
SqlNodeType
.IsNotNull, bo.Right, bo.SourceExpression));
191
return this.VisitUnaryOperator(this.sql.Unary(
SqlNodeType
.IsNotNull, bo.Left, bo.SourceExpression));
200
case
SqlNodeType
.EQ:
201
case
SqlNodeType
.EQ2V:
202
case
SqlNodeType
.NE:
203
case
SqlNodeType
.NE2V: {
209
bool equal = bo.NodeType !=
SqlNodeType
.NE && bo.NodeType !=
SqlNodeType
.NE2V;
210
bool isTwoValue = bo.NodeType ==
SqlNodeType
.EQ2V || bo.NodeType ==
SqlNodeType
.NE2V;
211
SqlNodeType
negator = isTwoValue ?
SqlNodeType
.Not2V :
SqlNodeType
.Not;
246
case
SqlNodeType
.And: {
267
case
SqlNodeType
.Or: {
288
case
SqlNodeType
.EQ:
289
case
SqlNodeType
.NE:
290
case
SqlNodeType
.EQ2V:
291
case
SqlNodeType
.NE2V: {
304
case
SqlNodeType
.EQ:
305
case
SqlNodeType
.NE:
306
case
SqlNodeType
.EQ2V:
307
case
SqlNodeType
.NE2V:
335
return this.VisitExpression(sql.ValueFromObject(bo.NodeType ==
SqlNodeType
.NE, false, bo.SourceExpression));
342
(bo.NodeType ==
SqlNodeType
.EQ) == (leftPossibleTypes[0] == rightPossibleTypes[0]),
374
if (typeExpression.NodeType ==
SqlNodeType
.DiscriminatedType) {
384
else if (typeExpression.NodeType ==
SqlNodeType
.Value) {
388
} else if (typeExpression.NodeType ==
SqlNodeType
.SearchedCase) {
406
while (obj.NodeType ==
SqlNodeType
.OptionalValue
407
|| obj.NodeType ==
SqlNodeType
.OuterJoinedValue) {
408
if (obj.NodeType ==
SqlNodeType
.OptionalValue) {
415
if (obj.NodeType ==
SqlNodeType
.TypeCase) {
455
return this.VisitExpression(sql.Binary(
SqlNodeType
.And, c.Whens[0].Match, c.Whens[0].Value));
458
return this.VisitExpression(sql.Binary(
SqlNodeType
.Or, c.Whens[0].Match, c.Else));
480
case
SqlNodeType
.OptionalValue:
483
case
SqlNodeType
.OuterJoinedValue:
486
case
SqlNodeType
.New:
494
case
SqlNodeType
.TypeCase:
539
if (uo.NodeType ==
SqlNodeType
.IsNull || uo.NodeType ==
SqlNodeType
.IsNotNull) {
544
if (uo.Operand.NodeType==
SqlNodeType
.OuterJoinedValue) {
546
if (ojv.Operand.NodeType ==
SqlNodeType
.OptionalValue) {
550
new SqlUnary(
SqlNodeType
.OuterJoinedValue, ov.ClrType, ov.SqlType, ov.HasValue, ov.SourceExpression)
554
else if (ojv.Operand.NodeType ==
SqlNodeType
.TypeCase) {
557
new SqlUnary(
SqlNodeType
.OuterJoinedValue, tc.Discriminator.ClrType, tc.Discriminator.SqlType, tc.Discriminator, tc.SourceExpression),
570
if ((uo.NodeType ==
SqlNodeType
.Not || uo.NodeType ==
SqlNodeType
.Not2V) && uo.Operand.NodeType ==
SqlNodeType
.Value) {
574
else if (uo.NodeType ==
SqlNodeType
.Not2V) {
582
return sql.Binary(
SqlNodeType
.EQ, c, sql.ValueFromObject(0, false, uo.SourceExpression));
585
return sql.Unary(
SqlNodeType
.Not, uo.Operand);
589
else if (uo.NodeType ==
SqlNodeType
.Convert && uo.Operand.NodeType ==
SqlNodeType
.Value) {
593
else if (uo.NodeType ==
SqlNodeType
.IsNull || uo.NodeType ==
SqlNodeType
.IsNotNull) {
596
return sql.ValueFromObject(uo.NodeType ==
SqlNodeType
.IsNotNull, false, uo.SourceExpression);
600
case
SqlNodeType
.Element:
601
exp = sql.SubSelect(
SqlNodeType
.Exists, ((SqlSubSelect)exp).Select);
602
if (uo.NodeType ==
SqlNodeType
.IsNull) {
603
exp = sql.Unary(
SqlNodeType
.Not, exp, exp.SourceExpression);
606
case
SqlNodeType
.ClientQuery: {
608
if (cq.Query.NodeType ==
SqlNodeType
.Element) {
609
exp = sql.SubSelect(
SqlNodeType
.Exists, cq.Query.Select);
610
if (uo.NodeType ==
SqlNodeType
.IsNull) {
611
exp = sql.Unary(
SqlNodeType
.Not, exp, exp.SourceExpression);
615
return sql.ValueFromObject(uo.NodeType ==
SqlNodeType
.IsNotNull, false, uo.SourceExpression);
617
case
SqlNodeType
.OptionalValue:
621
case
SqlNodeType
.ClientCase: {
632
case
SqlNodeType
.TypeCase: {
648
case
SqlNodeType
.Value: {
650
return sql.Value(typeof(bool), this.typeProvider.From(typeof(int)), (val.Value == null) == (uo.NodeType ==
SqlNodeType
.IsNull), val.IsClientSpecified, uo.SourceExpression);
654
else if (uo.NodeType ==
SqlNodeType
.Treat) {
677
if (mm.IsAssociation && ma.Expression != null && ma.Expression.NodeType !=
SqlNodeType
.Link
707
case
SqlNodeType
.ClientCase: {
728
case
SqlNodeType
.SimpleCase: {
748
case
SqlNodeType
.SearchedCase: {
759
case
SqlNodeType
.TypeCase: {
767
if (when.TypeBinding.NodeType ==
SqlNodeType
.New) {
777
case
SqlNodeType
.AliasRef: {
812
case
SqlNodeType
.OptionalValue:
816
case
SqlNodeType
.OuterJoinedValue: {
819
if (e != null) return sql.Unary(
SqlNodeType
.OuterJoinedValue, e);
823
case
SqlNodeType
.Lift:
826
case
SqlNodeType
.UserRow: {
841
case
SqlNodeType
.New: {
854
case
SqlNodeType
.Element:
855
case
SqlNodeType
.ScalarSubSelect: {
874
if (rexp.NodeType ==
SqlNodeType
.Member && !SqlColumnizer.CanBeColumn(rexp)) {
878
if (this.canUseOuterApply && exp.NodeType ==
SqlNodeType
.Element && this.currentSelect != null) {
894
SqlNodeType
subType = (rexp is SqlTypeCase || !rexp.SqlType.CanBeColumn) ?
SqlNodeType
.Element :
SqlNodeType
.ScalarSubSelect;
913
case
SqlNodeType
.Value: {
927
case
SqlNodeType
.Grouping: {
934
case
SqlNodeType
.ClientParameter: {
960
if (ss.NodeType ==
SqlNodeType
.Element && ss.Select.Selection.NodeType ==
SqlNodeType
.Multiset) {
967
SqlSubSelect newss = sql.SubSelect(
SqlNodeType
.Multiset, sel, ss.ClrType);
970
else if (ss.NodeType ==
SqlNodeType
.Element && ss.Select.Selection.NodeType ==
SqlNodeType
.Element) {
977
SqlSubSelect newss = sql.SubSelect(
SqlNodeType
.Element, sel);
1024
if (a.Node.NodeType ==
SqlNodeType
.Table) {
1071
if (shared.Expression.NodeType ==
SqlNodeType
.ColumnRef) {
1095
if (expr.NodeType ==
SqlNodeType
.Value && expr.SqlType.CanBeColumn) {
1181
if (select.Where != null && select.Where.NodeType ==
SqlNodeType
.Value && (bool)((SqlValue)select.Where).Value) {
1217
case
SqlNodeType
.Column: {
1224
case
SqlNodeType
.OuterJoinedValue: {
1230
if (e.NodeType !=
SqlNodeType
.OuterJoinedValue) {
1231
return sql.Unary(
SqlNodeType
.OuterJoinedValue, e);
1235
case
SqlNodeType
.Link:
1237
case
SqlNodeType
.ClientCase: {
1263
SqlSubSelect ms = sql.SubSelect(
SqlNodeType
.Multiset, select);
1277
case
SqlNodeType
.OuterJoinedValue: {
1285
case
SqlNodeType
.ClientCase: {
1315
case
SqlNodeType
.TypeCase: {
1329
case
SqlNodeType
.SearchedCase: {
1338
case
SqlNodeType
.Link: {
1366
&& node.NodeType ==
SqlNodeType
.Element
1408
if (location.NodeType ==
SqlNodeType
.Join)
1453
while (node.NodeType ==
SqlNodeType
.OuterJoinedValue) {
1466
if (expr.NodeType ==
SqlNodeType
.Value) {
1470
if (expr.NodeType ==
SqlNodeType
.Link) {
1487
else if (expr.NodeType ==
SqlNodeType
.Grouping) {
1490
else if (expr.NodeType ==
SqlNodeType
.ClientCase) {
1549
if (aref != null && aref.Alias.Node.NodeType ==
SqlNodeType
.Table) {
1585
SqlExpression discriminatorPredicate = sql.Binary(
SqlNodeType
.EQ, clientCase.Expression, clientCase.Whens[i].Match);
1587
elseFilter = sql.AndAccumulate(elseFilter, sql.Binary(
SqlNodeType
.NE, clientCase.Expression, clientCase.Whens[i].Match));
SqlClient\Query\SqlBooleanizer.cs (4)
20
if (select.Where != null && select.Where.NodeType ==
SqlNodeType
.Coalesce) {
22
if (bin.Right.NodeType ==
SqlNodeType
.Value) {
40
return new SqlBinary(
SqlNodeType
.EQ,
66
new SqlWhen(new SqlUnary(
SqlNodeType
.Not, predicateExpression.ClrType, predicateExpression.SqlType, predicateExpression, predicateExpression.SourceExpression), valueFalse)
SqlClient\Query\SqlBooleanMismatchVisitor.cs (19)
124
case
SqlNodeType
.And:
125
case
SqlNodeType
.Or:
126
case
SqlNodeType
.Not:
127
case
SqlNodeType
.Not2V:
128
case
SqlNodeType
.EQ:
129
case
SqlNodeType
.EQ2V:
130
case
SqlNodeType
.NE:
131
case
SqlNodeType
.NE2V:
132
case
SqlNodeType
.GE:
133
case
SqlNodeType
.GT:
134
case
SqlNodeType
.LE:
135
case
SqlNodeType
.LT:
136
case
SqlNodeType
.Exists:
137
case
SqlNodeType
.Between:
138
case
SqlNodeType
.In:
139
case
SqlNodeType
.Like:
140
case
SqlNodeType
.IsNotNull:
141
case
SqlNodeType
.IsNull:
143
case
SqlNodeType
.Lift:
SqlClient\Query\SqlCaseSimplifier.cs (21)
38
case
SqlNodeType
.EQ:
39
case
SqlNodeType
.NE:
40
case
SqlNodeType
.EQ2V:
41
case
SqlNodeType
.NE2V:
42
if (bo.Left.NodeType ==
SqlNodeType
.SimpleCase &&
43
bo.Right.NodeType ==
SqlNodeType
.Value &&
47
else if (bo.Right.NodeType ==
SqlNodeType
.SimpleCase &&
48
bo.Left.NodeType==
SqlNodeType
.Value &&
63
if (when.Value.NodeType !=
SqlNodeType
.Value) {
72
private SqlExpression DistributeOperatorIntoCase(
SqlNodeType
nt, SqlSimpleCase sc, SqlExpression expr) {
73
if (nt!=
SqlNodeType
.EQ && nt!=
SqlNodeType
.NE && nt!=
SqlNodeType
.EQ2V && nt!=
SqlNodeType
.NE2V)
82
values.Add(sql.ValueFromObject((nt==
SqlNodeType
.EQ || nt==
SqlNodeType
.EQ2V) == eq, false, sc.SourceExpression));
113
allValuesLiteral = allValuesLiteral && when.Value.NodeType ==
SqlNodeType
.Value;
188
rewrite = sql.OrAccumulate(rewrite, sql.Binary(
SqlNodeType
.EQ, discriminator, newWhens[i].Match));
191
rewrite = sql.AndAccumulate(rewrite, sql.Binary(
SqlNodeType
.NE, discriminator, newWhens[i].Match));
201
rewrite = sql.OrAccumulate(rewrite, sql.Unary(
SqlNodeType
.IsNull, discriminator, discriminator.SourceExpression));
204
rewrite = sql.AndAccumulate(rewrite, sql.Unary(
SqlNodeType
.IsNotNull, discriminator, discriminator.SourceExpression));
SqlClient\Query\SqlColumnizer.cs (34)
49
if (expr.NodeType ==
SqlNodeType
.Column ||
50
expr.NodeType ==
SqlNodeType
.ColumnRef) {
123
case
SqlNodeType
.AliasRef:
124
case
SqlNodeType
.ColumnRef:
125
case
SqlNodeType
.Column:
126
case
SqlNodeType
.Multiset:
127
case
SqlNodeType
.Element:
128
case
SqlNodeType
.ScalarSubSelect:
129
case
SqlNodeType
.Exists:
130
case
SqlNodeType
.ClientQuery:
131
case
SqlNodeType
.SharedExpressionRef:
132
case
SqlNodeType
.Link:
133
case
SqlNodeType
.Nop:
134
case
SqlNodeType
.Value:
135
case
SqlNodeType
.Select:
145
case
SqlNodeType
.ClientCase:
146
case
SqlNodeType
.TypeCase:
147
case
SqlNodeType
.ClientArray:
148
case
SqlNodeType
.Grouping:
149
case
SqlNodeType
.DiscriminatedType:
150
case
SqlNodeType
.SharedExpression:
151
case
SqlNodeType
.SimpleExpression:
152
case
SqlNodeType
.AliasRef:
153
case
SqlNodeType
.Multiset:
154
case
SqlNodeType
.Element:
155
case
SqlNodeType
.ClientQuery:
156
case
SqlNodeType
.SharedExpressionRef:
157
case
SqlNodeType
.Link:
158
case
SqlNodeType
.Nop:
160
case
SqlNodeType
.OuterJoinedValue:
169
&& expression.NodeType !=
SqlNodeType
.Column
173
case
SqlNodeType
.MethodCall:
174
case
SqlNodeType
.Member:
175
case
SqlNodeType
.New:
SqlClient\Query\SqlComparer.cs (85)
26
if (node1.NodeType ==
SqlNodeType
.SimpleCase)
29
if (node2.NodeType ==
SqlNodeType
.SimpleCase)
34
if (node1.NodeType ==
SqlNodeType
.ExprSet) {
41
else if (node2.NodeType ==
SqlNodeType
.ExprSet) {
54
case
SqlNodeType
.Not:
55
case
SqlNodeType
.Not2V:
56
case
SqlNodeType
.Negate:
57
case
SqlNodeType
.BitNot:
58
case
SqlNodeType
.IsNull:
59
case
SqlNodeType
.IsNotNull:
60
case
SqlNodeType
.Count:
61
case
SqlNodeType
.Max:
62
case
SqlNodeType
.Min:
63
case
SqlNodeType
.Sum:
64
case
SqlNodeType
.Avg:
65
case
SqlNodeType
.Stddev:
66
case
SqlNodeType
.ValueOf:
67
case
SqlNodeType
.OuterJoinedValue:
68
case
SqlNodeType
.ClrLength:
70
case
SqlNodeType
.Add:
71
case
SqlNodeType
.Sub:
72
case
SqlNodeType
.Mul:
73
case
SqlNodeType
.Div:
74
case
SqlNodeType
.Mod:
75
case
SqlNodeType
.BitAnd:
76
case
SqlNodeType
.BitOr:
77
case
SqlNodeType
.BitXor:
78
case
SqlNodeType
.And:
79
case
SqlNodeType
.Or:
80
case
SqlNodeType
.GE:
81
case
SqlNodeType
.GT:
82
case
SqlNodeType
.LE:
83
case
SqlNodeType
.LT:
84
case
SqlNodeType
.EQ:
85
case
SqlNodeType
.NE:
86
case
SqlNodeType
.EQ2V:
87
case
SqlNodeType
.NE2V:
88
case
SqlNodeType
.Concat:
93
case
SqlNodeType
.Convert:
94
case
SqlNodeType
.Treat: {
99
case
SqlNodeType
.Between: {
106
case
SqlNodeType
.Parameter:
108
case
SqlNodeType
.Alias:
110
case
SqlNodeType
.AliasRef:
112
case
SqlNodeType
.Column:
116
case
SqlNodeType
.Table:
118
case
SqlNodeType
.Member:
121
case
SqlNodeType
.ColumnRef:
125
case
SqlNodeType
.Value:
127
case
SqlNodeType
.TypeCase: {
147
case
SqlNodeType
.SearchedCase: {
159
case
SqlNodeType
.ClientCase: {
171
case
SqlNodeType
.DiscriminatedType: {
176
case
SqlNodeType
.SimpleCase: {
188
case
SqlNodeType
.Like: {
195
case
SqlNodeType
.Variable: {
200
case
SqlNodeType
.FunctionCall: {
213
case
SqlNodeType
.Link: {
232
case
SqlNodeType
.ExprSet:
242
case
SqlNodeType
.OptionalValue:
246
case
SqlNodeType
.Row:
247
case
SqlNodeType
.UserQuery:
248
case
SqlNodeType
.StoredProcedureCall:
249
case
SqlNodeType
.UserRow:
250
case
SqlNodeType
.UserColumn:
251
case
SqlNodeType
.Multiset:
252
case
SqlNodeType
.ScalarSubSelect:
253
case
SqlNodeType
.Element:
254
case
SqlNodeType
.Exists:
255
case
SqlNodeType
.Join:
256
case
SqlNodeType
.Select:
257
case
SqlNodeType
.New:
258
case
SqlNodeType
.ClientQuery:
259
case
SqlNodeType
.ClientArray:
260
case
SqlNodeType
.Insert:
261
case
SqlNodeType
.Update:
262
case
SqlNodeType
.Delete:
263
case
SqlNodeType
.MemberAssign:
264
case
SqlNodeType
.Assign:
265
case
SqlNodeType
.Block:
266
case
SqlNodeType
.Union:
267
case
SqlNodeType
.DoNotVisit:
268
case
SqlNodeType
.MethodCall:
269
case
SqlNodeType
.Nop:
297
if (result.NodeType ==
SqlNodeType
.SimpleCase) {
SqlClient\Query\SqlDeflator.cs (6)
67
while (expr != null && expr.NodeType ==
SqlNodeType
.ColumnRef) {
242
case
SqlNodeType
.And: {
248
case
SqlNodeType
.EQ:
249
case
SqlNodeType
.EQ2V: {
362
if (c.Expression != null && c.Expression.NodeType !=
SqlNodeType
.ColumnRef) {
481
if (c.Expression != null && c.Expression.NodeType !=
SqlNodeType
.ColumnRef) {
SqlClient\Query\SqlDuplicator.cs (6)
24
case
SqlNodeType
.ColumnRef:
25
case
SqlNodeType
.Value:
26
case
SqlNodeType
.Parameter:
27
case
SqlNodeType
.Variable:
203
return new SqlSubSelect(
SqlNodeType
.ScalarSubSelect, ss.ClrType, ss.SqlType, this.VisitSequence(ss.Select));
291
return new SqlUnary(
SqlNodeType
.Treat, t.ClrType, t.SqlType, (SqlExpression)this.Visit(t.Operand), t.SourceExpression);
SqlClient\Query\SqlExpander.cs (18)
119
case
SqlNodeType
.MethodCall: {
137
case
SqlNodeType
.ClientCase: {
165
case
SqlNodeType
.TypeCase: {
197
case
SqlNodeType
.New: {
202
if (exprs[i] == null || exprs[i].NodeType !=
SqlNodeType
.New)
234
case
SqlNodeType
.Link: {
238
if (exprs[i] == null || exprs[i].NodeType !=
SqlNodeType
.Link)
271
case
SqlNodeType
.Value: {
283
case
SqlNodeType
.OptionalValue: {
290
if (exprs[i] == null || exprs[i].NodeType !=
SqlNodeType
.OptionalValue) {
299
case
SqlNodeType
.OuterJoinedValue: {
305
if (exprs[i] == null || exprs[i].NodeType !=
SqlNodeType
.OuterJoinedValue) {
311
return factory.Unary(
SqlNodeType
.OuterJoinedValue, this.ExpandTogether(values));
313
case
SqlNodeType
.DiscriminatedType: {
326
case
SqlNodeType
.ClientQuery:
327
case
SqlNodeType
.Multiset:
328
case
SqlNodeType
.Element:
329
case
SqlNodeType
.Grouping:
SqlClient\Query\SqlExpressionNullability.cs (25)
25
case
SqlNodeType
.ExprSet:
29
case
SqlNodeType
.SimpleCase:
33
case
SqlNodeType
.Column:
43
case
SqlNodeType
.ColumnRef:
47
case
SqlNodeType
.Value:
50
case
SqlNodeType
.New:
51
case
SqlNodeType
.Multiset:
52
case
SqlNodeType
.Grouping:
53
case
SqlNodeType
.DiscriminatedType:
54
case
SqlNodeType
.IsNotNull: // IsNull\IsNotNull always return true or false and can never return NULL.
55
case
SqlNodeType
.IsNull:
56
case
SqlNodeType
.Exists:
59
case
SqlNodeType
.Add:
60
case
SqlNodeType
.Sub:
61
case
SqlNodeType
.Mul:
62
case
SqlNodeType
.Div:
63
case
SqlNodeType
.Mod:
64
case
SqlNodeType
.BitAnd:
65
case
SqlNodeType
.BitOr:
66
case
SqlNodeType
.BitXor:
67
case
SqlNodeType
.Concat: {
74
case
SqlNodeType
.Negate:
75
case
SqlNodeType
.BitNot: {
80
case
SqlNodeType
.Lift: {
85
case
SqlNodeType
.OuterJoinedValue:
SqlClient\Query\SqlFlattener.cs (9)
114
if (col.Expression.NodeType ==
SqlNodeType
.ExprSet && c.Expression.NodeType !=
SqlNodeType
.ExprSet) {
195
else if (expr.NodeType ==
SqlNodeType
.TypeCase) {
202
else if (expr.NodeType ==
SqlNodeType
.Link) {
213
else if (expr.NodeType ==
SqlNodeType
.OptionalValue) {
218
else if (expr.NodeType ==
SqlNodeType
.OuterJoinedValue) {
221
else if (expr.NodeType ==
SqlNodeType
.DiscriminatedType) {
229
if (expr.NodeType !=
SqlNodeType
.ColumnRef &&
230
expr.NodeType !=
SqlNodeType
.ExprSet) {
SqlClient\Query\SqlFormatter.cs (74)
81
case
SqlNodeType
.ColumnRef:
82
case
SqlNodeType
.Value:
83
case
SqlNodeType
.Member:
84
case
SqlNodeType
.Parameter:
85
case
SqlNodeType
.FunctionCall:
86
case
SqlNodeType
.TableValuedFunctionCall:
87
case
SqlNodeType
.OuterJoinedValue:
90
case
SqlNodeType
.Add:
91
case
SqlNodeType
.Mul:
92
case
SqlNodeType
.And:
93
case
SqlNodeType
.Or:
94
case
SqlNodeType
.Not:
95
case
SqlNodeType
.Not2V:
96
case
SqlNodeType
.BitAnd:
97
case
SqlNodeType
.BitOr:
98
case
SqlNodeType
.BitXor:
99
case
SqlNodeType
.BitNot:
124
case
SqlNodeType
.Not:
125
case
SqlNodeType
.Not2V:
130
case
SqlNodeType
.Negate:
131
case
SqlNodeType
.BitNot:
135
case
SqlNodeType
.Count:
136
case
SqlNodeType
.LongCount:
137
case
SqlNodeType
.Max:
138
case
SqlNodeType
.Min:
139
case
SqlNodeType
.Sum:
140
case
SqlNodeType
.Avg:
141
case
SqlNodeType
.Stddev:
142
case
SqlNodeType
.ClrLength:{
153
case
SqlNodeType
.IsNull:
154
case
SqlNodeType
.IsNotNull: {
160
case
SqlNodeType
.Convert: {
172
case
SqlNodeType
.ValueOf:
173
case
SqlNodeType
.OuterJoinedValue:
209
case
SqlNodeType
.Coalesce:
869
if (src.NodeType ==
SqlNodeType
.Join) {
1217
case
SqlNodeType
.Member:
1219
case
SqlNodeType
.Column:
1221
case
SqlNodeType
.ColumnRef:
1223
case
SqlNodeType
.ExprSet:
1317
internal virtual string GetOperator(
SqlNodeType
nt) {
1319
case
SqlNodeType
.Add: return "+";
1320
case
SqlNodeType
.Sub: return "-";
1321
case
SqlNodeType
.Mul: return "*";
1322
case
SqlNodeType
.Div: return "/";
1323
case
SqlNodeType
.Mod: return "%";
1324
case
SqlNodeType
.Concat: return "+";
1325
case
SqlNodeType
.BitAnd: return "&";
1326
case
SqlNodeType
.BitOr: return "|";
1327
case
SqlNodeType
.BitXor: return "^";
1328
case
SqlNodeType
.And: return "AND";
1329
case
SqlNodeType
.Or: return "OR";
1330
case
SqlNodeType
.GE: return ">=";
1331
case
SqlNodeType
.GT: return ">";
1332
case
SqlNodeType
.LE: return "<=";
1333
case
SqlNodeType
.LT: return "<";
1334
case
SqlNodeType
.EQ: return "=";
1335
case
SqlNodeType
.EQ2V: return "=";
1336
case
SqlNodeType
.NE: return "<>";
1337
case
SqlNodeType
.NE2V: return "<>";
1338
case
SqlNodeType
.Not: return "NOT";
1339
case
SqlNodeType
.Not2V: return "NOT";
1340
case
SqlNodeType
.BitNot: return "~";
1341
case
SqlNodeType
.Negate: return "-";
1342
case
SqlNodeType
.IsNull: return "IS NULL";
1343
case
SqlNodeType
.IsNotNull: return "IS NOT NULL";
1344
case
SqlNodeType
.Count: return "COUNT";
1345
case
SqlNodeType
.LongCount: return "COUNT_BIG";
1346
case
SqlNodeType
.Min: return "MIN";
1347
case
SqlNodeType
.Max: return "MAX";
1348
case
SqlNodeType
.Sum: return "SUM";
1349
case
SqlNodeType
.Avg: return "AVG";
1350
case
SqlNodeType
.Stddev: return "STDEV";
1351
case
SqlNodeType
.ClrLength: return "CLRLENGTH";
SqlClient\Query\SqlMethodCallConverter.cs (59)
48
return uo.NodeType ==
SqlNodeType
.Convert &&
651
if (uo.NodeType ==
SqlNodeType
.Convert) {
767
SqlExpression startIndex = sql.Binary(
SqlNodeType
.Sub, len, sql.ValueFromObject(2, false, source));
950
return sql.Binary(
SqlNodeType
.EQ, mc.Object, mc.Arguments[0]);
1002
return sql.Binary(
SqlNodeType
.Coalesce, mc.Object,
1006
return sql.Binary(
SqlNodeType
.Coalesce, mc.Object, mc.Arguments[0]);
1042
SqlExpression lower = sql.Binary(
SqlNodeType
.LT, a, b);
1043
SqlExpression equal = sql.Binary(
SqlNodeType
.EQ2V, a, b);
1193
returnValue = sql.Unary(
SqlNodeType
.Negate, mc.Object, source);
1288
case
SqlNodeType
.Sub:
1366
sql.Unary(
SqlNodeType
.Negate, right, bo.SourceExpression),
1371
sql.Unary(
SqlNodeType
.Negate, right, bo.SourceExpression),
1376
case
SqlNodeType
.Add:
1397
return sql.Binary(
SqlNodeType
.Mul, mc.Arguments[0], mc.Arguments[1]);
1399
return sql.Binary(
SqlNodeType
.Div, mc.Arguments[0], mc.Arguments[1]);
1401
return sql.Binary(
SqlNodeType
.Sub, mc.Arguments[0], mc.Arguments[1]);
1403
return sql.Binary(
SqlNodeType
.Add, mc.Arguments[0], mc.Arguments[1]);
1405
return sql.Binary(
SqlNodeType
.Mod, mc.Arguments[0], mc.Arguments[1]);
1414
return sql.Unary(
SqlNodeType
.Negate, mc.Arguments[0], source);
1480
returnValue = sql.Binary(
SqlNodeType
.EQ2V, mc.Arguments[0], mc.Arguments[1]);
1509
if (pattern.NodeType ==
SqlNodeType
.Value) {
1514
else if (pattern.NodeType ==
SqlNodeType
.ClientParameter) {
1543
if (pattern.NodeType ==
SqlNodeType
.Value) {
1548
else if (pattern.NodeType ==
SqlNodeType
.ClientParameter) {
1577
if (pattern.NodeType ==
SqlNodeType
.Value) {
1582
else if (pattern.NodeType ==
SqlNodeType
.ClientParameter) {
1611
SqlExpression lenZeroExpr = sql.Binary(
SqlNodeType
.EQ, sql.CLRLENGTH(mc.Arguments[0]), sql.ValueFromObject(0, source));
1630
SqlExpression lenZeroExpr = sql.Binary(
SqlNodeType
.EQ, sql.CLRLENGTH(mc.Arguments[0]), sql.ValueFromObject(0, source));
1631
lenZeroExpr = sql.AndAccumulate(lenZeroExpr, sql.Binary(
SqlNodeType
.LE, sql.Add(mc.Arguments[1], 1), sql.CLRLENGTH(mc.Object)));
1653
SqlExpression lenZeroExpr = sql.Binary(
SqlNodeType
.EQ, sql.CLRLENGTH(mc.Arguments[0]), sql.ValueFromObject(0, source));
1654
lenZeroExpr = sql.AndAccumulate(lenZeroExpr, sql.Binary(
SqlNodeType
.LE, sql.Add(mc.Arguments[1], 1), sql.CLRLENGTH(mc.Object)));
1689
SqlExpression notContained = sql.Binary(
SqlNodeType
.EQ, charIndex, sql.ValueFromObject(0, false, source));
1697
SqlExpression lenZeroExpr = sql.Binary(
SqlNodeType
.EQ, sql.CLRLENGTH(mc.Arguments[0]), sql.ValueFromObject(0, source));
1723
SqlExpression notContained = sql.Binary(
SqlNodeType
.EQ, charIndex, sql.ValueFromObject(0, false, source));
1732
SqlExpression lenZeroExpr = sql.Binary(
SqlNodeType
.EQ, sql.CLRLENGTH(mc.Arguments[0]), sql.ValueFromObject(0, source));
1733
lenZeroExpr = sql.AndAccumulate(lenZeroExpr, sql.Binary(
SqlNodeType
.LE, sql.Add(mc.Arguments[1], 1), sql.CLRLENGTH(s)));
1763
SqlExpression notContained = sql.Binary(
SqlNodeType
.EQ, charIndex, sql.ValueFromObject(0, false, source));
1764
notContained = sql.OrAccumulate(notContained, sql.Binary(
SqlNodeType
.LE, elseCase, sql.Subtract(i, count)));
1770
SqlExpression lenZeroExpr = sql.Binary(
SqlNodeType
.EQ, sql.CLRLENGTH(mc.Arguments[0]), sql.ValueFromObject(0, source));
1771
lenZeroExpr = sql.AndAccumulate(lenZeroExpr, sql.Binary(
SqlNodeType
.LE, sql.Add(mc.Arguments[1], 1), sql.CLRLENGTH(s)));
1798
SqlExpression insertingAtEnd = sql.Binary(
SqlNodeType
.EQ, sql.CLRLENGTH(mc.Object), mc.Arguments[0]);
1813
SqlExpression dontChange = sql.Binary(
SqlNodeType
.GE, len2, exprI);
1828
SqlExpression dontChange = sql.Binary(
SqlNodeType
.GE, sql.CLRLENGTH(exprS), exprI);
1845
SqlExpression dontChange = sql.Binary(
SqlNodeType
.GE, sql.CLRLENGTH(exprS), exprI);
1861
SqlExpression dontChange = sql.Binary(
SqlNodeType
.GE, sql.CLRLENGTH(exprS), exprI);
2021
SqlExpression minusX = sql.Unary(
SqlNodeType
.Negate, x, source);
2059
SqlExpression aLower = sql.Binary(
SqlNodeType
.LT, a, b);
2068
SqlExpression aLower = sql.Binary(
SqlNodeType
.LT, a, b);
2092
if (roundingMethod.NodeType !=
SqlNodeType
.Value) {
2108
SqlExpression condition = sql.AndAccumulate(sql.Binary(
SqlNodeType
.EQ, twiceX, round2X), sql.Binary(
SqlNodeType
.NE, x, roundX));
2127
SqlExpression minusX = sql.Unary(
SqlNodeType
.Negate, x, source);
2146
SqlExpression minusX = sql.Unary(
SqlNodeType
.Negate, x, source);
2201
result = sql.DATEADD("MILLISECOND", sql.Unary(
SqlNodeType
.Negate, ms), result);
2202
result = sql.DATEADD("SECOND", sql.Unary(
SqlNodeType
.Negate, ss), result);
2203
result = sql.DATEADD("MINUTE", sql.Unary(
SqlNodeType
.Negate, mi), result);
2204
result = sql.DATEADD("HOUR", sql.Unary(
SqlNodeType
.Negate, hh), result);
2476
if (pattern.NodeType ==
SqlNodeType
.Value) {
2482
else if (pattern.NodeType ==
SqlNodeType
.ClientParameter) {
SqlClient\Query\SqlMethodTransformer.cs (1)
59
case
SqlNodeType
.ClrLength:
SqlClient\Query\SqlMultiplexer.cs (2)
63
SqlSelect countSelect = new SqlSelect(sql.Unary(
SqlNodeType
.Count, null, sms.SourceExpression), copyAlias, sms.SourceExpression);
65
SqlExpression count = sql.SubSelect(
SqlNodeType
.ScalarSubSelect, countSelect);
SqlClient\Query\SqlNamer.cs (4)
135
case
SqlNodeType
.ColumnRef:
233
case
SqlNodeType
.Column:
235
case
SqlNodeType
.ColumnRef:
239
case
SqlNodeType
.ExprSet:
SqlClient\Query\SqlOuterApplyReducer.cs (1)
370
this.lifted = new SqlBinary(
SqlNodeType
.And, this.lifted.ClrType, this.lifted.SqlType, this.lifted, select.Where);
SqlClient\Query\SqlParameterizer.cs (6)
137
case
SqlNodeType
.EQ:
138
case
SqlNodeType
.EQ2V:
139
case
SqlNodeType
.NE:
140
case
SqlNodeType
.NE2V: {
186
case
SqlNodeType
.Parameter:
188
case
SqlNodeType
.Value:
SqlClient\Query\SqlRemoveConstantOrderBy.cs (3)
27
while (expr.NodeType ==
SqlNodeType
.DiscriminatedType) {
31
case
SqlNodeType
.Value:
32
case
SqlNodeType
.Parameter:
SqlClient\Query\SqlRetyper.cs (18)
32
if (uo.NodeType !=
SqlNodeType
.Convert && uo.Operand != null && uo.Operand.SqlType != null) {
64
if (bo.Left.NodeType ==
SqlNodeType
.Convert) {
71
if (bo.Right.NodeType ==
SqlNodeType
.Convert) {
79
if (bo.Right != null && bo.NodeType !=
SqlNodeType
.Concat) {
92
(expr, val) => (val.NodeType ==
SqlNodeType
.Value || val.NodeType ==
SqlNodeType
.ClientParameter) &&
93
!(expr.NodeType ==
SqlNodeType
.Value || expr.NodeType ==
SqlNodeType
.ClientParameter) &&
123
: this.typeProvider.PredictTypeForBinary(
SqlNodeType
.EQ, value.SqlType, valueType);
132
ProviderType providerType = this.typeProvider.PredictTypeForBinary(
SqlNodeType
.EQ, test.SqlType, valueType);
143
(like.Pattern.NodeType ==
SqlNodeType
.Value || like.Pattern.NodeType ==
SqlNodeType
.ClientParameter)) {
227
if (arg2.NodeType ==
SqlNodeType
.Value) {
234
} else if (arg2.NodeType ==
SqlNodeType
.ClientParameter && arg2.SqlType != arg1.SqlType) {
289
if (arg2.NodeType ==
SqlNodeType
.Value) {
292
else if (arg1.NodeType ==
SqlNodeType
.Value) {
295
else if (arg2.NodeType ==
SqlNodeType
.ClientParameter && arg2.SqlType != arg1.SqlType) {
298
else if (arg1.NodeType ==
SqlNodeType
.ClientParameter && arg1.SqlType != arg2.SqlType) {
SqlClient\Query\SqlSupersetValidator.cs (8)
145
if (bo.NodeType ==
SqlNodeType
.EQ || bo.NodeType ==
SqlNodeType
.NE ||
146
bo.NodeType ==
SqlNodeType
.EQ2V || bo.NodeType ==
SqlNodeType
.NE2V ||
147
bo.NodeType ==
SqlNodeType
.GT || bo.NodeType ==
SqlNodeType
.GE ||
148
bo.NodeType ==
SqlNodeType
.LT || bo.NodeType ==
SqlNodeType
.LE ) {
SqlClient\Query\SqlTopReducer.cs (1)
29
if (select.Top.NodeType ==
SqlNodeType
.Value) {
SqlClient\Query\SqlTypeConverter.cs (1)
73
if (uo.NodeType !=
SqlNodeType
.Convert) {
SqlClient\Query\Translator.cs (67)
268
result = new SqlSubSelect(
SqlNodeType
.Multiset, link.ClrType, link.SqlType, sel);
271
result = new SqlSubSelect(
SqlNodeType
.Element, link.ClrType, link.SqlType, sel);
287
expr.NodeType ==
SqlNodeType
.EQ || expr.NodeType ==
SqlNodeType
.NE ||
288
expr.NodeType ==
SqlNodeType
.EQ2V || expr.NodeType ==
SqlNodeType
.NE2V);
292
if (eRight.NodeType ==
SqlNodeType
.Element) {
298
return sql.SubSelect(
SqlNodeType
.Exists, select);
300
else if (eLeft.NodeType ==
SqlNodeType
.Element) {
306
return sql.SubSelect(
SqlNodeType
.Exists, select);
312
if (eLeft.NodeType ==
SqlNodeType
.TypeCase) {
315
if (eRight.NodeType ==
SqlNodeType
.TypeCase) {
325
(eLeft.NodeType !=
SqlNodeType
.New || eLeft.SqlType.CanBeColumn) &&
326
(eRight.NodeType !=
SqlNodeType
.New || eRight.SqlType.CanBeColumn)) {
327
if (expr.NodeType ==
SqlNodeType
.EQ2V || expr.NodeType ==
SqlNodeType
.NE2V) {
335
return sql.Binary(
SqlNodeType
.EQ, sql.ValueFromObject(0,expr.SourceExpression), sql.ValueFromObject(1,expr.SourceExpression));
362
SqlNodeType
eqKind = (expr.NodeType ==
SqlNodeType
.EQ2V || expr.NodeType ==
SqlNodeType
.NE2V) ?
SqlNodeType
.EQ2V :
SqlNodeType
.EQ;
369
exp = sql.Binary(
SqlNodeType
.And, exp, eq);
372
if (expr.NodeType ==
SqlNodeType
.NE || expr.NodeType ==
SqlNodeType
.NE2V) {
373
exp = sql.Unary(
SqlNodeType
.Not, exp, exp.SourceExpression);
378
private SqlExpression TranslateEqualsOp(
SqlNodeType
op, SqlExpression left, SqlExpression right, bool allowExpand) {
380
case
SqlNodeType
.EQ:
381
case
SqlNodeType
.NE:
383
case
SqlNodeType
.EQ2V:
386
SqlNodeType
eqOp = allowExpand ?
SqlNodeType
.EQ2V :
SqlNodeType
.EQ;
388
sql.Binary(
SqlNodeType
.Or,
389
sql.Binary(
SqlNodeType
.And,
390
sql.Unary(
SqlNodeType
.IsNull, (SqlExpression)SqlDuplicator.Copy(left)),
391
sql.Unary(
SqlNodeType
.IsNull, (SqlExpression)SqlDuplicator.Copy(right))
393
sql.Binary(
SqlNodeType
.And,
394
sql.Binary(
SqlNodeType
.And,
395
sql.Unary(
SqlNodeType
.IsNotNull, (SqlExpression)SqlDuplicator.Copy(left)),
396
sql.Unary(
SqlNodeType
.IsNotNull, (SqlExpression)SqlDuplicator.Copy(right))
403
SqlNodeType
eqOp = allowExpand ?
SqlNodeType
.EQ2V :
SqlNodeType
.EQ;
406
case
SqlNodeType
.NE2V:
409
SqlNodeType
eqOp = allowExpand ?
SqlNodeType
.EQ2V :
SqlNodeType
.EQ;
411
sql.Unary(
SqlNodeType
.Not,
412
sql.Binary(
SqlNodeType
.Or,
413
sql.Binary(
SqlNodeType
.And,
414
sql.Unary(
SqlNodeType
.IsNull, (SqlExpression)SqlDuplicator.Copy(left)),
415
sql.Unary(
SqlNodeType
.IsNull, (SqlExpression)SqlDuplicator.Copy(right))
417
sql.Binary(
SqlNodeType
.And,
418
sql.Binary(
SqlNodeType
.And,
419
sql.Unary(
SqlNodeType
.IsNotNull, (SqlExpression)SqlDuplicator.Copy(left)),
420
sql.Unary(
SqlNodeType
.IsNotNull, (SqlExpression)SqlDuplicator.Copy(right))
428
SqlNodeType
neOp = allowExpand ?
SqlNodeType
.NE2V :
SqlNodeType
.NE;
447
System.Diagnostics.Debug.Assert(expr.NodeType ==
SqlNodeType
.IsNull || expr.NodeType ==
SqlNodeType
.IsNotNull);
458
SqlNodeType
combo = (expr.NodeType ==
SqlNodeType
.IsNull) ?
SqlNodeType
.Or :
SqlNodeType
.And;
479
if (when.TypeBinding.NodeType ==
SqlNodeType
.New) {
SqlClient\Query\TypeSource.cs (16)
58
case
SqlNodeType
.ScalarSubSelect:
59
case
SqlNodeType
.Multiset:
60
case
SqlNodeType
.Element:
61
case
SqlNodeType
.SearchedCase:
62
case
SqlNodeType
.ClientCase:
63
case
SqlNodeType
.SimpleCase:
64
case
SqlNodeType
.Member:
65
case
SqlNodeType
.DiscriminatedType:
66
case
SqlNodeType
.New:
67
case
SqlNodeType
.FunctionCall:
68
case
SqlNodeType
.MethodCall:
69
case
SqlNodeType
.Convert: // Object identity does not survive convert. It does survive Cast.
72
case
SqlNodeType
.TypeCase:
75
case
SqlNodeType
.Link:
78
case
SqlNodeType
.Table:
81
case
SqlNodeType
.Value:
SqlClient\Reader\ObjectReaderCompiler.cs (66)
349
case
SqlNodeType
.New: {
363
case
SqlNodeType
.ColumnRef:
364
case
SqlNodeType
.Value:
365
case
SqlNodeType
.UserColumn:
367
case
SqlNodeType
.Link: {
376
case
SqlNodeType
.OptionalValue:
378
case
SqlNodeType
.ValueOf:
379
case
SqlNodeType
.OuterJoinedValue:
381
case
SqlNodeType
.Lift:
383
case
SqlNodeType
.Grouping: {
387
case
SqlNodeType
.ClientArray: {
400
case
SqlNodeType
.ClientCase: {
410
case
SqlNodeType
.SearchedCase: {
420
case
SqlNodeType
.TypeCase: {
435
case
SqlNodeType
.DiscriminatedType:
437
case
SqlNodeType
.JoinedCollection: {
441
case
SqlNodeType
.Member:
443
case
SqlNodeType
.MethodCall: {
455
case
SqlNodeType
.ClientQuery:
457
case
SqlNodeType
.ClientParameter:
478
case
SqlNodeType
.New: {
498
case
SqlNodeType
.ColumnRef: {
503
case
SqlNodeType
.Link: {
519
case
SqlNodeType
.Value:
521
case
SqlNodeType
.OptionalValue: {
526
case
SqlNodeType
.ValueOf:
527
case
SqlNodeType
.OuterJoinedValue:
529
case
SqlNodeType
.Lift:
531
case
SqlNodeType
.Grouping: {
536
case
SqlNodeType
.ClientArray: {
549
case
SqlNodeType
.UserColumn:
551
case
SqlNodeType
.ClientCase: {
565
case
SqlNodeType
.SearchedCase: {
578
case
SqlNodeType
.TypeCase: {
597
case
SqlNodeType
.DiscriminatedType: {
602
case
SqlNodeType
.JoinedCollection: {
607
case
SqlNodeType
.Member: {
612
case
SqlNodeType
.ClientQuery: {
625
case
SqlNodeType
.MethodCall: {
641
case
SqlNodeType
.ClientParameter:
729
case
SqlNodeType
.New:
731
case
SqlNodeType
.ColumnRef:
733
case
SqlNodeType
.ClientQuery:
735
case
SqlNodeType
.JoinedCollection:
737
case
SqlNodeType
.Link:
739
case
SqlNodeType
.Value:
741
case
SqlNodeType
.ClientParameter:
743
case
SqlNodeType
.ValueOf:
745
case
SqlNodeType
.OptionalValue:
747
case
SqlNodeType
.OuterJoinedValue:
749
case
SqlNodeType
.Lift:
751
case
SqlNodeType
.Grouping:
753
case
SqlNodeType
.ClientArray:
755
case
SqlNodeType
.UserColumn:
757
case
SqlNodeType
.ClientCase:
759
case
SqlNodeType
.SearchedCase:
761
case
SqlNodeType
.TypeCase:
763
case
SqlNodeType
.DiscriminatedType:
765
case
SqlNodeType
.Member:
767
case
SqlNodeType
.MethodCall:
1330
if (expr.NodeType ==
SqlNodeType
.Link) {
1333
else if (expr.NodeType ==
SqlNodeType
.ClientCase) {
1409
if (expr.NodeType ==
SqlNodeType
.ClientCase) {
1412
else if (expr.NodeType ==
SqlNodeType
.Link) {
1421
Type clientElementType = cq.Query.NodeType ==
SqlNodeType
.Multiset ? TypeSystem.GetElementType(cq.ClrType) : cq.ClrType;
1435
if (cq.Arguments[i].NodeType ==
SqlNodeType
.ColumnRef) {
SqlClient\SqlProvider.cs (4)
970
Type clientElementType = cq.Query.NodeType ==
SqlNodeType
.Multiset ? TypeSystem.GetElementType(cq.ClrType) : cq.ClrType;
1626
case
SqlNodeType
.Select:
1628
case
SqlNodeType
.Block: {
1639
if (sel == null && node.NodeType ==
SqlNodeType
.Block) {
SqlClient\SqlTypeSystemProvider.cs (41)
1052
internal override ProviderType PredictTypeForUnary(
SqlNodeType
unaryOp, ProviderType operandType) {
1054
case
SqlNodeType
.Not:
1055
case
SqlNodeType
.Not2V:
1056
case
SqlNodeType
.IsNull:
1057
case
SqlNodeType
.IsNotNull:
1059
case
SqlNodeType
.Negate:
1060
case
SqlNodeType
.BitNot:
1061
case
SqlNodeType
.ValueOf:
1062
case
SqlNodeType
.Treat:
1063
case
SqlNodeType
.OuterJoinedValue:
1065
case
SqlNodeType
.Count:
1067
case
SqlNodeType
.LongCount:
1069
case
SqlNodeType
.Min:
1070
case
SqlNodeType
.Max:
1072
case
SqlNodeType
.Sum:
1073
case
SqlNodeType
.Avg:
1074
case
SqlNodeType
.Stddev:
1076
case
SqlNodeType
.ClrLength:
1089
internal override ProviderType PredictTypeForBinary(
SqlNodeType
binaryOp, ProviderType leftType, ProviderType rightType) {
1100
case
SqlNodeType
.Add:
1101
case
SqlNodeType
.Sub:
1102
case
SqlNodeType
.Mul:
1103
case
SqlNodeType
.Div:
1104
case
SqlNodeType
.BitAnd:
1105
case
SqlNodeType
.BitOr:
1106
case
SqlNodeType
.BitXor:
1107
case
SqlNodeType
.Mod:
1108
case
SqlNodeType
.Coalesce:
1110
case
SqlNodeType
.Concat:
1134
case
SqlNodeType
.And:
1135
case
SqlNodeType
.Or:
1136
case
SqlNodeType
.LT:
1137
case
SqlNodeType
.LE:
1138
case
SqlNodeType
.GT:
1139
case
SqlNodeType
.GE:
1140
case
SqlNodeType
.EQ:
1141
case
SqlNodeType
.NE:
1142
case
SqlNodeType
.EQ2V:
1143
case
SqlNodeType
.NE2V:
1238
if (functionCall.Arguments[2].NodeType ==
SqlNodeType
.Value) {
1272
return PredictTypeForBinary(
SqlNodeType
.Concat,