Skip to content

Add null-safe comparison operator#652

Merged
lvca merged 2 commits intoArcadeData:mainfrom
gramian:main
Dec 1, 2022
Merged

Add null-safe comparison operator#652
lvca merged 2 commits intoArcadeData:mainfrom
gramian:main

Conversation

@gramian
Copy link
Collaborator

@gramian gramian commented Nov 30, 2022

What does this PR do?

This PR adds a null-safe comparison operator. The token <=> is used for this equality operator that is also true if both arguments are null

Motivation

What inspired you to submit this pull request?
MariaDB and SQlite both have a similar feature, which can be useful for data cleaning.

Related issues

Additional Notes

  • I basically copy-pasted the EqualsCompareOperator.java and added a check that if both argument objects are null, true is returned, before the QueryOperatorEquals.equals() method is called, which in turn would return false for two null arguments.

  • I am not sure anymore ArcadeDB is fully "null-unsafe" anymore, as all comparing methods return booleans, so a null return value is not planned. Now, I assume all comparisons with null are false and not null, is this correct? If so, my solution should be sufficient.

  • I only appended the grammar defintion and the NullSafeEqualsCompareOperator.java file, the other changes result seemed to have happened during compile / grammar rebuild.

  • Due to IF function does not work #564 I cannot easily test this elaborately.

  • I have not added unit tests. I only tested some simple cases as in the original issue yet.

Checklist

  • I have run the build using mvn clean package command
  • My unit tests cover both failure and success scenarios

@lvca lvca merged commit 0824269 into ArcadeData:main Dec 1, 2022
@lvca lvca assigned lvca and gramian Dec 1, 2022
@lvca lvca added the enhancement New feature or request label Dec 1, 2022
@lvca lvca added this to the 22.11.1 milestone Dec 1, 2022
@lvca
Copy link
Member

lvca commented Dec 1, 2022

Added test cases, seems to work properly. My query test was a simple 👍

SELECT FROM V WHERE notExistent <=> null

The semantic is a little bit different from MariaDB's operator where it returns 0 or 1, instead of true or false (as you mentioned):

https://mariadb.com/kb/en/null-safe-equal/

@lvca
Copy link
Member

lvca commented Dec 1, 2022

Thanks @gramian!

mergify bot added a commit that referenced this pull request Mar 3, 2026
…r-webpack-plugin in /studio [skip ci]

