diff --git a/lib/dmllib.php b/lib/dmllib.php index b049b23480a..6980cd332d9 100644 --- a/lib/dmllib.php +++ b/lib/dmllib.php @@ -1899,7 +1899,9 @@ function sql_isempty($tablename, $fieldname, $nullablefield, $textfield) { break; } - return ' ' . $sql . ' '; /// Adding spaces to avoid wrong SQLs due to concatenation + // Add spaces to avoid wrong SQLs due to concatenation. + // Add brackets to avoid operator precedence problems. + return ' (' . $sql . ') '; } /**