← xor operator page · boolean/xor/sc_sc/both_operands_null

Both operands null 🟢 all ok

pandas ✅ · DuckDB ✅

Tests:

SC_1 xor SC_2 with both operands null: SC_1 and SC_2 are null Booleans.

Manual:

Exclusive disjunction: "false xor null gives null", "true xor null gives null" and "null xor null gives null"; the page's sentence "returns true if only one of the operand is true (but not both), false otherwise" conflicts with its null rows (false xor null is null, not false), and the listed rows govern.

Expected:

SC_r is null, a Boolean, as in the row "null xor null gives null".

script.vtl ⇩

SC_r := SC_1 xor SC_2;

input/scalars.csv ⇩

SC_1SC_2

input/scalars.json ⇩

{
  "scalars": [
    {"name": "SC_1", "type": "Boolean"},
    {"name": "SC_2", "type": "Boolean"}
  ]
}

expected/scalars.json ⇩

{
  "scalars": [
    {"name": "SC_r", "type": "Boolean", "value": null}
  ]
}