MDL-35155: Fix MSSQL bug in sql_substr()

This commit is contained in:
Simon Coggins
2014-12-31 15:14:58 +00:00
committed by Dan Poltawski
parent eb1dc9fab9
commit e53364b62f
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -1257,7 +1257,7 @@ class mssql_native_moodle_database extends moodle_database {
s only returning name of SQL substring function, it now requires all parameters.');
}
if ($length === false) {
return "SUBSTRING($expr, $start, (LEN($expr) - $start + 1))";
return "SUBSTRING($expr, $start, LEN($expr))";
} else {
return "SUBSTRING($expr, $start, $length)";
}
+1 -1
View File
@@ -1324,7 +1324,7 @@ class sqlsrv_native_moodle_database extends moodle_database {
}
if ($length === false) {
return "SUBSTRING($expr, $start, (LEN($expr) - $start + 1))";
return "SUBSTRING($expr, $start, LEN($expr))";
} else {
return "SUBSTRING($expr, $start, $length)";
}