sqlparser-devexpress 2.3.15 → 2.3.16

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.3.15",
3
+ "version": "2.3.16",
4
4
  "main": "src/index.js",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -410,6 +410,10 @@ function DevExpressConverter() {
410
410
 
411
411
  if ((left !== null && isNaN(left)) || (right !== null && isNaN(right))) return null;
412
412
 
413
+ // Handle NULL == 0 OR NULL == "" cases
414
+ if (left === null && (right == 0 || right == "")) return true;
415
+ if (right === null && (left == 0 || left == "")) return true;
416
+
413
417
  if (left === null || right === null) {
414
418
  if (operator === '=' || operator === '==') return left === right;
415
419
  if (operator === '<>' || operator === '!=') return left !== right;
@@ -232,6 +232,34 @@ describe("Parser SQL to dx Filter Builder", () => {
232
232
  "or",
233
233
  ["CompanyID", "!=", 8, { "type": "IS NOT" }, 8]
234
234
  ]
235
+ },
236
+ {
237
+ input: "null = 0",
238
+ expected: []
239
+ },
240
+ {
241
+ input: "null = null",
242
+ expected: []
243
+ },
244
+ {
245
+ input: "null = {SaleOrderStatusStmtGlobalRpt.StateID}",
246
+ expected: []
247
+ },
248
+ {
249
+ input: "null = {SaleOrderStatusStmtGlobalRpt.RegionID}",
250
+ expected: []
251
+ },
252
+ {
253
+ input: "null = {LeadDocument.CompanyID}",
254
+ expected: []
255
+ },
256
+ {
257
+ input: "{LeadDocument.BranchID} = null",
258
+ expected: []
259
+ },
260
+ {
261
+ input: "{LeadDocument.AllowSubDealer} != null",
262
+ expected: []
235
263
  }
236
264
  ];
237
265