1
0
mirror of https://github.com/moodle/moodle.git synced 2025-04-25 10:26:17 +02:00

MDL-35155: Fix MSSQL bug in sql_substr()

This commit is contained in:
Simon Coggins 2012-08-31 13:42:02 +12:00 committed by Dan Poltawski
parent eb1dc9fab9
commit e53364b62f
2 changed files with 2 additions and 2 deletions

@ -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)";
}

@ -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)";
}