Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15333703
D21400.id50940.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
902 B
Referenced Files
None
Subscribers
None
D21400.id50940.diff
View Options
diff --git a/src/infrastructure/storage/lisk/LiskDAO.php b/src/infrastructure/storage/lisk/LiskDAO.php
--- a/src/infrastructure/storage/lisk/LiskDAO.php
+++ b/src/infrastructure/storage/lisk/LiskDAO.php
@@ -653,7 +653,18 @@
foreach ($rows as $row) {
$obj = clone $this;
if ($id_key && isset($row[$id_key])) {
- $result[$row[$id_key]] = $obj->loadFromArray($row);
+ $row_id = $row[$id_key];
+
+ if (isset($result[$row_id])) {
+ throw new Exception(
+ pht(
+ 'Rows passed to "loadAllFromArray(...)" include two or more '.
+ 'rows with the same ID ("%s"). Rows must have unique IDs. '.
+ 'An underlying query may be missing a GROUP BY.',
+ $row_id));
+ }
+
+ $result[$row_id] = $obj->loadFromArray($row);
} else {
$result[] = $obj->loadFromArray($row);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 9, 4:07 AM (1 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7376793
Default Alt Text
D21400.id50940.diff (902 B)
Attached To
Mode
D21400: Require rows passed to "loadAllFromArray()" have unique keys
Attached
Detach File
Event Timeline
Log In to Comment