Skip to content

Commit 7103ac9

Browse files
committed
differ between mysql and postgres in this very specific case of like comparision
1 parent d029205 commit 7103ac9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/dba/LikeFilter.class.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@ function getQueryString(AbstractModelFactory $factory, bool $includeTable = fals
3636
$inv = " NOT";
3737
}
3838

39-
return $table . AbstractModelFactory::getMappedModelKey($factory->getNullObject(), $this->key) . $inv . " LIKE ? COLLATE \"C\"";
39+
// it is not ideal to have to make a distinction between the DB types here, but currently there does not seem to be another solution to achieve real case-sensitive like filtering
40+
$likeStatement = " BINARY LIKE ?";
41+
if (DBA_TYPE == 'postgres') {
42+
$likeStatement = " LIKE ? COLLATE \"C\"";
43+
}
44+
return $table . AbstractModelFactory::getMappedModelKey($factory->getNullObject(), $this->key) . $inv . $likeStatement;
4045
}
4146

4247
function getValue() {

0 commit comments

Comments
 (0)