Needs work
Project:
Drupal core
Version:
main
Component:
postgresql db driver
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
17 Apr 2020 at 17:37 UTC
Updated:
10 Nov 2020 at 09:18 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
effulgentsia commentedComment #4
effulgentsia commentedComment #6
effulgentsia commentedThe console output of the test run in #4 surfaced a legitimate bug.
Various Views tests, such as
Drupal\Tests\datetime\Kernel\Views\FilterDateTimeTest, fail because they end up using theviews.date_sqlservice (which is MySQL-specific) instead of thepgsql.views.date_sqlservice. The reason they don't use the latter is because perBackendCompilerPass, that's based on$container->get('database')->driver(), which for the fallback driver isPgsqlFallback, so we'd need a service namedPgsqlFallback.views.date_sql.I think we should improve
BackendCompilerPassto check for a service based on$container->get('database')->databaseType()if it can't find one based on$container->get('database')->driver().Comment #7
effulgentsia commentedFor now, just doing this to see how far it gets us.
Comment #9
effulgentsia commentedA bit more progress, but not much.
Comment #11
effulgentsia commentedThis should fix a bunch of the functional tests.
Comment #13
daffie commented@effulgentsia: Thank for working on this. Some test failures you have come from the fact that the fallback driver is located in a module. In #3129043: Move core database drivers to modules of their own, I have the same problems. I fixed some test with the following code changes:
I fixed the test Drupal\Tests\system\Functional\Module\InstallUninstallTest by making the module hidden.
@alexpott has problem with how the fallback driver is extending the classes of the by core supported PostgreSQL driver. I have no idea how to do it in another way. Waiting for another solution from @alexpott. When you have an idea how to solve it then please speak up.
Comment #14
effulgentsia commentedThanks @daffie! That helped. Here's a slightly centralized implementation of that for this issue's purposes to keep this patch smaller, but your approach is probably the better one for #3129043: Move core database drivers to modules of their own.
I'm not yet clear on why that's needed. That test should be able to install and uninstall this module just as successfully as all the core ones. I need to investigate that more.
Comment #15
daffie commentedI think one should not be able to uninstall the module that provides the database driver in use.
Comment #16
effulgentsia commentedIf we want core to enforce that, then let's open an issue for that. That would also imply that core's installer needs to enable the module if that's the selected driver.
Comment #18
daffie commentedThat is next on my list. Right after #3129043: Move core database drivers to modules of their own has landed.
Comment #19
effulgentsia commentedOops.
PgSqlFallbackis incorrectly capitalized. It should bePgsqlFallback. This fixes that.Interdiffs aren't as useful when file names are changed, so instead attaching just a plain diff between the #14 patch and this one.
Comment #21
daffie commentedWhen I look at the changes in the current patch and I look at the patch from #3129043: Move core database drivers to modules of their own, I come to the conclusion that that issue is more or less blocking getting https://www.drupal.org/project/pgsql_fallback to pass the testbot.
Comment #22
daffie commentedCreated #3129534: Automatically enable the module that is providing the current database driver. This issue will block the improvement of the BackendCompilerPass. We need it to test the new BackendCompilerPass stuff.
Comment #23
daffie commentedCreated #3130973: Make the backend overridable service discovery also check the database type for an overridden service for fixing the problem.
Comment #24
daffie commentedUpdated the patch with the patch from #3130973: Make the backend overridable service discovery also check the database type for an overridden service and a couple of other small improvements.
Comment #25
daffie commentedRerolling the patch, because #3152003: EndOfTransactionQueriesTest does not include bootstrap.inc early enough for contrib database drivers and #3130973: Make the backend overridable service discovery also check the database type for an overridden service have landed.
Comment #27
daffie commentedRerolling the patch, because #3151118: Include bootstrap.inc using composer has landed.