|
|
|
|
@ -31,7 +31,7 @@ use OCP\DB\QueryBuilder\IQueryBuilder; |
|
|
|
|
class MySqlExpressionBuilder extends ExpressionBuilder { |
|
|
|
|
|
|
|
|
|
/** @var string */ |
|
|
|
|
protected $charset; |
|
|
|
|
protected $collation; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @param ConnectionAdapter $connection |
|
|
|
|
@ -41,7 +41,7 @@ class MySqlExpressionBuilder extends ExpressionBuilder { |
|
|
|
|
parent::__construct($connection, $queryBuilder); |
|
|
|
|
|
|
|
|
|
$params = $connection->getInner()->getParams(); |
|
|
|
|
$this->charset = isset($params['charset']) ? $params['charset'] : 'utf8'; |
|
|
|
|
$this->collation = $params['collation'] ?? (($params['charset'] ?? 'utf8') . '_general_ci'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
@ -50,6 +50,6 @@ class MySqlExpressionBuilder extends ExpressionBuilder { |
|
|
|
|
public function iLike($x, $y, $type = null): string { |
|
|
|
|
$x = $this->helper->quoteColumnName($x); |
|
|
|
|
$y = $this->helper->quoteColumnName($y); |
|
|
|
|
return $this->expressionBuilder->comparison($x, ' COLLATE ' . $this->charset . '_general_ci LIKE', $y); |
|
|
|
|
return $this->expressionBuilder->comparison($x, ' COLLATE ' . $this->collation . ' LIKE', $y); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|