Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In system_schema()
we create a flood
table. We should change Drupal\Core\Flood\DatabaseBackend
to only create a table if necessary - this means that alternate flood implementations can safely remove the flood table and know that if the site swaps back to the DatabaseBackend the table will be created.
Comment | File | Size | Author |
---|---|---|---|
#9 | 2662990-9.patch | 10.36 KB | alexpott |
#9 | 6-9-interdiff.txt | 779 bytes | alexpott |
#6 | 2662990-6.patch | 10.36 KB | alexpott |
#6 | 4-6-interdiff.txt | 442 bytes | alexpott |
#4 | 2-4-interdiff.txt | 2.85 KB | alexpott |
Comments
Comment #2
alexpottOne less table to create during system install.
Comment #4
alexpottFixing the test fails.
Comment #5
dawehnerLovely!
It still seems to be that we better truncate with a check whether the table exists. We don't want to break the test when something else in the system adds flood entries.
Comment #6
alexpott@dawehner well wouldn't that'd be a sign of unexpected testing. I think that code is overly defensive.
Fixed a missing use statement.
Comment #7
dawehnerWell yeah, this is test resilience vs. test coverage in general.
One question: is
drupal_get_module_schema()
considered as API or rather its return values? Theoretically something could rely on it.$return is unused
This british english is also a bit weird these days: 'crecreate'
Comment #8
catchYes.
No.
That's explicitly covered in https://www.drupal.org/core/d8-bc-policy (near the top).
Comment #9
alexpottThanks @dawehner the 7.1 was there already. Patch attached fixes 7.2
Comment #10
dawehnerThank you alex!
Comment #11
jibranInset I can understand but how can this throw an exception?
Comment #12
alexpott@jibran being called before the table created is one reason - but some networking problem with db might throw an exception
Comment #14
catchCommitted/pushed to 8.1.x, thanks!
Comment #15
catchCommitted/pushed to 8.1.x, thanks!
Comment #17
cilefen CreditAttribution: cilefen as a volunteer commented#2926226: The ::garbageCollection() pattern from flood/cache can cause logged MySQL errors on cron