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

pkp/pkp-lib#9132 fix SQL datetime and date comparison for editorial s… #9162

Merged
merged 1 commit into from
Jul 19, 2023

Conversation

bozana
Copy link
Collaborator

@bozana bozana commented Jul 14, 2023

s. #9132

@bozana
Copy link
Collaborator Author

bozana commented Jul 14, 2023

@asmecher or @jonasraoni, could one of you review this change?
I think DATE() can be used for both, MySQL and PostgreSQL, right?

@jonasraoni
Copy link
Contributor

@bozana the DATE isn't a function in PostgreSQL, but a construction, you can use it this way: SELECT DATE '2023-01-01 10:22:22' :D
But it works, so it's fine, another option that works for both would be CAST('2023-01-01 10:22:22' AS DATE)

@jonasraoni
Copy link
Contributor

And about the change... I've already had issues with it, see #7709 and #6011, AFAICR, it's not possible to reach a perfect solution (e.g. a solution might fit the QuickSubmit, but not the Native XML plugin and other import tools out there).

Personally, I'd drop this heuristic. It doesn't work very well and will have to be maintained forever.

Basically, to drop the concept of imported records for now, and recover it once the #8389 gets implemented. Users that imported content, should understand that it might affect statistics, but that's just my opinion =]

@bozana
Copy link
Collaborator Author

bozana commented Jul 16, 2023

Thanks @jonasraoni. To be on the safe side, I will then use CAST(X AS DATE)...

@bozana
Copy link
Collaborator Author

bozana commented Jul 18, 2023

@jonasraoni, now I used CAST(X AS DATE). OK so?
I will not remove that heuristic now -- it is already there for some time, and the user might got used to it in a way, and it did solved a problem... So, lets hope the right solution will come soon... :-)

@jonasraoni
Copy link
Contributor

I think it's better/more standard.

About the heuristic, we would need the approval from @asmecher, I just wanted to raise the flag regarding the existing issues and future maintenance burden.

@bozana bozana merged commit 5e7948b into pkp:stable-3_4_0 Jul 19, 2023
@bozana bozana deleted the 9132-3_4_0 branch July 19, 2023 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants