MDL-35155: Fix MSSQL bug in sql_substr()

This commit is contained in:
Simon Coggins
2015-01-08 08:14:19 +00:00
committed by Dan Poltawski
parent 56624fa968
commit 227b31ccbe
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)";
}