From d8b0fbd1208924ec2f025173a45ed1b798eea96c Mon Sep 17 00:00:00 2001 From: Kasper Svendsen Date: Mon, 7 Sep 2026 10:08:59 +0200 Subject: [PATCH] C#: Disable dynamic join ordering for select predicate --- csharp/ql/lib/semmle/code/csharp/commons/QualifiedName.qll | 1 + csharp/ql/src/Language Abuse/SimplifyBoolExpr.ql | 1 + 2 files changed, 2 insertions(+) diff --git a/csharp/ql/lib/semmle/code/csharp/commons/QualifiedName.qll b/csharp/ql/lib/semmle/code/csharp/commons/QualifiedName.qll index 6fef9cc24571..bc5d1990d954 100644 --- a/csharp/ql/lib/semmle/code/csharp/commons/QualifiedName.qll +++ b/csharp/ql/lib/semmle/code/csharp/commons/QualifiedName.qll @@ -173,6 +173,7 @@ module QualifiedName { * Holds if declaration `d` has name `name` and is defined in type `type` * with namespace `namespace`. */ + pragma[no_dynamic_join_order] predicate hasQualifiedName(Declaration d, string namespace, string type, string name) { hasQualifiedName(d.getDeclaringType(), namespace, type) and ( diff --git a/csharp/ql/src/Language Abuse/SimplifyBoolExpr.ql b/csharp/ql/src/Language Abuse/SimplifyBoolExpr.ql index 5656da73af71..7f7c7fde11b4 100644 --- a/csharp/ql/src/Language Abuse/SimplifyBoolExpr.ql +++ b/csharp/ql/src/Language Abuse/SimplifyBoolExpr.ql @@ -108,6 +108,7 @@ predicate negatedOperators(string op, string negated) { } /** Holds if replacing `expr` with `operatorName` could call an enclosing operator. */ +pragma[no_dynamic_join_order] private predicate couldCallEnclosingOperator(LogicalNotExpr expr, string operatorName) { exists(BinaryOperation binary, Operator enclosingOperator | binary = expr.getOperand() and