mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 17:06:53 +02:00
MDL-39572: Fix sql_order_by_text() to use length argument correctly
This commit is contained in:
parent
f6868f9c9d
commit
a6bc89e4d2
2 changed files with 2 additions and 2 deletions
|
@ -1218,7 +1218,7 @@ class mssql_native_moodle_database extends moodle_database {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function sql_order_by_text($fieldname, $numchars=32) {
|
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) {
|
public function sql_order_by_text($fieldname, $numchars = 32) {
|
||||||
return ' CONVERT(varchar, '.$fieldname.', '.$numchars.')';
|
return " CONVERT(varchar({$numchars}), {$fieldname})";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue