Details
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | Ladsgroup | T299691 Break down monster class: Database | |||
Resolved | Ladsgroup | T307616 Move SQL building code from Database class to SQLPlatform | |||
Duplicate | None | T310141 Some SemanticMediaWiki queries fail due to duplicated table prefix |
Event Timeline
Change 789251 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):
[mediawiki/core@master] rdbms: Move out more functions from Database to SQLPlatform
Change 789317 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):
[mediawiki/extensions/CheckUser@master] Mock db platform
Change 789317 merged by jenkins-bot:
[mediawiki/extensions/CheckUser@master] tests: Mock db platform
Change 789251 merged by jenkins-bot:
[mediawiki/core@master] rdbms: Move out more functions from Database to SQLPlatform
Change 791065 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):
[mediawiki/core@master] rdbms: Prepare for moving Database::selectSQLText to SQLPlatform
Change 791065 merged by jenkins-bot:
[mediawiki/core@master] rdbms: Prepare for moving Database::selectSQLText to SQLPlatform
Change 792689 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):
[mediawiki/core@master] rdbms: Move four more functions from Database to SQLPlatform
Change 792690 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):
[mediawiki/core@master] rdbms: Move handling index and table aliases to SQLPlatform
Change 792704 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):
[mediawiki/core@master] [WIP] rdbms: Move selectSQLText to SQLPlatform
Change 792689 merged by jenkins-bot:
[mediawiki/core@master] rdbms: Move four more functions from Database to SQLPlatform
Change 792690 merged by jenkins-bot:
[mediawiki/core@master] rdbms: Move handling index and table aliases to SQLPlatform
Change 792704 merged by jenkins-bot:
[mediawiki/core@master] rdbms: Move selectSQLText to SQLPlatform
Change 802763 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):
[mediawiki/core@master] [WIP] rdbms: Move assertion logic in sql building to sql platform
@Ladsgroup Per T310214, we could probably do with a test that ensures the double escaping issue doesn't happen again. If we already have a case of e.g. select( [ 'x' => tableName('x') ], .. ), then maybe the issue is expanding it to include coverage to sqlite/mysql/postgres for the jobs that enable those, either with sql text based assertions or perhaps a simple end-to-end test that selects something simple from a table.
Sure, please remind me when I'm back. I want to focus on unblocking train atm (I have a very little time rn)
Change 808844 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):
[mediawiki/core@master] rdbms: Move methods delegated to platform to one central place
Change 808852 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):
[mediawiki/core@master] rdbms: Migrate buildGroupConcatField and buildSelectSubquery to platform
Change 808844 merged by jenkins-bot:
[mediawiki/core@master] rdbms: Move methods delegated to platform to one central place
Change 808852 merged by jenkins-bot:
[mediawiki/core@master] rdbms: Migrate buildGroupConcatField and buildSelectSubquery to platform
Change 809054 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):
[mediawiki/core@master] rdbms: Migrate insert sql building code to sql platform
Change 809054 merged by jenkins-bot:
[mediawiki/core@master] rdbms: Migrate insert sql building code to sql platform
Change 816169 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):
[mediawiki/core@master] rdbms: Migrate delete and update sql building to SQLPlatform
Change 816169 merged by jenkins-bot:
[mediawiki/core@master] rdbms: Migrate delete and update sql building to SQLPlatform
Change 817782 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):
[mediawiki/core@master] rdbms: Migrate dropTable sql building to SQLPlatform
Change 817782 merged by jenkins-bot:
[mediawiki/core@master] rdbms: Migrate dropTable sql building to SQLPlatform
Change 817807 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):
[mediawiki/core@master] rdbms: Migrate SQL anlysis code pieces to SQLPlatform
Change 802763 abandoned by Ladsgroup:
[mediawiki/core@master] [WIP] rdbms: Move assertion logic in sql building to sql platform
Reason:
done in other patches, there is no hope to bring this back without practically rewriting it.
Change 817807 merged by jenkins-bot:
[mediawiki/core@master] rdbms: Migrate SQL analysis code pieces to SQLPlatform
Change 818459 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):
[mediawiki/core@master] rdbms: Migrate several more Database::do* to SqlPlatform
Change 818463 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):
[mediawiki/core@master] rdbms: Migrate delegated protected functions of Database and drop them
Change 818473 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):
[mediawiki/core@master] rdbms: Bump the minimum required version of PG to 9.5
Change 818459 merged by jenkins-bot:
[mediawiki/core@master] rdbms: Migrate several more Database::do* to SqlPlatform
Change 818463 merged by jenkins-bot:
[mediawiki/core@master] rdbms: Migrate delegated protected functions of Database and drop them
Change 818473 merged by jenkins-bot:
[mediawiki/core@master] rdbms: Bump the minimum required version of PG to 9.5
Change 819157 had a related patch set uploaded (by Ladsgroup; author: Amir Sarabadani):
[mediawiki/core@master] rdbms: Migrate SchemaVar and replaceVars from Database to SQLPlatform
Change 819157 merged by jenkins-bot:
[mediawiki/core@master] rdbms: Migrate SchemaVar and replaceVars from Database to SQLPlatform
Now there is no large chunk of code left in Database class that could be moved to SQLPlatform.
It is much cleaner and the complexity score of the class has fallen to ~600 out of ~1000 and it's no longer the most complex class of MediaWiki. We deprecated and removed six Database::do* methods.
Of course way more work could to be done. There is a long-tail of small clean ups. Improving mocking in tests (now that we can rely on the mocked addQuotes(), lots of tests use new SQLPlatformTestHelper( new AddQuoterMock() ); for platform) and small code pieces could be refactored to move to platform but that can happen in its own time.
As far as I'm concerned, this is done. 🎉