-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 SQLite temp table name must not contain dot #6315
Conversation
4aadd00
to
7a7c3ac
Compare
You know the drill: no test, no merge. 🤗 |
@derrabus how would you like me tested the 1st commit, if the DB name is currently unused? |
You've filed this PR as a bugfix, so that first commit of yours must fix some kind of bug that you can reproduce in a functional test, right? |
I am splitting this PR into multiple ones. I will update this PR later. |
a2db19f
to
d12624e
Compare
2591f16
to
4ec0586
Compare
This PR is done and has been reworked to contain only a single change with a test. |
As per the testing guidelines, this change must be covered by an integration test:
|
4ec0586
to
0036224
Compare
@greg0ire functional test added. |
Great. Now please improve your commit message. One shouldn't have to read the code to understand what you're talking about.
|
In some situations, SqlitePlatform::getAlterTableSQL() relies on a temporary table to store data from the original table while it gets recreated. The name of this temporary table is built by concatenating a prefix (__temp__) with the name of the original table. When the original table name is foo.bar, there is an issue because then the temporary table name becomes __temp__foo.bar which implies schema.table. Use the unqualified table name so that the temporary table becomes __temp__bar.
0036224
to
87289d4
Compare
Thank you for reviewing this PR. Commit message amended. |
Two approving reviews, can this PR be merged? |
I'd love to get a review from Alexander before we do that. |
Hi @derrabus, can I ask you for your approval too? |
Shouldn't the temporary data table be created in the same schema as the table we want to alter? Right now we cut off the schema and always create the table in the main schema which feels like we're shoveling data between SQLite files for no reason. |
see https://sqlite.org/forum/forumpost/7b70c81a35488424 In https://dbfiddle.uk/CXMRsuHM repro I have confirmed it - |
TIL, thanks for clarifying. 🙂 |
* 4.1.x: Fix example for QB delete and update in doc block Bump doctrine/.github from 5.0.0 to 5.0.1 (#6391) PHPStan 1.10.67, PHPUnit 9.6.19, PHPCS 3.9.2 (#6387) Fix "Plugin 'mysql_native_password' is not loaded" (#6388) Run tests against MySQL 8.4 (#6386) Use 3.8.x as a target for dependabot version updates (#6384) Setup dependabot Fix SQLiteSchemaManagerTest case Switch to substr implementation fix merge Bump workflow actions Fix SQL Server "extended property" SQL generation (#6353) Fix DB name passing in SqliteSchemaManager::listTableForeignKeys() (#6338) Fix SQLite temp table name must not contain dot (#6315) Provide CODECOV_TOKEN Upgrade to codecov/codecov-action v4 Set fail_ci_if_error flag to true Specify the minor version number
Summary
Fix invalid SQL generated when table with schema is given. As it was invalid, this PR is fully BC in sense of the exact generated SQL.