-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Labels
0. Needs triagePending check for reproducibility or if it fits our roadmapPending check for reproducibility or if it fits our roadmapbug
Description
Steps to reproduce
- Install bookmarks app (I believe the bug lies much deeper, but I'll demonstrate it with a concrete example. It's probably pretty easy to adapt the steps here to utilize other database entries/tables)
- Add two bookmarks, edit the first one's title to read
foo_and the second one'sfooo
Variant 1:
Run:
$title = 'foo_';
$qb = $c->query('ServerContainer')->getDatabaseConnection()->getQueryBuilder();
$qb->select('title');
$qb
->from('bookmarks', 'b')
->where($qb->expr()->iLike('b.title', $qb->createNamedParameter('%'.$this->db->escapeLikeParameter($title).'%')););
$results = $qb->execute()->fetchAll();
assert(count($results) === 1); // fails, $results is empty
Variant 2:
$title = 'foo_';
$qb = $c->query('ServerContainer')->getDatabaseConnection()->getQueryBuilder();
$qb->select('title');
$qb
->from('bookmarks', 'b')
->where($qb->expr()->iLike('b.title', $qb->createNamedParameter('%'.$title.'%')););
$results = $qb->execute()->fetchAll();
assert(count($results) === 1) // fails, $results is now 2
Originally I stumbled onto this in nextcloud/bookmarks#432
Server configuration
Operating system: Ubuntu
Web server: apache2
Database: SQLite
PHP version: 7.1.8
Nextcloud version: 12.0.2
Updated from an older Nextcloud/ownCloud or fresh install: fresh install
Where did you install Nextcloud from: docker
Signing status:
Signing status
No errors have been found.
Metadata
Metadata
Assignees
Labels
0. Needs triagePending check for reproducibility or if it fits our roadmapPending check for reproducibility or if it fits our roadmapbug