$having = $where = array();
if (empty($logic)) $logic = 'AND';
+ $regexp = $this->db()->type('regexp');
+ if (empty($regexp)) $regexp = 'REGEXP';
+
foreach ($this->fields() as $k => $field) {
// No empty values
if (strpos($v,'~')===0) {
$v = substr($v,1);
$v = $this->db()->quote($v);
- $equal = ' '.($not ? 'NOT ' : '').'REGEXP ';
+ $equal = ' '.($not ? 'NOT ' : '').$regexp.' ';
// Text
} elseif (preg_match('/text|char|blob/',$field->type)
}
- if (preg_match('/(LIKE|REGEXP) ..$/',"$equal$v")) {
+ if (preg_match("/(LIKE|$regexp) ..$/","$equal$v")) {
$k = "COALESCE($k,".$this->db()->quote('').")";
}
<?php
$DB_TYPES['pgsql'] = array (
'extra_where' => 'denorm',
+'regexp' => '~',
'localFile' => array (getenv('HOME').'/.pgpass','^[^:]+:[^:]+:<NAME>:(?P<user>[^:]+):(?<password>[^:]+)'),