The current schema for locales_translation includes 2 indexes:

  • sid: sid
  • string_type: [sid, type]

Since the former is entirely covered by the second, it provides no optimization and just add a little cost on writes, and should be removed.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fgm created an issue. See original summary.

fgm’s picture

Status: Needs review » Needs work
fgm’s picture

Status: Needs review » Needs work
fgm’s picture

Status: Needs work » Needs review

"SQLSTATE[HY000] [1049] Unknown database 'jenkins_drupal_patches_38435'"

Looks like a testbot issue. The only test with a different error also passes locally. Resubmitting.

fgm’s picture

fgm’s picture

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Kristen Pol’s picture

Version: 8.9.x-dev » 9.1.x-dev
Issue tags: +Bug Smash Initiative

Patch applies cleanly to 9.1.x.

Kristen Pol’s picture

Issue tags: +Needs manual testing

Thanks for the issue and patch.

1) Code looks straightforward.

+++ b/core/modules/locale/locale.install
@@ -304,3 +303,14 @@ function locale_update_8300() {
+/**
+ * Delete useless index.

Nitpick: IMO it would be better to reword like "Delete redundant index." or "Delete unnecessary index."

2) Marking for manual testing.

3) Kicking off tests for 9.1.x.

phenaproxima’s picture

This needs an update path test.

Kristen Pol’s picture

Status: Needs review » Needs work
fgm’s picture

Status: Needs work » Active

No idea how to write update path tests: do you have an example ? It can't be a unit test since it uses the DB, maybe a Kernel test ?

Also, I suspect the update will need to be renumbered to 910x since it is now for core 9.1.x ?

Kristen Pol’s picture

Found out from @acbramley via #bugsmash there should be plenty of examples by searching for UpdatePathTest. I'm not at computer yet, otherwise I'd find some.

phenaproxima’s picture

Assigned: Unassigned » phenaproxima

Self-assigning for an update path test. I have prior experience with this :)

phenaproxima’s picture

Created an update path test with a fail patch to prove that it actually works. :) This includes a long-needed reroll of #4, plus a bugfix.

I'm removing the "Needs manual testing" tag because here be an automated test.

Berdir’s picture

I suppose this is a lot faster, but I'm pretty sure the full dump has translation modules enabled and we could just that dump?

phenaproxima’s picture

It seems you are correct. Boy, I sure wish I'd known about that before I went through the slogfest of creating a new fixture. Phooey.

Berdir’s picture

Assigned: phenaproxima » Unassigned
Status: Needs review » Reviewed & tested by the community

> before I went through the slogfest of creating a new fixture. Phooey.

Been there, done that: #3034062-25: Remove hal.module BC layers for rest, hal and serialization before figuring out that the filled dump just works. And with the extended dump referenced there, we'd have the same starting point for newer modules like media, layout builder, ... :)

Looks good now I think. Probably not worth the trouble to backport the update function to older versions.

The last submitted patch, 20: 2925318-20-FAIL.patch, failed testing. View results

Kristen Pol’s picture

Nice! That's very clear. Unrelated, but I've noticed a number of patches referring to files that still have 8.* in them like below but I didn't find an issue in the issue queue related to this. I assume that we should create one to change these?

+++ b/core/modules/locale/tests/src/Functional/LocaleUpdatePathTest.php
@@ -0,0 +1,38 @@
+      __DIR__ . '/../../../../system/tests/fixtures/update/drupal-8.8.0.filled.standard.php.gz',

Other examples:

./core/tests/fixtures/files/translations/drupal-8.0.0-beta2.hu.po
./core/tests/fixtures/files/translations/drupal-8.0.0.de.po
Berdir’s picture

8.8.0 is the correct name. It's a database dump of Drupal 8.8. We'll bump that to 9.3 or whatever the minimum Drupal 9 minor version will be that you can update to Drupal 10.

The translation files are used in \Drupal\KernelTests\Core\Installer\InstallerLanguageTest::testInstallerTranslationFiles() and I don't think it really cares about what the version is. We could update it, but it would quickly be out of date again anyway.

Kristen Pol’s picture

Ah! Makes sense. Thanks for the clarification.

jungle’s picture

+++ b/core/modules/locale/tests/src/Functional/LocaleUpdatePathTest.php
@@ -0,0 +1,38 @@
+      __DIR__ . '/../../../../system/tests/fixtures/update/drupal-8.8.0.filled.standard.php.gz',

Could be dirname(__DIR__, 4) . '/system/tests/fixtures/update/drupal-8.8.0.filled.standard.php.gz',. addressing and stay RTBC.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed c758df9 and pushed to 9.1.x. Thanks!

diff --git a/core/modules/locale/locale.install b/core/modules/locale/locale.install
index e7821ab928..6f33b78f00 100644
--- a/core/modules/locale/locale.install
+++ b/core/modules/locale/locale.install
@@ -308,7 +308,7 @@ function locale_requirements($phase) {
 }
 
 /**
- * Deletes an unnecessary index in the locales_location table.
+ * Delete an unnecessary index on the locales_location table.
  */
 function locale_update_9101() {
   $schema = \Drupal::database()->schema();

hook_update_N functions are an exception to the rule the verb should be active - i.e. this should be Delete and not Deletes - because this is shown to a user on the review updates screen. Plus indexes are on, not in, a table. Fixed on commit.

  • alexpott committed c758df9 on 9.1.x
    Issue #2925318 by phenaproxima, fgm, jungle, Kristen Pol, Berdir:...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.