$equal = $m[1];
}
+ $match = '';
+
// Regex
if (strpos($v,'~')===0) {
+ $match = 'regexp';
$v = substr($v,1);
$v = $this->db()->quote($v);
$equal = ' '.($not ? 'NOT ' : '').$regexp.' ';
$v = $this->db()->quote($v);
if (preg_match('/[_%]/',$v)) {
+ $match = 'like';
$equal = ' '.($not ? 'NOT ' : '').'LIKE ';
+ $equal = ' '.($not ? 'NOT ' : '').$this->db()->like_nocase().' ';
} else {
$equal = ($not ? '<> ' : $equal);
}
# NB 04.01.18 if (preg_match("/(LIKE|$regexp) ..$/","$equal$v") and $field->null) {
#bye("$equal$v");
#if (preg_match("/(LIKE|$regexp) ..$/","$equal$v")) {
- if (preg_match("/^(LIKE|$regexp)$/",trim($equal))) {
+# NB 07.01.18 if (preg_match("/^(LIKE|$regexp)$/",trim($equal))) {
+ if ($match) {
if ($field->null) $k = 'COALESCE('.$name.','.$this->db()->quote('').")";
} elseif ($field->extras) {
return "$name::text";
},
+'like_nocase' => 'ILIKE',
+
'localFile' => array (getenv('HOME').'/.pgpass','^[^:]+:[^:]+:<D.NAME>:(?P<user>[^:]+):(?<password>[^:]+)'),
'databases' => 'SELECT datname as name,pg_catalog.pg_get_userbyid(datdba) as owner,pg_catalog.pg_encoding_encoding) as encoding, datcollate as "collate",datctype as "Ctype" FROM pg_catalog.pg_database',