Icinga / Icinga/ipl-orm

Expression columns do not work in where clause

Open
#75 1 comment 0 reactions 1 assignee View on GitHub

@nilmerg is already working on this.

Since Oct 12, 2022.

bug
Dominant language
PHP
Stars
1
Forks
1
Avg merge
1h 26m
Merged PRs (30d)
1

Description

If a column has expression as value, the column does not exist in where clause.

Example:

Table news has a expression column sent. Filter creates the following query:

SELECT news.id,
       news.title,
       news.sent_on,
       (CASE WHEN news.sent_on IS NOT NULL THEN 1 ELSE 0 END) AS sent,
FROM news
WHERE news.sent = 1 // column sent does not exist here
ORDER BY news.sent_on DESC;

Additional:

Have a look at this Stack Overflow example

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.