Improve limit check in edit-foreign plugin
The limit is enforced in the query to prevent out-of-memory errors for big target tables.
This commit is contained in:
parent
28a84fec18
commit
d00927ce66
|
@ -30,7 +30,7 @@ class AdminerEditForeign {
|
||||||
if (preg_match('~binary~', $field["type"])) {
|
if (preg_match('~binary~', $field["type"])) {
|
||||||
$column = "HEX($column)";
|
$column = "HEX($column)";
|
||||||
}
|
}
|
||||||
$options = array("" => "") + get_vals("SELECT $column FROM " . table($target) . " ORDER BY 1");
|
$options = array("" => "") + get_vals("SELECT $column FROM " . table($target) . " ORDER BY 1" . ($this->_limit ? " LIMIT " . ($this->_limit + 1) : ""));
|
||||||
if ($this->_limit && count($options) - 1 > $this->_limit) {
|
if ($this->_limit && count($options) - 1 > $this->_limit) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue