Skip to content
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

IBX-3791: Fixed DFS queries for Postgres #334

Merged
merged 5 commits into from
Sep 12, 2022
Merged

Conversation

Steveb-p
Copy link
Contributor

@Steveb-p Steveb-p commented Sep 2, 2022

Question Answer
JIRA issue IBX-3791
Type bug
Target Ibexa version v3.3
BC breaks no

This PR allows DFS to work with Postgres database on a best effort basis.

It replaces two things:

  • Custom SQL code for upserts is now platform-dependent, with Postgres being tailored to work in the same fashion as MySQL one Code was replaced to comply with SQL standard in each case.
  • SQL select conditions no longer use expired != 1 comparison, which is invalid (boolean vs. int) comparison in Postgres. They are replaced with expired != true, which is handled by both databases (MySQL treats true as 1 and false as 0 - see https://dev.mysql.com/doc/refman/8.0/en/boolean-literals.html).

Checklist:

  • Provided PR description.
  • Tested the solution manually.
  • Provided automated test coverage.
  • Checked that target branch is set correctly (master for features, the oldest supported for bugs).
  • Ran PHP CS Fixer for new PHP code (use $ composer fix-cs).
  • Asked for a review (ping @ezsystems/engineering-team).

@Steveb-p Steveb-p requested review from alongosz and a team September 5, 2022 08:10
@sonarcloud
Copy link

sonarcloud bot commented Sep 5, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Member

@micszo micszo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with DFS/NFS on Postgres and MySQL.

QA Approved on Ibexa Commerce 3.3.26-dev.

@micszo micszo removed their assignment Sep 12, 2022
@Steveb-p Steveb-p merged commit 05ad63a into 1.3 Sep 12, 2022
@Steveb-p Steveb-p deleted the ibx-3791-dfs-postgres branch September 12, 2022 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working QA approved
7 participants