Browse Source

- implemented NOT operator in SQLiteQueryProvider

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@5020 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Siegfried Pammer 16 years ago
parent
commit
4ada7017c9
  1. 6
      src/AddIns/Misc/Profiler/Controller/Data/Linq/ExpressionSqlWriter.cs
  2. 10
      src/AddIns/Misc/Profiler/Controller/Data/Linq/SQLiteQueryProvider.cs

6
src/AddIns/Misc/Profiler/Controller/Data/Linq/ExpressionSqlWriter.cs

@ -106,6 +106,12 @@ namespace ICSharpCode.Profiler.Controller.Data.Linq @@ -106,6 +106,12 @@ namespace ICSharpCode.Profiler.Controller.Data.Linq
throw new NotSupportedException(mc.Method.ToString());
}
}
case ExpressionType.Not:
w.Write("(NOT ");
UnaryExpression unary = (UnaryExpression)expression;
w.Write(unary.Operand);
w.Write(")");
break;
default:
throw new NotSupportedException(expression.NodeType.ToString());
}

10
src/AddIns/Misc/Profiler/Controller/Data/Linq/SQLiteQueryProvider.cs

@ -48,6 +48,7 @@ namespace ICSharpCode.Profiler.Controller.Data.Linq @@ -48,6 +48,7 @@ namespace ICSharpCode.Profiler.Controller.Data.Linq
The set of valid expressions is:
- Integer constants
- Binary operators: < <= > >= == != && ||
- Unary operator: !
- value(List<int>).Contains(validExpr)
- if c is the lambda parameter, then these expressions are valid:
c.NameMapping.ID
@ -111,7 +112,7 @@ namespace ICSharpCode.Profiler.Controller.Data.Linq @@ -111,7 +112,7 @@ namespace ICSharpCode.Profiler.Controller.Data.Linq
Because all constructed SELECT queries always select fields with the same meaning in the same order, executing the query is
a matter of simply filling the SQLiteCallTreeNodes with the query results.
*/
*/
readonly ProfilingDataSQLiteProvider sqliteProvider;
internal readonly int startDataSetID;
@ -307,6 +308,13 @@ namespace ICSharpCode.Profiler.Controller.Data.Linq @@ -307,6 +308,13 @@ namespace ICSharpCode.Profiler.Controller.Data.Linq
else
return null;
}
case ExpressionType.Not:
UnaryExpression unary = (UnaryExpression)expr;
Expression imported = Import(unary.Operand);
if (imported != null)
return Expression.Not(imported);
else
return null;
default:
return null;
}

Loading…
Cancel
Save