IdoQuery: Allow check if a column is case insensitive compared
refs #9029
This commit is contained in:
parent
b061161979
commit
84ac316cde
|
@ -553,6 +553,31 @@ abstract class IdoQuery extends DbQuery
|
|||
return stripos($mapped, 'UNIX_TIMESTAMP') !== false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return whether the given alias or column name provides case insensitive value comparison
|
||||
*
|
||||
* @param string $aliasOrColumn
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isCaseInsensitive($aliasOrColumn)
|
||||
{
|
||||
if ($this->isCustomVar($aliasOrColumn)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$column = $this->getMappedField($aliasOrColumn) ?: $aliasOrColumn;
|
||||
if (! $column) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (! empty($this->columnsWithoutCollation)) {
|
||||
return in_array($column, $this->columnsWithoutCollation) || strpos($column, 'LOWER') !== 0;
|
||||
}
|
||||
|
||||
return preg_match('/ COLLATE .+$/', $column) === 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply oracle specific query initialization
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue