Skip to content

Commit

Permalink
[Instruments] Handle empty bulkLoadInstanceData (#8857)
Browse files Browse the repository at this point in the history
The logic of bulkLoadInstanceData constructs an SQL statement
with the parameters bound to it by looping over the iterable
passed to it. If the iterable is empty, the result will generate
SQL with the string `.. IN ()` which is not valid SQL. This
returns an empty array in that case before attempting to generate
the SQL, since the result of bulk loading nothing should be
nothing.
  • Loading branch information
driusan authored Aug 10, 2023
1 parent d096e8b commit faa7472
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions php/libraries/NDB_BVL_Instrument.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2205,6 +2205,9 @@ abstract class NDB_BVL_Instrument extends NDB_Page
$prepBindings[] = ":cid$i";
$prepValues["cid$i"] = $commentID;
}
if ($i === 0) {
return [];
}

if ($this->jsonData) {
$jsondata = $db->pselect(
Expand Down

0 comments on commit faa7472

Please sign in to comment.