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
base: 3.8.x
Are you sure you want to change the base?
Conversation
Can we cover this with a test please? |
Is your request for a one functional test into |
@derrabus may I understand your wishes better? |
A test please. |
6245c62
to
49f86b9
Compare
|
||
$schemaManager = $this->schemaManager; | ||
$refl = new ReflectionMethod($schemaManager, 'selectTableColumns'); | ||
$refl->setAccessible(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing method accessibility in tests is a smell. Why do you need to do it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is because full table introspection with schema is not supported (yet).
Therefore, I test functional behaviour using protected methods.
1c6cc29
to
150fa23
Compare
@derrabus may I ask you for a review? |
Sure. It's on my todo list, but I don't have much time to spend on open source work at the moment. |
150fa23
to
19b8299
Compare
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? |
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. |
So, what does this PR fix then? An implementation detail? |
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? |
Summary
Missed in #4804 and fix related #5517.
When merging up (into 4.x), simply remove the
str_replace
.