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

fix: fix share reminder job for oracle #48182

Merged
merged 1 commit into from
Sep 18, 2024
Merged

Conversation

icewind1991
Copy link
Member

This was always broken but nobody noticed because of CI issues

@icewind1991 icewind1991 marked this pull request as ready for review September 18, 2024 17:34
@icewind1991 icewind1991 added the 3. to review Waiting for reviews label Sep 18, 2024
@icewind1991 icewind1991 added this to the Nextcloud 31 milestone Sep 18, 2024
@icewind1991 icewind1991 requested review from a team, ArtificialOwl, Altahrim, Fenn-CS, artonge and come-nc and removed request for a team September 18, 2024 17:34
@nickvergessen nickvergessen merged commit 342927b into master Sep 18, 2024
171 of 177 checks passed
@nickvergessen nickvergessen deleted the oracle-share-reminder branch September 18, 2024 18:24
@@ -28,7 +29,7 @@ interface IQueryBuilder {
/**
* @since 9.0.0
*/
public const PARAM_BOOL = ParameterType::BOOLEAN;
public const PARAM_BOOL = Types::BOOLEAN;
Copy link
Member

Choose a reason for hiding this comment

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

This sounds like a serious bug in doctrine which we should report and get addressed upstream?
The binding type should be ParameterType::
https://github.com/nextcloud/3rdparty/blob/9ca60e9d2b12f711a756c35d37fd19c178db685b/doctrine/dbal/src/Types/BooleanType.php#L56-L59
Doc block of ParameterType also states that it is for statement parameters:
https://github.com/nextcloud/3rdparty/blob/a9be8d0755e6d786c34e44ef29e88d8f9b90c65b/doctrine/dbal/src/ParameterType.php#L6

The Types are the dbal types

Copy link
Member

Choose a reason for hiding this comment

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

Let me try if bumping doctrine to 3.9.1 fixes it #48306

Copy link
Member

Choose a reason for hiding this comment

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

Okay, still fails with 3.9.1

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks!

I've debugged the weirdness with OCI and booleans a while ago: #45630

The type constants from doctrine/dbal allows us to use doctrine type conversion logic. I was unsure back then about changing it because apps, especially on OCI, may depend on the broken behavior.

Should we also update the other constants to use the doctrine types?

Copy link
Member

Choose a reason for hiding this comment

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

Should we also update the other constants to use the doctrine types?

As said I think the switch that was done here is actually wrong. It uses the DBAL architectural type now and not the PDO parameter type anymore.

Copy link
Contributor

@kesselb kesselb Sep 24, 2024

Choose a reason for hiding this comment

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

As said I think the switch that was done here is actually wrong. It uses the DBAL architectural type now and not the PDO parameter type anymore.

Depends ;)

Using the DBAL type leads to doctrine taking care of the type juggeling for us. That's probably good, but also a risky change. We don't know if the results are still the same.

We are not using the pdo driver for OCI. I think that's the reason for the weird behavior with OCI, especially with booleans. The OCI driver just didn't know what to do with type "5" (because that's the pdo constant) and fallbacks to string as default. If we use the dbal type doctrine will convert the boolean to 0/1 and set type int.

I've discussed #45630 with Christoph a while ago, and we didn't know how to move forward 🤷

We updated doctrine since then, not sure if my observations are still correct

Copy link
Member Author

Choose a reason for hiding this comment

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

Note that we already use the DBAL types for datetime and json

@nickvergessen
Copy link
Member

Backport?

@nickvergessen
Copy link
Member

@AndyScherzinger
Copy link
Member

Backport?

For v30 it sounds like a safe bet. For former versions, if an issue that it should be fixed too

@AndyScherzinger
Copy link
Member

@nickvergessen does your backport cover 30?

@nickvergessen
Copy link
Member

I only backported the database/querybuilder change, not the reminder job stuff

@AndyScherzinger
Copy link
Member

@icewind1991 does this need backporting (broken on 30 or older?)

@icewind1991
Copy link
Member Author

The share reminder didn't get backported so it's not required to backport this

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

Successfully merging this pull request may close these issues.

6 participants