Skip to content

Problem with NULL filter condition #3

@SlavaUtesinov

Description

@SlavaUtesinov

I tried to use jsreport-mssql-store and I wanted to import export.zip file from current storage to new one. I had two files with same names but located at different folders: root and specific named folder. Script from root folder was not imported due to ignoring of { folder: null } (I suppose, null means root) condition, as a result false duplicate was found with same name but from another folder. Obvious inappropriate warning message "Entity with name "ScriptName" already exists at the root level...." was shown.

This is a problem at filter.js file particular at doFilter function. When condition looks like { columnName: null } it will be ignored due to if (filter[el]) clause. Moreover there is not IS NULL case at all.

module.exports = function doFilter (query, table, filter, entityType) {
  for (var el in filter) {
    if (filter[el]) {
      query = getOperation(el, filter[el])(query, table, el, filter[el], 'where', entityType[el] || entityType)
    }
  }

  return query
}

Actual behavior - generated query looks like: select * from table.
Expected behavior - generated query has to look like: select * from table where columnName is null.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions