Skip to content

Commit

Permalink
start use DISTINCT in $sql->select - Required to eliminate potential …
Browse files Browse the repository at this point in the history
…duplication in case inoptimal query.
  • Loading branch information
semteacher committed Oct 29, 2024
1 parent 40cc696 commit cc72758
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions classes/booking_rules/rules/rule_daysbefore.php
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ public function get_records_for_execution(

$condition->execute($sql, $params, $testmode, $nextruntime);

$sql->select = " DISTINCT " . $sql->select; // Required to eliminate potential duplication in case inoptimal query.
$sqlstring = "SELECT $sql->select FROM $sql->from WHERE $sql->where";

$records = $DB->get_records_sql($sqlstring, $params);
Expand Down

0 comments on commit cc72758

Please sign in to comment.