Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Cache] Use non binary tag prefix #49713

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

Closed

Conversation

alexndlm
Copy link
Contributor

Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets
License MIT
Doc PR

When using PostgreSQL binary part of the cache item ID loses.

@GromNaN
Copy link
Member

GromNaN commented Mar 16, 2023

Thank you for your pull request! Can you please provide more details about the issue you encountered with PostgreSQL? Specifically, can you explain how the current implementation is causing the issue and how your proposed change addresses it and if it works with other DBMS? This information will help us better understand the problem and review your pull request more effectively.

@alexndlm
Copy link
Contributor Author

SQLite allows storing a binary string in the ID field.
For MySQL - it also must work since the field is of type varbinary.

For PostgreSQL, it creates a varchar field, and the binary part is dropped.

@nicolas-grekas
Copy link
Member

I'd rather ensure we can store null chars in the column, those are allowed in keys.

@alexndlm
Copy link
Contributor Author

@nicolas-grekas, what about this solution #49741?

@alexndlm
Copy link
Contributor Author

The last idea :)

@nicolas-grekas, will changing the ID column for PostgreSQL to binary be ok?

@nicolas-grekas
Copy link
Member

We should instead change the type of the column. There is no other way. Keys can be binary, that's a fact. We could encode them indeed, but why, when we can just change the type of the column?

@nicolas-grekas
Copy link
Member

will changing the ID column for PostgreSQL to binary be ok?

yes indeed, out comments raced :)
I'm waiting for your PR :)

@alexndlm alexndlm deleted the feature/use-nonbinary-tag-prefix branch March 20, 2023 19:13
fabpot added a commit that referenced this pull request Mar 29, 2023
… in tags prefix (nicolas-grekas)

This PR was merged into the 6.3 branch.

Discussion
----------

[Cache] Fix DBAL deprecations and stop using NUL chars in tags prefix

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

The change of the tag prefix is motivated by #49713.

The other changes are to accommodate for deprecations in DBAL.

Note that `DoctrineDbalAdapter::getServerVersion()` keep calling the deprecated `getWrappedConnection()` method because although the code says one should exist, there is no alternative way to access the server version. Drivers are all missing a `getServerVersion()` method (/cc `@derrabus` FYI)

Commits
-------

f4398a1 [Cache] Fix DBAL deprecations and stop using NUL chars in tags prefix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants