mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-17327 database : fixed comparisions in sql to be cross db compatible in data_get_advanced_search_sql()
This was failing under the MSSQL database drivers.
This commit is contained in:
parent
31b6200263
commit
c197d5f028
1 changed files with 5 additions and 2 deletions
|
@ -3573,12 +3573,15 @@ function data_get_advanced_search_sql($sort, $data, $recordids, $selectdata, $so
|
|||
{user} u ';
|
||||
$groupsql = ' GROUP BY r.id, r.approved, r.timecreated, r.timemodified, r.userid, u.firstname, u.lastname ';
|
||||
} else {
|
||||
$nestselectsql = 'SELECT r.id, r.approved, r.timecreated, r.timemodified, r.userid, u.firstname, u.lastname, c.content
|
||||
$sortfield = data_get_field_from_id($sort, $data);
|
||||
$sortcontent = $DB->sql_compare_text('c.' . $sortfield->get_sort_field());
|
||||
$sortcontentfull = $sortfield->get_sort_sql($sortcontent);
|
||||
$nestselectsql = 'SELECT r.id, r.approved, r.timecreated, r.timemodified, r.userid, u.firstname, u.lastname, ' . $sortcontentfull . '
|
||||
AS _order
|
||||
FROM {data_content} c,
|
||||
{data_records} r,
|
||||
{user} u ';
|
||||
$groupsql = ' GROUP BY r.id, r.approved, r.timecreated, r.timemodified, r.userid, u.firstname, u.lastname, c.content ';
|
||||
$groupsql = ' GROUP BY r.id, r.approved, r.timecreated, r.timemodified, r.userid, u.firstname, u.lastname, ' .$sortcontentfull;
|
||||
}
|
||||
$nestfromsql = 'WHERE c.recordid = r.id
|
||||
AND r.dataid = :dataid
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue