Closed (won't fix)
Project:
Drupal core
Version:
9.2.x-dev
Component:
database system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Jul 2019 at 05:47 UTC
Updated:
5 Feb 2021 at 08:21 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
znerol commentedFix might look something like this.
Comment #5
tstoecklerHmm... tests without assertions are no longer allowed, maybe just collapse the two new test methods into one? Not sure what the best solution is.
Fix looks good, though.
Comment #6
znerol commentedOr just add an assertion. Regrettably there is no
Schema::primaryKeyExists()but we can useSchema::addPrimaryKeyand look for the exception.Comment #8
tstoecklerActually, I think this is the test that needs an assertion. The other one is fine because
setExpectedException()counts as an "assertion" as far as I know.Comment #9
znerol commentedRight.
Comment #10
znerol commentedPatch still applies.
Comment #11
tstoecklerThanks for the bump. still looks good, and test makes sense, as well. Let's do it!
Comment #12
mondrakeA fundamental/conceptual question here: are we sure we want to support partial lenght columns in a unique key context here (primary/unique keys)? IMHO it seems weird you design a table with fields that you want to be kind of unique via PK, then to have a PK that would fatally fail when trying to insert records that lead to duplicate key, which can happen if your field varies in the part that is not part of the key -- how are we going to decide which is the 'right' key and record?
Recently, Doctrine DBAL have introduced partial length support to indexes https://github.com/doctrine/dbal/pull/2412, but have done so only for indexes, that allow duplicated keys - not for primary/unique keys.
Comment #13
catchAgreed with #12, this seems like the wrong direction to me.
Comment #14
mondrakeFiled #3082239: Forbid limited length primary and unique keys, allow only in indexes, which is basically the opposite of what is being done here.
Comment #15
mondrakeComment #19
mondrakeI suggest to wont fix this.
Comment #20
znerol commentedBecause the patch is too trivial? Or because the bug is too obscure?
Comment #21
znerol commentedOh, I somehow missed #12. I completely agree, this is wontfix.