Removes [serialize-javascript](https://github.com/yahoo/serialize-javascript). It's no longer used after updating ancestor dependencies [serialize-javascript](https://github.com/yahoo/serialize-javascript), [copy-webpack-plugin](https://github.com/webpack/copy-webpack-plugin) and [terser-webpack-plugin](https://github.com/webpack/terser-webpack-plugin). These dependencies need to be updated together.
Removes `serialize-javascript`
Updates `copy-webpack-plugin` from 13.0.1 to 14.0.0
Release notes

*Sourced from [copy-webpack-plugin's releases](https://github.com/webpack/copy-webpack-plugin/releases).*

> v14.0.0
> -------
>
> [14.0.0](webpack/copy-webpack-plugin@v13.0.1...v14.0.0) (2026-03-02)
> -----------------------------------------------------------------------------------------------
>
> ### ⚠ BREAKING CHANGES
>
> * minimum supported `Node.js` version is `20.9.0` ([#819](https://redirect.github.com/webpack/copy-webpack-plugin/issues/819)) ([2881203](webpack/copy-webpack-plugin@2881203))
>
> ### Bug Fixes
>
> * update `serialize-javascript` to fix security problems


Changelog

*Sourced from [copy-webpack-plugin's changelog](https://github.com/webpack/copy-webpack-plugin/blob/main/CHANGELOG.md).*

> [14.0.0](webpack/copy-webpack-plugin@v13.0.1...v14.0.0) (2026-03-02)
> -----------------------------------------------------------------------------------------------
>
> ### ⚠ BREAKING CHANGES
>
> * minimum supported `Node.js` version is `20.9.0` ([#819](https://redirect.github.com/webpack/copy-webpack-plugin/issues/819)) ([2881203](webpack/copy-webpack-plugin@2881203))
>
> ### Bug Fixes
>
> * update `serialize-javascript` to fix security problems


Commits

* [`18eb9d9`](webpack/copy-webpack-plugin@18eb9d9) chore(release): 14.0.0
* [`2881203`](webpack/copy-webpack-plugin@2881203) refactor!: minimum supported `Node.js` version is `20.9.0` ([#819](https://redirect.github.com/webpack/copy-webpack-plugin/issues/819))
* [`9dc3d31`](webpack/copy-webpack-plugin@9dc3d31) chore(deps-dev): bump ajv from 6.12.6 to 6.14.0 ([#815](https://redirect.github.com/webpack/copy-webpack-plugin/issues/815))
* [`5cf5a1d`](webpack/copy-webpack-plugin@5cf5a1d) chore(deps): update ([#814](https://redirect.github.com/webpack/copy-webpack-plugin/issues/814))
* [`3dd5b6e`](webpack/copy-webpack-plugin@3dd5b6e) chore(deps): bump js-yaml ([#813](https://redirect.github.com/webpack/copy-webpack-plugin/issues/813))
* [`9ac38bb`](webpack/copy-webpack-plugin@9ac38bb) chore(deps-dev): bump lodash from 4.17.21 to 4.17.23 ([#812](https://redirect.github.com/webpack/copy-webpack-plugin/issues/812))
* [`6a16bac`](webpack/copy-webpack-plugin@6a16bac) Update link to contributing guidelines in README
* [`a1625f9`](webpack/copy-webpack-plugin@a1625f9) chore: migrate from contrib ([#810](https://redirect.github.com/webpack/copy-webpack-plugin/issues/810))
* [`9f6f204`](webpack/copy-webpack-plugin@9f6f204) chore: update github actions/checkout from v4 to v5 ([#809](https://redirect.github.com/webpack/copy-webpack-plugin/issues/809))
* See full diff in [compare view](webpack/copy-webpack-plugin@v13.0.1...v14.0.0)
  
Updates `terser-webpack-plugin` from 5.3.16 to 5.3.17
Release notes

*Sourced from [terser-webpack-plugin's releases](https://github.com/webpack/terser-webpack-plugin/releases).*

> v5.3.17
> -------
>
> ### [5.3.17](webpack/terser-webpack-plugin@v5.3.16...v5.3.17) (2026-03-03)
>
> ### Bug Fixes
>
> * update `serialize-javascript` ([37c490c](webpack/terser-webpack-plugin@37c490c))


Changelog

*Sourced from [terser-webpack-plugin's changelog](https://github.com/webpack/terser-webpack-plugin/blob/main/CHANGELOG.md).*

> ### [5.3.17](webpack/terser-webpack-plugin@v5.3.16...v5.3.17) (2026-03-03)
>
> ### Bug Fixes
>
> * update `serialize-javascript` ([37c490c](webpack/terser-webpack-plugin@37c490c))


Commits

* [`6f911ff`](webpack/terser-webpack-plugin@6f911ff) chore(release): 5.3.17
* [`37c490c`](webpack/terser-webpack-plugin@37c490c) fix: update `serialize-javascript`
* [`207764f`](webpack/terser-webpack-plugin@207764f) chore: deps update ([#652](https://redirect.github.com/webpack/terser-webpack-plugin/issues/652))
* [`a85ab47`](webpack/terser-webpack-plugin@a85ab47) chore(deps-dev): bump ajv from 6.12.6 to 6.14.0 ([#648](https://redirect.github.com/webpack/terser-webpack-plugin/issues/648))
* See full diff in [compare view](webpack/terser-webpack-plugin@v5.3.16...v5.3.17)
  
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
  
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot show  ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/ArcadeData/arcadedb/network/alerts).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants