mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
MDL-39572: Fix sql_order_by_text() to use length argument correctly
This commit is contained in:
parent
be4bf53d6d
commit
be8c6d7bc8
@ -1220,7 +1220,7 @@ class mssql_native_moodle_database extends moodle_database {
|
||||
}
|
||||
|
||||
public function sql_order_by_text($fieldname, $numchars=32) {
|
||||
return ' CONVERT(varchar, ' . $fieldname . ', ' . $numchars . ')';
|
||||
return " CONVERT(varchar({$numchars}), {$fieldname})";
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1281,7 +1281,7 @@ class sqlsrv_native_moodle_database extends moodle_database {
|
||||
}
|
||||
|
||||
public function sql_order_by_text($fieldname, $numchars = 32) {
|
||||
return ' CONVERT(varchar, '.$fieldname.', '.$numchars.')';
|
||||
return " CONVERT(varchar({$numchars}), {$fieldname})";
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user