MDL-46269 dml: Add casesensitive argument to sql_regex()

This commit is contained in:
Marina Glancy
2017-10-16 16:53:46 +08:00
parent 16d5ec55c9
commit 109fbd5a15
4 changed files with 48 additions and 18 deletions
+6 -2
View File
@@ -1260,8 +1260,12 @@ class pgsql_native_moodle_database extends moodle_database {
return true;
}
public function sql_regex($positivematch=true) {
return $positivematch ? '~*' : '!~*';
public function sql_regex($positivematch = true, $casesensitive = false) {
if ($casesensitive) {
return $positivematch ? '~' : '!~';
} else {
return $positivematch ? '~*' : '!~*';
}
}
/**