Page MenuHomePhabricator

Require rows passed to "loadAllFromArray()" have unique keys
ClosedPublic

Authored by epriestley on Jul 9 2020, 5:56 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 20, 6:17 PM
Unknown Object (File)
Sun, Nov 17, 2:02 AM
Unknown Object (File)
Sat, Nov 16, 4:51 PM
Unknown Object (File)
Fri, Oct 25, 4:09 AM
Unknown Object (File)
Oct 18 2024, 12:48 AM
Unknown Object (File)
Sep 28 2024, 4:23 PM
Unknown Object (File)
Sep 22 2024, 12:08 PM
Unknown Object (File)
Sep 21 2024, 1:08 AM
Subscribers
None

Details

Summary

See PHI1809, which identified a bug in Project search where queries with a large number of slugs could paginate improperly.

This change detects problems in this category: cases where multiple rows with the same ID are passed to "loadAllFromArray()". It's likely that all cases it detects are cases where a GROUP BY is missing.

Since this might have some false positives or detect some things which aren't fundamentally problematic, I'm planning to hold it until the next release.

Test Plan
  • Reverted D21399, then created a project with multiple slugs and queried for one of them via "project.search". Hit this new exeception.
  • Browsed around a bit, didn't immediately catch any collateral damage.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable