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:
parent
eb1dc9fab9
commit
e53364b62f
@ -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)";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user