-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
4.0.1
-
MOODLE_400_STABLE
MDL-70055 got us part of the way there, but now instead of postgres complaining, PDO does. PDO stores the number of query params as an int, so it cannot exceed 65535. Running this script should produce an error even with MDL-70055 applied:
<?php
|
|
require_once('config.php'); |
|
$usernames = array_map(function($i) { |
return "user$i"; |
}, range(0,65535));
|
|
[$insql, $params] = $DB->get_in_or_equal($usernames); |
|
$DB->get_records_sql("SELECT DISTINCT id FROM {user} WHERE username $insql", $params); |