MySql concat string needs to be used instead of ||
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Won't Fix
|
High
|
Unassigned |
Bug Description
Mahara 15.10
OS: Ubuntu 14.04
DB: Mysql 5.5
Browser: any
I've noticed that in htdocs/
For example, line 275:
$sql = $alias . '.' . $field . ' ' . db_ilike() . " '%' || ? || '%'";
Unfortunately, this doesn't always work with Mysql. In order for this to work we would need to set PIPES_AS_CONCAT
Please refer to the documentation:
http://
Otherwise, strings need to be concatenated using: 'CONCAT'.
This function is also available in Postgres.
So, perhaps we should be using CONCAT instead of '||'.
So, the above line 275 would be:
$sql = $alias . '.' . $field . ' ' . db_ilike() . " concat('%', ? , '%')";
Changed in mahara: | |
status: | New → Triaged |
Changed in mahara: | |
status: | Incomplete → Confirmed |
importance: | Undecided → High |
milestone: | none → 16.10.0 |
Ghada wants to take another look before deciding on whether anything needs to be fixed.