Index: lib/dml/oci_native_moodle_database.php =================================================================== RCS file: /cvsroot/moodle/moodle/lib/dml/oci_native_moodle_database.php,v retrieving revision 1.33 diff -u -r1.33 oci_native_moodle_database.php --- lib/dml/oci_native_moodle_database.php 8 Nov 2009 23:13:31 -0000 1.33 +++ lib/dml/oci_native_moodle_database.php 7 Jan 2010 12:14:39 -0000 @@ -1457,9 +1457,9 @@ public function sql_isempty($tablename, $fieldname, $nullablefield, $textfield) { if ($textfield) { - return " ".$this->sql_compare_text($fieldname)." = '".$this->sql_empty()."' "; + return " (".$this->sql_compare_text($fieldname)." = '".$this->sql_empty()."') "; } else { - return " $fieldname = '".$this->sql_empty()."' "; + return " ($fieldname = '".$this->sql_empty()."') "; } } Index: lib/dml/mssql_native_moodle_database.php =================================================================== RCS file: /cvsroot/moodle/moodle/lib/dml/mssql_native_moodle_database.php,v retrieving revision 1.14 diff -u -r1.14 mssql_native_moodle_database.php --- lib/dml/mssql_native_moodle_database.php 7 Nov 2009 08:52:57 -0000 1.14 +++ lib/dml/mssql_native_moodle_database.php 7 Jan 2010 12:14:38 -0000 @@ -1113,9 +1113,9 @@ public function sql_isempty($tablename, $fieldname, $nullablefield, $textfield) { if ($textfield) { - return $this->sql_compare_text($fieldname)." = '' "; + return ' (' . $this->sql_compare_text($fieldname) . " = '') "; } else { - return " $fieldname = '' "; + return " ($fieldname = '') "; } } Index: lib/dml/moodle_database.php =================================================================== RCS file: /cvsroot/moodle/moodle/lib/dml/moodle_database.php,v retrieving revision 1.107 diff -u -r1.107 moodle_database.php --- lib/dml/moodle_database.php 8 Nov 2009 21:19:11 -0000 1.107 +++ lib/dml/moodle_database.php 7 Jan 2010 12:14:38 -0000 @@ -1843,7 +1843,7 @@ * @return string the sql code to be added to check for empty values */ public function sql_isempty($tablename, $fieldname, $nullablefield, $textfield) { - return " $fieldname = '' "; + return " ($fieldname = '') "; } /**