Project

General

Profile

Actions

Bug #5304

closed

[API] filters incorrectly exclude results for records with null value in filtered field

Added by Ward Vandewege almost 10 years ago. Updated almost 10 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Radhika Chippada
Category:
API
Target version:
Story points:
0.5

Description

There appears to be a bug in our filter code on the API side, where a call like this:

arv group list --filters='[["group_class", "!=", "project"]]'

does not return any groups where group_class is set to null. Of course group_class should probably not be set to null, but that is irrelevant; the filter should not exclude those records from this call.

The workbench code uses a functionally identical API call to show the list of groups on the sharing screen.


Subtasks 1 (0 open1 closed)

Task #5430: Review branch: 5304-include-nulls-when-notequal-filterResolvedRadhika Chippada03/10/2015Actions

Related issues 1 (0 open1 closed)

Related to Arvados - Bug #3819: [Workbench] It's not possible to share a project with the 'All Users' groupResolvedWard VandewegeActions
Actions #1

Updated by Ward Vandewege almost 10 years ago

  • Description updated (diff)
Actions #2

Updated by Ward Vandewege almost 10 years ago

  • Description updated (diff)
Actions #3

Updated by Ward Vandewege almost 10 years ago

  • Description updated (diff)
Actions #4

Updated by Brett Smith almost 10 years ago

  • Category set to API

I note this code in record_filters.rb:

           if operator == 'not in' and not operand.include?(nil)
              # explicitly allow NULL
              cond_out[-1] = "(#{cond_out[-1]} OR #{ar_table_name}.#{attr} IS NULL)" 
            end

This makes me think we need similar logic for equality operators.

Actions #5

Updated by Tom Clegg almost 10 years ago

Agreed. The SQL way of thinking (NULL == 1 is false, and NULL <> 1 is also false) seems confusing enough to be worth explicitly breaking away from.

Actions #6

Updated by Radhika Chippada almost 10 years ago

  • Status changed from New to In Progress
  • Assigned To set to Radhika Chippada
  • Target version changed from Bug Triage to 2015-03-11 sprint
Actions #7

Updated by Brett Smith almost 10 years ago

Commit:c68037a looks great. Go ahead and merge. Thanks.

Actions #8

Updated by Radhika Chippada almost 10 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100

Applied in changeset arvados|commit:83c0e051c3611b021d7f0e2ea58d10c67c92698d.

Actions #9

Updated by Ward Vandewege almost 10 years ago

  • Story points set to 0.5
Actions

Also available in: Atom PDF