Skip to content

Predicates comparison fixes #4748

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 36 commits into
base: master
Choose a base branch
from
Draft

Predicates comparison fixes #4748

wants to merge 36 commits into from

Conversation

MaceWindu
Copy link
Contributor

@MaceWindu MaceWindu commented Dec 20, 2024

Implemented fixes:

  • [Informix] fix generated SQL for NULL [NOT] IN (...) predicate
  • fix Sql.Expression with IsPredicate=true handling as predicate in comparison expressions
  • don't generate wrappers for boolean comparison arguments if provider supports comparison of boolean values/predicates
  • enable support for boolean comparison support for Access and PostgreSQL
  • eliminate UNKNOWN values for nested binary predicates if predicate is not expected to return UNKNOWN
  • fix issues predicate IS NULL generation from JOIN with nullable expression is not working #4875
  • better IS NULL reduction
  • [Informix] fix of boolean parameter use as predicate
  • fix string.Compare translation issues
  • fix remote context predicates optimizations applied differently
  • perform all predicate optimizations from SqlExpressionOptimizerVisitor (remove duplication logic from SqlBuilder/SqlExpressionConvertVisitor/SelectQueryOptimizerVisitor code)
  • extend SqlSearchCondition with bool? CanReturnUnknown flag to indicate that it could (not) return UNKNOWN as it is hard to infer such information in many cases
  • extend NullabilityContext with option to override expression nullability on context level
  • fix many other discovered incorrect predicate optimizations/evaluations
  • use IS [NOT] NULL X predicates to strip nullability from X in search condition to simplify it
  • cleanup SqlSearchCondition from some duplicate IS NULL checks. Fix Strange WHERE predicate begin generated when check for NULL #1767

Remaining:

  • test if Sql.FunctionAttribute.IsPredicate is ignored #4933 issue fixed by this PR
  • baselines: QueryTakesForever4394/Issue4337_TestComplexQueryWms : doesn't reduce single-predicate nested condition leading to generation of wrapping brackets (...)
  • baselines: ComplexIsNullPredicateTest: new sql not reviewed yet
  • baselines: [northwind] GroupByAggregate/GroupByAggregate2 generate subquery IS NULL instead of old generation
  • baselines: [informix] Issue4520Test generates duble wrapping

@MaceWindu MaceWindu added this to the 6.0.0-rc.1 milestone Dec 20, 2024
@MaceWindu MaceWindu modified the milestones: 6.0.0-preview.4, 6.0.0-rc.1 Mar 26, 2025
MaceWindu added 4 commits May 6, 2025 17:57
* predicate fixes

* fix use of informix boolean parameter as predicate

* fix isnull predicate regression

* another IsTrue regression fix

* final IsTrue translation fix?

* fix ExprExpr inequality reduce regression

* add more string.Compare testcases with fixes

* comment unused code, fix linqservice executereader in consistent behavior

* fix baselines regression

* revert in wait for proper fix

* disable failing unrelated tests for now

* fix predicate issues for remote context

* improve exprexpr eval

* fix conditional optimization

* cleanup

* fix oracle empty string support regression

* use IS [NOT] NULL checks nullability information to simplify search conditions

* fix error on duplicated IS NULL, remove duplicates

* fix build
@MaceWindu MaceWindu force-pushed the issue/predicate-fixes branch from 54a285e to 91a8e4b Compare May 15, 2025 11:33
@linq2db linq2db deleted a comment from azure-pipelines bot May 16, 2025
@linq2db linq2db deleted a comment from azure-pipelines bot May 16, 2025
@linq2db linq2db deleted a comment from azure-pipelines bot May 16, 2025
@linq2db linq2db deleted a comment from azure-pipelines bot May 16, 2025
@linq2db linq2db deleted a comment from azure-pipelines bot May 16, 2025
@linq2db linq2db deleted a comment from azure-pipelines bot May 16, 2025
@linq2db linq2db deleted a comment from azure-pipelines bot May 16, 2025
@linq2db linq2db deleted a comment from azure-pipelines bot May 16, 2025
@linq2db linq2db deleted a comment from azure-pipelines bot May 16, 2025
@MaceWindu
Copy link
Contributor Author

/azp run test-all

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@MaceWindu
Copy link
Contributor Author

/azp run test-all

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@MaceWindu
Copy link
Contributor Author

/azp run test-all

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@MaceWindu
Copy link
Contributor Author

/azp run test-all

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@MaceWindu
Copy link
Contributor Author

/azp run test-all

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@linq2dbot
Copy link

Test baselines changed by this PR. Don't forget to merge/close baselines PR after this pr merged/closed.

@MaceWindu
Copy link
Contributor Author

/azp run test-all

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Strange WHERE predicate begin generated when check for NULL
4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy