Commit 46065f0b authored by catch's avatar catch

Issue #1575790 by greg.1.anderson, sun, tim.plunkett: Fixed Update #7002 fails...

Issue #1575790 by greg.1.anderson, sun, tim.plunkett: Fixed Update #7002 fails on postgres - ILIKE operator on bytea not supported.
parent 20ba61fd
......@@ -138,6 +138,17 @@ public function query($query, array $args = array(), $options = array()) {
}
}
public function prepareQuery($query) {
// mapConditionOperator converts LIKE operations to ILIKE for consistency
// with MySQL. However, Postgres does not support ILIKE on bytea (blobs)
// fields.
// To make the ILIKE operator work, we type-cast bytea fields into text.
// @todo This workaround only affects bytea fields, but the involved field
// types involved in the query are unknown, so there is no way to
// conditionally execute this for affected queries only.
return parent::prepareQuery(preg_replace('/ ([^ ]+) +(I*LIKE|NOT +I*LIKE) /i', ' ${1}::text ${2} ', $query));
}
public function queryRange($query, $from, $count, array $args = array(), array $options = array()) {
return $this->query($query . ' LIMIT ' . (int) $count . ' OFFSET ' . (int) $from, $args, $options);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment