Back in commit 1a4c340b6959f7d1bd5bf2b6147686a0d627af8a (circa 2007)
was added to make mysql being used by Mahara act like postgres so that
it can do the pipes (||)
So this shouldn't be an issue.
I did not when I copied sql commands from code to try directly in mysql
I'd need to do SET SQL_MODE='POSTGRESQL'; first
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask
on #mahara-dev or mahara.org forum before editing or unsubscribing it!
MySql concat string needs to be used instead of ||
Status in Mahara:
OS: Ubuntu 14.04
DB: Mysql 5.5
I've noticed that in htdocs/search/internal/lib.php, the SQL used to
concatenate strings is '||'.
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:
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('%', ? , '%')";
To manage notifications about this bug go to:
Mailing list: https://launchpad.net/~mahara-contributors
Post to : email@example.com
Unsubscribe : https://launchpad.net/~mahara-contributors
More help : https://help.launchpad.net/ListHelp