Skip to content

Commit

Permalink
fixed bug in hash calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Isler committed Dec 2, 2015
1 parent db7780a commit f5d221a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Spiritix/LadaCache/Reflector/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ public function __construct(EloquentQueryBuilder $queryBuilder)
public function getHash()
{
// Never remove the database from the identifier
// Query doesn't necessarily include it, will cause cache conflicts
$database = $this->prefix($this->getDatabase(), self::PREFIX_DATABASE);
$identifier = $database . $this->queryBuilder->toSql();
// Most SQL queries do not include the target database
$identifier = $this->getDatabase() .
$this->queryBuilder->toSql() .
serialize($this->queryBuilder->getBindings());

return md5($identifier);
}
Expand Down

0 comments on commit f5d221a

Please sign in to comment.