#366 Global search case sensitive or not working at all (issue with COLLATION)

SVN:trunk[1158]
This commit is contained in:
Romain Quetiez
2011-03-31 08:29:02 +00:00
parent e3ac7067f7
commit d4321ec1ce
4 changed files with 52 additions and 58 deletions

View File

@@ -682,6 +682,33 @@ class CharConcatExpression extends Expression
}
}
class CharConcatWSExpression extends CharConcatExpression
{
protected $m_separator;
public function __construct($separator, $aExpressions)
{
$this->m_separator = $separator;
parent::__construct($aExpressions);
}
// recursive rendering
public function Render(&$aArgs = null, $bRetrofitParams = false)
{
$aRes = array();
foreach ($this->m_aExpressions as $oExpr)
{
$sCol = $oExpr->Render($aArgs, $bRetrofitParams);
// Concat will be globally NULL if one single argument is null !
$aRes[] = "COALESCE($sCol, '')";
}
$sSep = CMDBSource::Quote($this->m_separator);
return "CAST(CONCAT_WS($sSep, ".implode(', ', $aRes).") AS CHAR)";
}
}
class QueryBuilderExpressions
{
protected $m_oConditionExpr;