Skip to content

For binary logic, the negation of LT and GT is not GE and LE, but NotLT and NotGT. #3

@shellyln

Description

@shellyln

In the distribution process of the NOT operator in the WHERE clause, for binary logic, the negation of LT and GT is not GE and LE, but NotLT and NotGT.
(In the case of ternary logic, the negation of LT and GT is GE and LE.)

func distributeNotOperators(conditions []SoqlCondition) []SoqlCondition {
for i := 0; i < len(conditions); i++ {
switch conditions[i].Opcode {
case SoqlConditionOpcode_Not:
for j := 0; j < i; j++ {
switch conditions[j].Opcode {
case SoqlConditionOpcode_And:
conditions[j].Opcode = SoqlConditionOpcode_Or
case SoqlConditionOpcode_Or:
conditions[j].Opcode = SoqlConditionOpcode_And
case SoqlConditionOpcode_Eq:
conditions[j].Opcode = SoqlConditionOpcode_NotEq
case SoqlConditionOpcode_NotEq:
conditions[j].Opcode = SoqlConditionOpcode_Eq
case SoqlConditionOpcode_Lt:
conditions[j].Opcode = SoqlConditionOpcode_Ge
case SoqlConditionOpcode_Le:
conditions[j].Opcode = SoqlConditionOpcode_Gt
case SoqlConditionOpcode_Gt:
conditions[j].Opcode = SoqlConditionOpcode_Le
case SoqlConditionOpcode_Ge:
conditions[j].Opcode = SoqlConditionOpcode_Lt

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions