sqlparser-devexpress 2.5.8 → 2.5.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sqlparser-devexpress",
3
- "version": "2.5.8",
3
+ "version": "2.5.9",
4
4
  "main": "src/index.js",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -240,7 +240,10 @@ function DevExpressConverter() {
240
240
  // Apply short-circuit evaluation if enabled
241
241
  // Skip for "IS NOT" (e.g. "col IS NOT NULL"): its null is a literal from the query
242
242
  // itself, not a placeholder resolving to null, so it must remain a real filter.
243
- if (EnableShortCircuit && IsValueNullShortCircuit && originalOperator !== "IS NOT" && (left == null || right == null)) {
243
+ // Avoid null short-circuit when comparison is produced from ISNULL(column, default),
244
+ // otherwise OR branches like ISNULL(CompanyID,0)=param OR ISNULL(CompanyID,0)=0
245
+ // can collapse to a full-match filter when param is null.
246
+ if (EnableShortCircuit && IsValueNullShortCircuit && originalOperator !== "IS NOT" && (left == null || right == null) && !isLeftNullCheck && !isRightNullCheck) {
244
247
  return true; // If either value is null, return true for short-circuit evaluation
245
248
  }
246
249
 
@@ -359,10 +362,6 @@ function DevExpressConverter() {
359
362
  }
360
363
  }
361
364
 
362
- if (EnableShortCircuit && IsValueNullShortCircuit && (ast.field?.type === "placeholder" || ast.value?.type === "placeholder" || ast.value === null) && resolvedValue === null) {
363
- return true;
364
- }
365
-
366
365
  let operatorToken = operator === "IN" ? '=' : operator === "NOT IN" ? '!=' : operator;
367
366
  let joinOperatorToken = operator === "IN" ? 'or' : operator === "NOT IN" ? 'and' : operator;
368
367
  let field = convertValue(ast.field);
@@ -276,7 +276,7 @@ describe("Parser SQL to dx Filter Builder", () => {
276
276
  },
277
277
  {
278
278
  input: "ID IN ({SaleOrderStatusStmtGlobalRpt.RegionID})",
279
- expected: []
279
+ expected: ["ID","=",null]
280
280
  },
281
281
  {
282
282
  input: "10 < ID AND ApplicableUoms IN ({WorkOrderLine.ApplicableUoms})",