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 unwanted SQLite schema emulation in SqliteSchemaManager #6337

Open
wants to merge 2 commits into
base: 3.9.x
Choose a base branch
from

Conversation

mvorisek
Copy link
Contributor

@mvorisek mvorisek commented Mar 18, 2024

Q A
Type bug
Fixed issues #6314

Summary

Missed in #4804 and fix related #5517.

When merging up (into 4.x), simply remove the str_replace.

@derrabus
Copy link
Member

Can we cover this with a test please?

@mvorisek
Copy link
Contributor Author

mvorisek commented Mar 18, 2024

Is your request for a one functional test into Doctrine\DBAL\Tests\Functional\Schema\SqliteSchemaManagerTest?

@mvorisek
Copy link
Contributor Author

@derrabus may I understand your wishes better?

@derrabus
Copy link
Member

A test please.

@mvorisek mvorisek force-pushed the fix_6314_sqlite_schema_emulation branch 7 times, most recently from 6245c62 to 49f86b9 Compare April 5, 2024 19:28
@mvorisek mvorisek force-pushed the fix_6314_sqlite_schema_emulation branch 4 times, most recently from 1c6cc29 to 150fa23 Compare April 6, 2024 22:32
@greg0ire greg0ire requested a review from derrabus April 7, 2024 06:51
@mvorisek
Copy link
Contributor Author

@derrabus may I ask you for a review?

@derrabus
Copy link
Member

Sure. It's on my todo list, but I don't have much time to spend on open source work at the moment.

@mvorisek mvorisek force-pushed the fix_6314_sqlite_schema_emulation branch from 150fa23 to 19b8299 Compare May 3, 2024 08:06
@derrabus
Copy link
Member

derrabus commented May 3, 2024

I don't quite understand this test, tbh. You're testing with a dot in a table name that SQLite to my astonishment seems to accept when quoted. But that doesn't have much to do with schema emulation. Shouldn't the test work with a table from an actual secondary schema?

@mvorisek
Copy link
Contributor Author

mvorisek commented May 3, 2024

The fixed methods accept database name using 1st parameter, the table name is accepted as 2nd parameter, thus the 2nd parameter can be unquoted and dot must be preserved (it cannot contain schema).

As the fixed methods cannot be reached easily from public API as table with schema and dot is not fully supported yet, the test is coded to call the fixed protected methods.

@derrabus
Copy link
Member

derrabus commented May 3, 2024

As the fixed methods cannot be reached easily from public API as table with schema and dot is not fully supported yet, the test is coded to call the fixed protected methods.

So, what does this PR fix then? An implementation detail?

@mvorisek
Copy link
Contributor Author

mvorisek commented May 3, 2024

The schema manager can be extended by user classes and the protected methods must behave as expected. This PR fixes the behaviour and it is tested with functional test. For more details, see the #4804 and #5517 PRs, ie. the schema emulation is deprecated for 3.x and removed in 4.x. Can we agree on this? Is there anything else I should do?

@mvorisek mvorisek requested a review from greg0ire May 5, 2024 06:51
greg0ire
greg0ire previously approved these changes May 5, 2024
@mvorisek
Copy link
Contributor Author

Hi @derrabus, we are waiting for your approval. The "SQLite schema emulation to manager" was added in #5268 without any explanation. I belive it is there for historical reasons and such emulation was officially removed in #4804 (for v4.x) and in #5517 (for v3.x with the possibility to disable it).

Given these facts, I belive the emulation simply should not be there, ie. it should be disableable for v3.x and removed for v4.x.

Tests are testing the desired behaviour.

My question to you is, what can I do more to get this PR merged and if we are on the same page with the reasoning why it should be removed. Thank you!

@mvorisek
Copy link
Contributor Author

Can this PR be please either approved or can I get an actionable feedback?

SenseException
SenseException previously approved these changes Jun 9, 2024
@mvorisek
Copy link
Contributor Author

Can this PR be merged?

@derrabus
Copy link
Member

I'm working on my DBAL backlog as I find the time to do so. I was able to clear some items from that list today and will come back to this PR soon. Bear with me.

@mvorisek
Copy link
Contributor Author

mvorisek commented Jul 3, 2024

This PR is about 2 month since approved... Can it be merged now, please.

@derrabus
Copy link
Member

derrabus commented Jul 3, 2024

I'm sorry, this took me so long. But my concern remains: your test runs assertions on implementation details. It looks complicated and I don't want to maintain it. Your change looks like you're fixing a valid problem, but I need a functional test (no reflection voodoo) that reproduces your problem as you encounter it.

@mvorisek
Copy link
Contributor Author

mvorisek commented Jul 3, 2024

Thank you - please tell me how to test better.

@derrabus
Copy link
Member

derrabus commented Jul 3, 2024

Write a test that reproduces your problem as you encounter it. That's all I can tell you because I have no clue why you're hitting this issue at all.

@mvorisek
Copy link
Contributor Author

mvorisek commented Jul 3, 2024

We override non-final SqliteSchemaManager class. I propose to merge this as is as in v4.0 the schema emulation has been removed and thus I would be fine with empty merge/test when merging up.

@derrabus
Copy link
Member

derrabus commented Jul 3, 2024

We override non-final SqliteSchemaManager class.

So, do the same in the test.

@derrabus derrabus changed the base branch from 3.8.x to 3.9.x August 14, 2024 11:00
@derrabus derrabus dismissed stale reviews from SenseException and greg0ire August 14, 2024 11:00

The base branch was changed.

@mvorisek mvorisek force-pushed the fix_6314_sqlite_schema_emulation branch 2 times, most recently from 913f249 to ee4cf6f Compare October 1, 2024 12:43
@mvorisek mvorisek force-pushed the fix_6314_sqlite_schema_emulation branch from ee4cf6f to b480519 Compare October 25, 2024 09:41
@mvorisek
Copy link
Contributor Author

@derrabus the test was adjusted, can I have your final review?

@derrabus
Copy link
Member

I'm touring conferences this week. Please ping me again if I haven't reviewed the PR by the end of next week.

@mvorisek
Copy link
Contributor Author

@derrabus ping as requested

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