Skip to content

Allow == and != against empty string - #401

Open
mgaffigan wants to merge 1 commit into
OpenIntegrationEngine:mainfrom
mgaffigan:feat/search-empty-metadata
Open

Allow == and != against empty string#401
mgaffigan wants to merge 1 commit into
OpenIntegrationEngine:mainfrom
mgaffigan:feat/search-empty-metadata

Conversation

@mgaffigan

@mgaffigan mgaffigan commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Closes #300

Example channel for testing
search for empty string.xml

Test matrix:

  1. Searching for == '' works on message with matching empty metadata
  2. Searching for != '' works on message with matching populated metadata
  3. Searching for == '' does not match on message with populated metadata
  4. Searching for != '' does not match on message with empty metadata
  5. Other filter operators continue being ignored if the value is ''

Not supported on Oracle.

Signed-off-by: Mitch Gaffigan <mitch.gaffigan@comcast.net>
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

Test Results

666 tests  +3   666 ✅ +3   2m 24s ⏱️ + 1m 7s
112 suites +1     0 💤 ±0 
112 files   +1     0 ❌ ±0 

Results for commit 2b2d4fe. ± Comparison against base commit 762e072.

@pacmano1

pacmano1 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Is "metadata explicitly set to empty string" the intended scope? Blank == won't match messages where the variable was never set — those are NULL in D_MCM (or no row at all if the message had no metadata), and the admin tool renders all three states identically as blank. Having dug in, ''-only looks like the only clean semantics short of restructuring the search, so maybe just worth a line in the PR body.

Oracle is the real problem: verified against Oracle 23 Free with ojdbc8 that setString("") into the VARCHAR2(255 CHAR) metadata column stores NULL, and a bound '' matches zero rows with both = and !=. So on Oracle blank == can never match, and blank != goes from "row ignored" to "always zero results". Suggest an IS NULL/IS NOT NULL special case in oracle-message.xml, or an explicit "not supported on Oracle" note.

@mgaffigan

Copy link
Copy Markdown
Contributor Author

@pacmano1, the intent is indeed "empty string". I agree that a future "not set" filter may be valuable (especially on oracle, which weirdly considers '' is null to be true).

@kryskool

Copy link
Copy Markdown
Contributor

Hi @mgaffigan

Why not use a new "null or empty" checkbox instead of leaving the value field blank, which can be ambiguous?
this would make it easier to handle the issue raised by @pacmano1

Regards,

@mgaffigan

Copy link
Copy Markdown
Contributor Author

Why not use a new "null or empty" checkbox instead of leaving the value field blank, which can be ambiguous?

Because equals empty was already supported by the backend, it only required the client to allow it.

I agree that future work to compare null would be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Can't search for empty metadata

3 participants