Skip to content

Commit

Permalink
This is supposed to return a bitmask, not a boolean.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Jan 22, 2014
1 parent 614e631 commit b7fdbbb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion framework/Db/lib/Horde/Db/Adapter/Postgresql/Schema.php
Expand Up @@ -940,7 +940,7 @@ public function buildClause($lhs, $op, $rhs, $bind = false,
case '&':
/* Only PgSQL 7.3+ understands SQL99 'SIMILAR TO'; use ~ for
* greater backwards compatibility. */
$query = 'CASE WHEN CAST(%s AS VARCHAR) ~ \'^-?[0-9]+$\' THEN (CAST(%s AS INTEGER) %s %s) <> 0 ELSE FALSE END';
$query = 'CASE WHEN CAST(%s AS VARCHAR) ~ \'^-?[0-9]+$\' THEN (CAST(%s AS INTEGER) %s %s) ELSE 0 END';
if ($bind) {
return array(sprintf($query, $lhs, $lhs, $op, '?'),
array((int)$rhs));
Expand Down

0 comments on commit b7fdbbb

Please sign in to comment.