backporting r30991-4: using egw_db->capabilities[egw_db::CASE_INSENSITIVE_LIKE] and other PostgreSQL 8.3 fixes

This commit is contained in:
Ralf Becker 2010-06-22 17:03:05 +00:00
parent e4eb9d32ba
commit a2b6b3fe58
3 changed files with 3 additions and 4 deletions

View File

@ -345,7 +345,7 @@ class calendar_so
{
foreach(array('cal_title','cal_description','cal_location') as $col)
{
$to_or[] = $col . ' LIKE ' . $this->db->quote('%'.$params['query'].'%');
$to_or[] = $col.' '.$this->db->capabilities[egw_db::CAPABILITY_CASE_INSENSITIV_LIKE].' '.$this->db->quote('%'.$params['query'].'%');
}
$where[] = '('.implode(' OR ',$to_or).')';
}

View File

@ -504,7 +504,7 @@ class egw_db
$this->capabilities[self::CAPABILITY_NAME_CASE] = 'lower';
$this->capabilities[self::CAPABILITY_CLIENT_ENCODING] = (float) $db_version >= 7.4;
$this->capabilities[self::CAPABILITY_OUTER_JOIN] = true;
$this->capabilities[self::CAPABILITY_CASE_INSENSITIV_LIKE] = 'ILIKE';
$this->capabilities[self::CAPABILITY_CASE_INSENSITIV_LIKE] = '::text ILIKE';
$this->capabilities[self::CAPABILITY_REQUIRE_TRUNCATE_VARCHAR] = true;
break;

View File

@ -965,8 +965,7 @@ class translation
*/
static function get_message_id($translation,$app=null,$lang=null)
{
$like = self::$db->Type == 'pgsql' ? 'ILIKE' : 'LIKE';
$where = array('content '.$like.' '.self::$db->quote($translation)); // like to be case-insensitive
$where = array('content '.self::$db->capabilities[egw_db::CAPABILITY_CASE_INSENSITIV_LIKE].' '.self::$db->quote($translation));
if ($app) $where['app_name'] = $app;
if ($lang) $where['lang'] = $lang;